I am trying to run a merge between a mp4 video and a m4a audio files. Several other were generated properly, but this one starts and freezes at time 00:02:54.08. If I stop it (ctrl+c) several minutes afterwards, the output.mp4 file have 0 bytes. I do not have a lot of clues why it happens. Anybody experienced something similar?
[]# ffmpeg -i 91dff482-213e-45f7-84ea-a176f255c118.mp4 -i 91dff482-213e-45f7-84ea-a176f255c118.m4a -c:v copy -strict -2 -c:a aac -b:a 160k output.mp4
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '91dff482-213e-45f7-84ea-a176f255c118.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1iso6mp41
encoder : Lavf56.25.101
Duration: 00:05:00.00, start: 0.133333, bitrate: 30 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 29 kb/s, 15 fps, 15 tbr, 15360 tbn, 30 tbc (default)
Metadata:
rotate : 90
handler_name : VideoHandler
Side data:
displaymatrix: rotation of -90.00 degrees
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '91dff482-213e-45f7-84ea-a176f255c118.m4a':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2iso6mp41
encoder : Lavf56.25.101
Duration: 00:05:00.15, start: 0.000000, bitrate: 14 kb/s
Stream #1:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 13 kb/s (default)
Metadata:
handler_name : SoundHandler
[aac # 0x1b761a0] Too many bits per frame requested, clamping to max
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1iso6mp41
encoder : Lavf56.25.101
Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 29 kb/s, 15 fps, 15 tbr, 15360 tbn, 15360 tbc (default)
Metadata:
rotate : 90
handler_name : VideoHandler
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 8000 Hz, mono, fltp, 48 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc56.26.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 2612 fps= 33 q=-1.0 size= 1568kB time=00:02:54.08 bitrate= 73.8kbits/s
Run
ffmpeg -ss 02:50 -i video -ss 02:50 -i audio -c:v copy -strict -2 -c:a aac -b:a 160k test.mp4.
If this stops after few seconds, there's some anomaly in one of the bitstreams and you'll have to remux one or both of the input files and try again i.e.
ffmpeg -i video -c copy -an newvideo.mp4
ffmpeg -i audio -c copy -vn newaudio.mp4
Related
I am not getting why this isn't working.. I have tried to get the video streams with [0:v]/[0:1]/[0:v:0] & the audio streams with [0:a]/[0:0]/[0:0:0].
nothing worked.
Explaining the inputs:
1.1st input stream is a video that can be of varying resolution on which the filter adds a padding on to make it 600:480.
2.2nd input is an overlay png which is already at 5:4 ratio.. just making it 600:480 before it gets overlaid in the filter.
3.3rd & 4th ones are also videos which I don't care if they get stretched.. n they are getting stretched to 600:480.
4.so finally there are 3 streams 1 overlaid video 2 stretched videos which needs to be concatenated.
here's the command :
ffmpeg
-i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4'
-i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png'
-i '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4'
-i '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4'
-filter_complex
"[0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a]"
-map "[v]"
-map "[a]"
-c:v libx264
-shortest /home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_final.mp4
this is the complete error I am getting :
Stream specifier ':a' in filtergraph description [0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a] matches no streams.
also there are these warnings:
[Parsed_setsar_9 # 0x219fba0] num:den syntax is deprecated, please use num/den or named options instead
[Parsed_setsar_11 # 0x21a4840] num:den syntax is deprecated, please use num/den or named options instead
Complete log as requested :
[root#cloud ~]# ffmpeg -i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4' -i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png' -i '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4' -i '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4' -filter_complex \ "[0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx264 -shortest /home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_final.mp4
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libdc1394 --enable-libfaac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2017-08-21 02:23:24
Duration: 00:02:17.23, start: 0.000000, bitrate: 417 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x360 [SAR 1:1 DAR 16:9], 318 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
Metadata:
creation_time : 2017-08-21 02:23:24
handler_name : IsoMedia File Produced by Google, 5-11-2011
Input #1, png_pipe, from '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba, 600x479, 25 tbr, 25 tbn, 25 tbc
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp41mp42isom
creation_time : 2018-01-31 22:40:09
Duration: 00:00:04.90, start: 0.103811, bitrate: 846 kb/s
Stream #2:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/bt709), 1920x1080, 827 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2018-01-31 22:40:10
handler_name : Core Media Video
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp41mp42isom
creation_time : 2018-01-31 22:40:09
Duration: 00:00:04.90, start: 0.103811, bitrate: 846 kb/s
Stream #3:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/bt709), 1920x1080, 827 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2018-01-31 22:40:10
handler_name : Core Media Video
[Parsed_setsar_9 # 0x17c8ba0] num:den syntax is deprecated, please use num/den or named options instead
[Parsed_setsar_11 # 0x17cd840] num:den syntax is deprecated, please use num/den or named options instead
Stream specifier ':a' in filtergraph description [0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a] matches no streams.
Your other inputs don't have audio. A dummy audio has to be supplied.
ffmpeg \
-i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4' \
-i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png' \
-i '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4' \
-i '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4' \
-f lavfi -t 0.1 -i anullsrc \
-filter_complex \
"[0:v]trim=0:138,setpts=PTS-STARTPTS[v0]; \
[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0]; \
[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][4:a][z][a0][x1][4:a]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx264 -shortest /home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_final.mp4
I am not getting why this isn't working.. I have tried to get the video streams with [0:v]/[0:1]/[0:v:0] & the audio streams with [0:a]/[0:0]/[0:0:0].
nothing worked.
Explaining the inputs:
1.1st input stream is a video that can be of varying resolution on which the filter adds a padding on to make it 600:480.
2.2nd input is an overlay png which is already at 5:4 ratio.. just making it 600:480 before it gets overlaid in the filter.
3.3rd & 4th ones are also videos which I don't care if they get stretched.. n they are getting stretched to 600:480.
4.so finally there are 3 streams 1 overlaid video 2 stretched videos which needs to be concatenated.
here's the command :
ffmpeg
-i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4'
-i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png'
-i '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4'
-i '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4'
-filter_complex
"[0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a]"
-map "[v]"
-map "[a]"
-c:v libx264
-shortest /home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_final.mp4
this is the complete error I am getting :
Stream specifier ':a' in filtergraph description [0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a] matches no streams.
also there are these warnings:
[Parsed_setsar_9 # 0x219fba0] num:den syntax is deprecated, please use num/den or named options instead
[Parsed_setsar_11 # 0x21a4840] num:den syntax is deprecated, please use num/den or named options instead
Complete log as requested :
[root#cloud ~]# ffmpeg -i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4' -i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png' -i '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4' -i '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4' -filter_complex \ "[0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx264 -shortest /home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_final.mp4
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libdc1394 --enable-libfaac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2017-08-21 02:23:24
Duration: 00:02:17.23, start: 0.000000, bitrate: 417 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x360 [SAR 1:1 DAR 16:9], 318 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
Metadata:
creation_time : 2017-08-21 02:23:24
handler_name : IsoMedia File Produced by Google, 5-11-2011
Input #1, png_pipe, from '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba, 600x479, 25 tbr, 25 tbn, 25 tbc
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp41mp42isom
creation_time : 2018-01-31 22:40:09
Duration: 00:00:04.90, start: 0.103811, bitrate: 846 kb/s
Stream #2:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/bt709), 1920x1080, 827 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2018-01-31 22:40:10
handler_name : Core Media Video
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp41mp42isom
creation_time : 2018-01-31 22:40:09
Duration: 00:00:04.90, start: 0.103811, bitrate: 846 kb/s
Stream #3:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/bt709), 1920x1080, 827 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2018-01-31 22:40:10
handler_name : Core Media Video
[Parsed_setsar_9 # 0x17c8ba0] num:den syntax is deprecated, please use num/den or named options instead
[Parsed_setsar_11 # 0x17cd840] num:den syntax is deprecated, please use num/den or named options instead
Stream specifier ':a' in filtergraph description [0:v]trim=0:138,setpts=PTS-STARTPTS[v0];[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0];[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][2:a][z][a0][x1][3:a]concat=n=3:v=1:a=1[v][a] matches no streams.
Your other inputs don't have audio. A dummy audio has to be supplied.
ffmpeg \
-i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612.mp4' \
-i '/home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_overlay.png' \
-i '/home/vidinflux/public_html/assets/user/736/video/Lines1.mp4' \
-i '/home/vidinflux/public_html/assets/user/736/video/Lines11.mp4' \
-f lavfi -t 0.1 -i anullsrc \
-filter_complex \
"[0:v]trim=0:138,setpts=PTS-STARTPTS[v0]; \
[0:a]atrim=0:138,asetpts=PTS-STARTPTS[a0]; \
[v0]scale='gte(iw/ih\,600/480)*600+lt(iw/ih\,600/480)*((480*iw)/ih):lte(iw/ih\,600/480)*480+gt(iw/ih\,600/480)*((600*ih)/iw)',pad='600:480:(600-gte(iw/ih\,600/480)*600-lt(iw/ih\,600/480)*((480*iw)/ih))/2:(480-lte(iw/ih\,600/480)*480-gt(iw/ih\,600/480)*((600*ih)/iw))/2:black'[x];[1:v]scale=600:480[y];[x][y]overlay=0:0[z];[2:v]scale=600:480,setsar=1:1[x0];[3:v]scale=600:480,setsar=1:1[x1];[x0][4:a][z][a0][x1][4:a]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx264 -shortest /home/vidinflux/public_html/assets/temp/2018020116464612/2018020116464612_final.mp4
I can't play a video using clipbucket after installation, getting conversion status as completed but while playing the video I get an message as "not available"
Conversion file
Checking File ....
File : /var/www/html/files/conversion_queue/14958856828d300.mp4
File Exists : Yes
Preparing file...
format : mov,mp4,m4a,3gp,3g2,mj2
duration : 62.09
size : 4480694
bitrate : 577316
video_width : 640
video_height : 360
video_wh_ratio : 1.7777777777778
video_codec : h264
video_rate : 23.976023976024
video_bitrate : 479302
video_color : N/A
audio_codec : aac
audio_bitrate : 95999
audio_rate : 44100
audio_channels : 2
path : /var/www/html/files/conversion_queue/14958856828d300.mp4
rotation : 0
======Converting Video=========
Starting : Thumbs Generation
=======Low Resolution Conversion=======
Sarting : Generating Low resolution video # 2017-05-27 17:18:11
Converting Video SD File
Command : /usr/local/bin/ffmpeg -i /var/www/html/files/conversion_queue/14958856828d300.mp4 -vcodec flv -acodec libmp3lame -s 640x360 -preset medium -f mp4 -b:v 512000 -minrate 512000 -maxrate 512000 -b:a 128000 -minrate 128000 -maxrate 128000 -r 25 -ar 22050 /var/www/html/files/videos/2017/05/27/14958856828d300-sd.mp4
ffmpeg output : ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libdc1394 --enable-libfaac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/html/files/conversion_queue/14958856828d300.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2016-03-17 10:27:42
Duration: 00:01:02.09, start: 0.000000, bitrate: 577 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x360 [SAR 1:1 DAR 16:9], 479 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
Metadata:
creation_time : 2016-03-17 10:27:42
handler_name : IsoMedia File Produced by Google, 5-11-2011
Codec AVOption preset (Set the encoding preset (cf. x264 --fullhelp)) specified for output file #0 (/var/www/html/files/videos/2017/05/27/14958856828d300-sd.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
[flv # 0x2506080] Either both buffer size and max rate or neither must be specified
Output #0, mp4, to '/var/www/html/files/videos/2017/05/27/14958856828d300-sd.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
Stream #0:0(und): Video: flv1, none, q=2-31, 128 kb/s, SAR 1:1 DAR 0:0, 25 fps (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc56.26.100 flv
Stream #0:1(eng): Audio: mp3, 0 channels, 128 kb/s (default)
Metadata:
creation_time : 2016-03-17 10:27:42
handler_name : IsoMedia File Produced by Google, 5-11-2011
encoder : Lavc56.26.100 libmp3lame
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> flv1 (flv))
Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Sarting : MP4Box Conversion for SD
MP4Box Command : /usr/local/bin/MP4Box -inter 0.5 /var/www/html/files/videos/2017/05/27/14958856828d300-sd.mp4 -tmp /var/www/html/files/temp
output : Error opening file /var/www/html/files/videos/2017/05/27/14958856828d300-sd.mp4: IsoMedia File is truncated
Conversion Status : Successful # 2017-05-27 17:18:11
output_format : mov,mp4,m4a,3gp,3g2,mj2
output_duration : 62.09
output_size : 4480694
output_bitrate : 577316
output_video_width : 640
output_video_height : 360
output_video_wh_ratio : 1.7777777777778
output_video_codec : h264
output_video_rate : 23.976023976024
output_video_bitrate : 479302
output_video_color : N/A
output_audio_codec : aac
output_audio_bitrate : 95999
output_audio_rate : 44100
output_audio_channels : 2
output_path : /var/www/html/files/conversion_queue/14958856828d300.mp4
output_rotation : 0
Time Took : 9.2965 seconds
conversion_status : completed
**Error Messages**
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
output : Error opening file /var/www/html/files/videos/2017/05/27/14958856828d300-sd.mp4: IsoMedia File is truncated
Using the FFmpeg build found here: https://github.com/illuspas/ffmpeg-hw-win32
gcc 5.3.0
--enable-nvenc nvidia_video_sdk_6.0.1
--enable-libmfx Intel(R)_Media_SDK_2016.0.1
--enable-libfdk-aac 0.1.4
--enable-libspeex 1.2rc1
--enable-libx264 1:148.20150725
--enable-libopenh264 1.5.0
--enable-libx265 1.8
--enable-libopus 1.1.2
--enable-libmp3lame 3.99.5
--enable-libkvazaar 0.8.2
./configure --prefix=/home/aliang/FFmpeg/x86_64 --enable-small --disable-debug --disable-doc --arch=x86_64 --cc='ccache x86_64-w64-mingw32-gcc' --cross-prefix=x86_64-w64-mingw32- --enable-cross-compile --target-os=mingw32 --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libspeex --enable-libx264 --enable-libx265 --enable-libmfx --enable-nvenc --enable-libopenh264 --enable-libkvazaar --enable-gpl --enable-nonfree
I'm running Windows on a MacBook Pro. I also tried with a more recent build and had the same output.
Input video is from sample-videos.com.
The ffmpeg command I am running is:
ffmpeg -y -i sample.mp4 -vcodec nvenc_h264 -pixel_format yuv420p -f mp4 sample-out-nvenc.mp4
sample-out-nvenc.mp4 looks like this via ffplay or vlc:
When I grab a frame using jpeg2, the colors appear normal, but the height is squished.
ffmpeg -y -ss 15.5 -i sample.mp4 -vframes 1 -s 480x300 -f image2 grab.jpg
The ffprobe results for the output (sample-out-nvenc.mp4):
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample-out-nvenc.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100
Duration: 00:00:31.02, start: 0.021333, bitrate: 1994 kb/s
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv), 640x480 [SAR 1:1 DAR 4:3], 1650 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 342 kb/s (default)
Metadata:
handler_name : SoundHandler
Lastly the output from the nvenc encoding command:
ffmpeg -y -i sample.mp4 -vcodec nvenc_h264 -pixel_format yuv420p -f mp4 sample-out-nvenc.mp4
ffmpeg version 3.0 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --prefix=/home/aliang/FFmpeg/x86_64 --enable-small --disable-debug --disable-doc --arch=x86_64 --cc='ccache x86_64-w64-mingw32-gcc' --cross-prefix=x86_64-w64-mingw32- --enable-cross-compile --target-os=mingw32 --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libspeex --enable-libx264 --enable-libx265 --enable-libmfx --enable-nvenc --enable-libopenh264 --enable-libkvazaar --enable-gpl --enable-nonfree
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01 00:00:00
encoder : Lavf53.24.2
Duration: 00:00:31.00, start: 0.000000, bitrate: 1353 kb/s
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 966 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : SoundHandler
Output #0, mp4, to 'sample-out-nvenc.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.25.100
Stream #0:0(und): Video: h264 (nvenc_h264) ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 2000 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : VideoHandler
encoder : Lavc57.24.102 nvenc_h264
Side data:
unknown side data type 10 (24 bytes)
Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, 5.1, fltp, 341 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : SoundHandler
encoder : Lavc57.24.102 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (nvenc_h264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 774 fps=253 q=-0.0 Lsize= 7551kB time=00:00:30.99 bitrate=1995.6kbits/s speed=10.1x
video:6236kB audio:1297kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.243011%
[aac # 000001cdd9900520] Qavg: 743.457
I had exactly the same problem, with a GTX 980. This started after installing driver update 368.22. I downloaded and reverted to driver version 365.19 from the nividia driver archive and the problem went away.
So it appears to affect all nvidia cards and drivers.
I experienced the same problem with nvenc through another usecase. It seems to have been caused by the latest nvidia quadro driver. The problem was resolved when I reverted it. As you have a macbook, I guess it's fair to assume you don't have a quadro card, but it still might be a driver problem.
I want to trim a video with the following command:
ffmpeg.exe -i in.mp4 -ss 76 -t 10 -c copy -an out.mp4
which exactly means, copy 10 seconds after 76 seconds, and don't copy audio. However out.mp4 is 5 seconds length.
This is ffmpeg console output:
ffmpeg.exe -i in.mp4 -ss 76 -t 10 -c copy -an out.mp4
ffmpeg version N-78197-g5893e87 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzli
b --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
ray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab
le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger
--enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena
ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --en
able-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --
enable-lzma --enable-decklink --enable-zlib
libavutil 55. 16.101 / 55. 16.101
libavcodec 57. 22.102 / 57. 22.102
libavformat 57. 23.101 / 57. 23.101
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 27.100 / 6. 27.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf54.63.104
Duration: 00:02:28.54, start: 0.000000, bitrate: 2018 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1056 [SAR 1:1 DAR 20:11]
, 1887 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default
)
Metadata:
handler_name : SoundHandler
Output #0, mp4, to 'out.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.23.101
Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1920x1056 [SAR 1:1 DAR 20:11],
q=2-31, 1887 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 90k tbc (default)
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 143 fps=0.0 q=-1.0 Lsize= 1502kB time=00:00:09.96 bitrate=1235.5kbits/s speed= 524x
video:1499kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.194616%
When I analyze this console output I see this inconsistency. It says output time is 9.96 seconds. On the other hand it says frame is 143, so from the latter information I can calculate duration by frame/fps which is 143/23.98=5.96.
Another strange behaviour with this copy command is when I change the start time to something else output video length is varying between 5-10 seconds depending on the start time.
What might be the problem causing these unexpected behaviours?
ffmpeg only cuts at keyframes, so with inter-coded streams, you may not get exact duration. You'll have to transcode the video for a precise cut.
ffmpeg.exe -ss 76 -t 10 -i in.mp4 -an out.mp4
(Placing the -ss and -t before the input will make ffmpeg seek to the position and then decode frames. Placing them afterwards means ffmpeg decodes all frames and then discards till start time is reached)