ffpmeg drops last frame when compressing from MP4 to MP4 (libx264) - ffmpeg

So, I'm using this code to compress my *mp4 file. I need to get lower quality and decrease bitrate:
ffmpeg -i input.mp4 -c:v libx264 output.mp4
The problem is: the last frame of footage is dropped after ffmpeg compression.
Screenshot is here: screenshot_ffmpeg_drop frame
I tried to use full preferences I need, but the problem is the same.
ffmpeg -i input.mp4 -c:v libx264 -vf scale=1280:720 -preset fast -crf 29 -r 25 -c:a copy output.mp4
logfile during ffmpeg encoding:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\input.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
creation_time : 2018-10-28T11:06:03.000000Z
Duration: 00:00:12.76, start: 0.000000, bitrate: 5374 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 5368 kb/s, 25 fps, 25 tbr, 50k tbn, 50 tbc (default)
Metadata:
creation_time : 2018-10-28T11:06:03.000000Z
handler_name : Alias Data Handler
encoder : AVC Coding
Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264
(libx264)) Press [q] to stop, [?] for help [libx264 #
000002fae8b50780] using SAR=1/1 [libx264 # 000002fae8b50780] using cpu
capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 #
000002fae8b50780] profile High, level 3.1 [libx264 # 000002fae8b50780]
264 - core 155 r2901 7d0ff22 - H.264/MPEG-4 AVC codec - Copyleft
2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=2
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0
deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250
keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=30 rc=crf
mbtree=1 crf=29.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00 Output #0, mp4, to '\output.mp4': Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
encoder : Lavf58.17.100
Stream #0:0(eng): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25
tbc (default)
Metadata:
creation_time : 2018-10-28T11:06:03.000000Z
handler_name : Alias Data Handler
encoder : Lavc58.19.104 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 318 fps=127 q=-1.0 Lsize= 855kB time=00:00:12.60 bitrate=
556.0kbits/s speed=5.05x video:851kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.534683% [libx264 #
0000015d5cef0500] frame I:2 Avg QP:26.18 size: 67800 [libx264 #
0000015d5cef0500] frame P:80 Avg QP:27.93 size: 5439 [libx264 #
0000015d5cef0500] frame B:236 Avg QP:32.44 size: 1269 [libx264 #
0000015d5cef0500] consecutive B-frames: 0.9% 0.0% 0.9% 98.1%
[libx264 # 0000015d5cef0500] mb I I16..4: 10.6% 62.5% 26.8% [libx264
# 0000015d5cef0500] mb P I16..4: 0.5% 1.0% 0.2% P16..4: 36.1%
5.1% 3.6% 0.0% 0.0% skip:53.6% [libx264 # 0000015d5cef0500] mb B I16..4: 0.6% 0.5% 0.0% B16..8: 22.2% 0.6% 0.0% direct: 2.0%
skip:74.2% L0:44.9% L1:54.5% BI: 0.6% [libx264 # 0000015d5cef0500]
8x8 transform intra:55.0% inter:86.2% [libx264 # 0000015d5cef0500]
coded y,uvDC,uvAC intra: 48.1% 54.9% 27.0% inter: 3.2% 5.2% 0.2%
[libx264 # 0000015d5cef0500] i16 v,h,dc,p: 19% 56% 10% 15% [libx264 #
0000015d5cef0500] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 25% 18% 5% 6%
5% 8% 5% 8% [libx264 # 0000015d5cef0500] i4
v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 24% 9% 5% 8% 7% 9% 5% 7%
[libx264 # 0000015d5cef0500] i8c dc,h,v,p: 60% 20% 15% 4% [libx264 #
0000015d5cef0500] Weighted P-Frames: Y:0.0% UV:0.0% [libx264 #
0000015d5cef0500] ref P L0: 67.7% 32.3% [libx264 # 0000015d5cef0500]
ref B L0: 80.4% 19.6% [libx264 # 0000015d5cef0500] ref B L1: 92.1%
7.9% [libx264 # 0000015d5cef0500] kb/s:547.35

Use
ffmpeg -ignore_editlist 1 -i input.mp4 ... output.mp4

Related

Trying to convert a VideoCD MPEG to MP4 using ffmpeg

I'm trying to convert a VideoCD MPEG to MP4 using:
FFMPEG 5.1
ffmpeg.exe -nostdin -y -loglevel info -hide_banner -i "ITEM0010.DAT" -c:v libx264 -crf 18 -qscale:v 3 -c:a aac -ar 96000 -map_metadata -1 "output.mp4"
I'm getting:
[mpeg # 0000024b81bf4480] start time for stream 1 is not set in estimate_timings_from_pts
[mpeg # 0000024b81bf4480] stream 1 : no TS found at start of file, duration not set
[mpeg # 0000024b81bf4480] Could not find codec parameters for stream 1 (Audio: mp2, 0 channels, s16p): unspecified frame size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpeg, from 'C:\Concierge\ITEM0010.DAT':
Stream #0:1[0x1c0]: Audio: mp2, 0 channels, s16p
Stream #0:2[0x1e2]: Video: mpeg1video, yuv420p(tv), 704x576 [SAR 178:163 DAR 1958:1467], 1100 kb/s, 25 tbr, 90k tbn
Stream mapping:
Stream #0:2 -> #0:0 (mpeg1video (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (mp2 (native) -> aac (native))
[libx264 # 0000024b81c86000] -qscale is ignored, -crf is recommended.
[libx264 # 0000024b81c86000] using SAR=178/163
[libx264 # 0000024b81c86000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0000024b81c86000] profile High, level 3.0, 4:2:0, 8-bit
[libx264 # 0000024b81c86000] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[abuffer # 0000024b84979880] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
Last message repeated 1 times
[abuffer # 0000024b84979880] Error setting option time_base to value 1/0.
[graph_1_in_0_1 # 0000024b85187c00] Error applying options to the filter.
Error reinitializing filters!
Error while filtering: Result too large
Finishing stream 0:1 without any data written to it.
[abuffer # 0000024b84979880] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
Last message repeated 1 times
[abuffer # 0000024b84979880] Error setting option time_base to value 1/0.
[graph_1_in_0_1 # 0000024b85186b00] Error applying options to the filter.
Error configuring filter graph
[libx264 # 0000024b81c86000] frame I:1 Avg QP:22.68 size: 40674
[libx264 # 0000024b81c86000] mb I I16..4: 3.8% 72.3% 23.9%
[libx264 # 0000024b81c86000] 8x8 transform intra:72.3%
[libx264 # 0000024b81c86000] coded y,uvDC,uvAC intra: 88.4% 81.1% 50.3%
[libx264 # 0000024b81c86000] i16 v,h,dc,p: 43% 13% 0% 43%
[libx264 # 0000024b81c86000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 16% 20% 5% 5% 6% 5% 7% 6%
[libx264 # 0000024b81c86000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 20% 8% 5% 9% 8% 8% 6% 4%
[libx264 # 0000024b81c86000] i8c dc,h,v,p: 42% 23% 28% 7%
[libx264 # 0000024b
81c86000] kb/s:8134.80
Conversion failed!
The same command using FFMPEG 4.1 works fine.

ffmpeg concatenate image and audio to beginning of file

So I want to try and use the ffmpeg MAP command to do the following:
Merge audio and jpg
Concatenate mp4 to end
Still.jpg
audio.mp3 -> video.mp4 = output.mp4
Right now I have
/home/admin/ffmpeg/ffmpeg -i still.jpg -i audio.mp3 render1.mp4
But I want to also go ahead and add on the video.mp4 as well. I tried reading the map function but I'm so confused as to how you know how many streams a file has, etc
Heres the output of the command....note I have different file names
Input #0, image2, from 'slide_2.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: 8276 kb/s
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
Input #1, mp3, from '/home/admin/web/admin.simplewebevents.com/public_html/cron/steveng1.mp3':
Metadata:
encoder : Lavf57.56.100
Duration: 00:00:05.78, start: 0.023021, bitrate: 64 kb/s
Stream #1:0: Audio: mp3, 48000 Hz, mono, s16p, 64 kb/s
File 'introFile62.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Stream #1:0 -> #0:1 (mp3 (native) -> aac (native))
Press [q] to stop, [?] for help
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 # 0x3589a00] using SAR=1/1
[libx264 # 0x3589a00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 # 0x3589a00] profile High, level 3.1
[libx264 # 0x3589a00] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'introFile62.mp4':
Metadata:
encoder : Lavf57.72.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p(pc, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc57.96.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, mono, fltp, 69 kb/s
Metadata:
encoder : Lavc57.96.101 aac
frame= 1 fps=0.2 q=28.0 Lsize= 70kB time=00:00:05.76 bitrate= 99.2kbits/s speed=1.27x
video:18kB audio:49kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.483214%
[libx264 # 0x3589a00] frame I:1 Avg QP:25.71 size: 18268
[libx264 # 0x3589a00] mb I I16..4: 25.6% 63.4% 10.9%
[libx264 # 0x3589a00] 8x8 transform intra:63.4%
[libx264 # 0x3589a00] coded y,uvDC,uvAC intra: 14.3% 18.5% 8.9%
[libx264 # 0x3589a00] i16 v,h,dc,p: 81% 9% 10% 1%
[libx264 # 0x3589a00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 50% 12% 33% 1% 1% 1% 0% 1% 1%
[libx264 # 0x3589a00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46% 21% 13% 3% 4% 5% 2% 4% 2%
[libx264 # 0x3589a00] i8c dc,h,v,p: 76% 8% 15% 1%
[libx264 # 0x3589a00] kb/s:3653.60
[aac # 0x358aea0] Qavg: 118.057

video after ffmpeg command conversion is not playing on windows

I am stuck at a very weird and complex problem, hoping if anyone know the solution:
I am converting user uploaded video using ffmpeg command on server and it was working fine as well. Today I found that if a video is recorded by a webcam from windows, is playing well in linux as well as on windows where as if user is creating a video by webcam from linux, is playing only on linux (any browser). On window it's screen either show loading icon or black screen while audio is working fine.
I am using following codec:
['-strict', '-2', '-preset slow', '-maxrate 500k', '-bufsize 1000k', vfOption, '-threads 0', '-ab 64k', '-movflags faststart','-vf scale=-1:480', '-metadata:s:v:0 rotate=0', '-vcodec libx264']
I work on linux and using html5 player on my website. I am converting video in mp4 format.
Input:
ffmpeg -i /<server path>/stream_FE2AF05B-E630-1F7B-390B-37325B31B362.flv -strict -2 -vcodec libx264 -preset slow -vb 500k -maxrate 500k -bufsize 1000k -vf 'scale=-1:480 ' -threads 0 -ab 64k -s 640x480 -movflags faststart -metadata:s:v:0 rotate=0 /<server path>/testing.mp4
Output:
ffmpeg version 2.2.5 Copyright (c) 2000-2014 the FFmpeg developers
built on Aug 1 2014 09:24:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libtheora --enable-libx264 --enable-libvpx --enable-libmp3lame
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, flv, from '/<server path>/stream_FE2AF05B-E630-1F7B-390B-37325B31B362.flv':
Metadata:
canSeekToEnd : true
Duration: 00:00:04.04, start: 0.000000, bitrate: 636 kb/s
Stream #0:0: Video: flv1, yuv420p, 640x480, 1k tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: nellymoser, 44100 Hz, mono, flt
[libx264 # 0x23c5340] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 # 0x23c5340] profile High, level 5.2
[libx264 # 0x23c5340] 264 - core 142 r2453 ea0ca51 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=cbr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/<server path>/testing.mp4':
Metadata:
canSeekToEnd : true
encoder : Lavf55.33.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480, q=-1--1, 500 kb/s, 16k tbn, 1k tbc
Metadata:
rotate : 0
Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (flv -> libx264)
Stream #0:1 -> #0:1 (nellymoser -> aac)
Press [q] to stop, [?] for help
[mp4 # 0x23c0200] Starting second pass: moving the moov atom to the beginning of the file2 drop=0
frame= 4020 fps=706 q=-1.0 Lsize= 355kB time=00:00:04.08 bitrate= 712.0kbits/s dup=3931 drop=0
video:271kB audio:32kB subtitle:0 data:0 global headers:0kB muxing overhead 16.957901%
[libx264 # 0x23c5340] frame I:17 Avg QP:27.55 size: 7119
[libx264 # 0x23c5340] frame P:1013 Avg QP:25.37 size: 88
[libx264 # 0x23c5340] frame B:2990 Avg QP:27.32 size: 22
[libx264 # 0x23c5340] consecutive B-frames: 0.8% 0.0% 0.1% 99.1%
[libx264 # 0x23c5340] mb I I16..4: 42.0% 55.1% 2.9%
[libx264 # 0x23c5340] mb P I16..4: 0.3% 0.4% 0.0% P16..4: 0.6% 0.1% 0.0% 0.0% 0.0% skip:98.6%
[libx264 # 0x23c5340] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.2% 0.0% 0.0% direct: 0.0% skip:99.8% L0:35.7% L1:64.3% BI: 0.0%
[libx264 # 0x23c5340] 8x8 transform intra:55.0% inter:84.5%
[libx264 # 0x23c5340] direct mvs spatial:87.6% temporal:12.4%
[libx264 # 0x23c5340] coded y,uvDC,uvAC intra: 33.4% 51.9% 0.7% inter: 0.0% 0.1% 0.0%
[libx264 # 0x23c5340] i16 v,h,dc,p: 26% 54% 15% 5%
[libx264 # 0x23c5340] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 16% 53% 3% 1% 2% 2% 3% 3%
[libx264 # 0x23c5340] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 20% 13% 14% 5% 7% 7% 11% 8%
[libx264 # 0x23c5340] i8c dc,h,v,p: 43% 31% 23% 3%
[libx264 # 0x23c5340] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x23c5340] ref P L0: 80.9% 9.0% 6.9% 2.6% 0.7%
[libx264 # 0x23c5340] ref B L0: 89.4% 8.6% 1.8% 0.2%
[libx264 # 0x23c5340] ref B L1: 91.0% 9.0%
[libx264 # 0x23c5340] kb/s:551.72
Outout from file recorded on window:
Input:
ffmpeg -i /<server path>/stream_window.flv -strict -2 -vcodec libx264 -preset slow -vb 500k -maxrate 500k -bufsize 1000k -vf 'scale=-1:480 ' -threads 0 -ab 64k -s 640x480 -movflags faststart -metadata:s:v:0 rotate=0 /<server path>/testing_1.mp4
Output:
ffmpeg version 2.2.5 Copyright (c) 2000-2014 the FFmpeg developers
built on Aug 1 2014 09:24:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libtheora --enable-libx264 --enable-libvpx --enable-libmp3lame
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, flv, from '/<server path>/stream_window.flv':
Metadata:
canSeekToEnd : true
Duration: 00:00:09.22, start: 0.000000, bitrate: 420 kb/s
Stream #0:0: Video: flv1, yuv420p, 640x480, 1k tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: nellymoser, 44100 Hz, mono, flt
[libx264 # 0x1e09fc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 # 0x1e09fc0] profile High, level 5.2
[libx264 # 0x1e09fc0] 264 - core 142 r2453 ea0ca51 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=cbr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/<server path>/testing_1.mp4':
Metadata:
canSeekToEnd : true
encoder : Lavf55.33.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480, q=-1--1, 500 kb/s, 16k tbn, 1k tbc
Metadata:
rotate : 0
Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (flv -> libx264)
Stream #0:1 -> #0:1 (nellymoser -> aac)
Press [q] to stop, [?] for help
[mp4 # 0x1e06220] Starting second pass: moving the moov atom to the beginning of the file7 drop=0
frame= 8936 fps=703 q=-1.0 Lsize= 771kB time=00:00:09.26 bitrate= 681.5kbits/s dup=8907 drop=0
video:585kB audio:73kB subtitle:0 data:0 global headers:0kB muxing overhead 17.106213%
[libx264 # 0x1e09fc0] frame I:40 Avg QP:29.54 size: 7449
[libx264 # 0x1e09fc0] frame P:2248 Avg QP:30.88 size: 69
[libx264 # 0x1e09fc0] frame B:6648 Avg QP:39.17 size: 22
[libx264 # 0x1e09fc0] consecutive B-frames: 0.8% 0.0% 0.1% 99.1%
[libx264 # 0x1e09fc0] mb I I16..4: 36.8% 60.7% 2.5%
[libx264 # 0x1e09fc0] mb P I16..4: 0.2% 0.3% 0.0% P16..4: 0.4% 0.0% 0.0% 0.0% 0.0% skip:98.9%
[libx264 # 0x1e09fc0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.2% 0.0% 0.0% direct: 0.0% skip:99.8% L0:34.2% L1:65.8% BI: 0.0%
[libx264 # 0x1e09fc0] 8x8 transform intra:60.6% inter:87.6%
[libx264 # 0x1e09fc0] direct mvs spatial:72.8% temporal:27.2%
[libx264 # 0x1e09fc0] coded y,uvDC,uvAC intra: 36.3% 62.8% 4.7% inter: 0.0% 0.0% 0.0%
[libx264 # 0x1e09fc0] i16 v,h,dc,p: 33% 46% 15% 7%
[libx264 # 0x1e09fc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 19% 46% 3% 1% 1% 1% 2% 4%
[libx264 # 0x1e09fc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 17% 14% 9% 4% 4% 5% 5% 7%
[libx264 # 0x1e09fc0] i8c dc,h,v,p: 42% 31% 23% 4%
[libx264 # 0x1e09fc0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x1e09fc0] ref P L0: 82.6% 9.9% 5.2% 1.7% 0.5%
[libx264 # 0x1e09fc0] ref B L0: 87.1% 11.0% 1.4% 0.4%
[libx264 # 0x1e09fc0] ref B L1: 90.3% 9.7%
[libx264 # 0x1e09fc0] kb/s:536.03
Can anyone figure what could be the problem?
#LordNeckbeard: Please find the command and its output above. Thanks

How to deal with "Buffer queue overflow, dropping." (ffmpeg)

Sometimes it works great and sometimes I'm getting this message
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
by running this command
ffmpeg -i a1.mp4 -i watermark150x125.png -filter_complex 'overlay=10:10' output.mp4
I tried different variation of "overlay" like overlay=W-w-5:H-h-5, overlay=10:main_h-overlay_h-10, overlay=main_w-overlay_w-10:main_h-overlay_h-10 - getting the same result.
Here is the output of the ffmpeg command.
ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.6.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda
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
[mov,mp4,m4a,3gp,3g2,mj2 # 0x7f952101d200] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
artist : a1
album :
comment :
date : 0
genre :
title : a1
encoder : Lavf56.4.101
Duration: 00:01:41.51, start: 0.000000, bitrate: 227 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 426x240 [SAR 1:1 DAR 71:40], 97 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 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
Stream #0:2: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 120x90 [SAR 1:1 DAR 4:3], 90k tbr, 90k tbn, 90k tbc
Input #1, png_pipe, from 'watermark150x125.png':
Duration: N/A, bitrate: N/A
Stream #1:0: Video: png, rgba, 150x125 [SAR 2835:2835 DAR 6:5], 25 tbr, 25 tbn, 25 tbc
[swscaler # 0x7f9521013e00] deprecated pixel format used, make sure you did set range correctly
[libx264 # 0x7f9521030e00] using SAR=1/1
[libx264 # 0x7f9521030e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 # 0x7f9521030e00] profile High, level 2.1
[libx264 # 0x7f9521030e00] 264 - core 144 r2533 c8a773e - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
artist : a1
album :
comment :
date : 0
genre :
title : a1
encoder : Lavf56.25.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 426x240 [SAR 1:1 DAR 71:40], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)
Metadata:
encoder : Lavc56.26.100 libx264
Stream #0:1(und): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc56.26.100 libvo_aacenc
Stream mapping:
Stream #0:0 (h264) -> overlay:main (graph 0)
Stream #0:2 (mjpeg) -> overlay:overlay (graph 0)
overlay (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (libvo_aacenc))
Press [q] to stop, [?] for help
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 385 times
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 564 times
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 546 times
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 569 times
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 593 times
[Parsed_overlay_0 # 0x7f9520518800] [framesync # 0x7f9521021e28] Buffer queue overflow, dropping.
Last message repeated 312 times
frame= 3041 fps=645 q=-1.0 Lsize= 1800kB time=00:01:41.52 bitrate= 145.3kbits/s dup=2975 drop=0
video:149kB audio:1587kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.700745%
[libx264 # 0x7f9521030e00] frame I:14 Avg QP:19.91 size: 6947
[libx264 # 0x7f9521030e00] frame P:768 Avg QP:10.30 size: 27
[libx264 # 0x7f9521030e00] frame B:2259 Avg QP:13.67 size: 15
[libx264 # 0x7f9521030e00] consecutive B-frames: 0.9% 0.1% 0.1% 98.9%
[libx264 # 0x7f9521030e00] mb I I16..4: 18.7% 59.0% 22.3%
[libx264 # 0x7f9521030e00] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.1% 0.0% 0.0% 0.0% 0.0% skip:99.9%
[libx264 # 0x7f9521030e00] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.1% 0.0% 0.0% direct: 0.0% skip:99.9% L0:50.7% L1:49.3% BI: 0.0%
[libx264 # 0x7f9521030e00] 8x8 transform intra:59.1% inter:31.9%
[libx264 # 0x7f9521030e00] coded y,uvDC,uvAC intra: 21.4% 12.4% 7.4% inter: 0.0% 0.0% 0.0%
[libx264 # 0x7f9521030e00] i16 v,h,dc,p: 39% 30% 30% 0%
[libx264 # 0x7f9521030e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 47% 16% 1% 0% 0% 1% 0% 1%
[libx264 # 0x7f9521030e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 38% 15% 3% 3% 3% 6% 4% 7%
[libx264 # 0x7f9521030e00] i8c dc,h,v,p: 80% 15% 4% 1%
[libx264 # 0x7f9521030e00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x7f9521030e00] ref P L0: 96.5% 1.2% 2.3%
[libx264 # 0x7f9521030e00] ref B L0: 51.5% 48.5%
[libx264 # 0x7f9521030e00] ref B L1: 99.6% 0.4%
[libx264 # 0x7f9521030e00] kb/s:11.97
I only got errors with videos that didn't have libx264 codec.
So, after adding ffmpeg -i a1.mp4 -vcodec libx264 -crf 0 newa1.mp4 - everything starts working fine.

avconv produces still image from still images

I am trying to convert a stack of 447 still images (jpg) to video using avconv on ubuntu 14.04
avconv -f image2 -i aligned_%04d.tif.jpg -r 10 movie.mkv
Output:
avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
Input #0, image2, from 'aligned_%04d.tif.jpg':
Duration: 00:00:17.84, start: 0.000000, bitrate: N/A
Stream #0.0: Video: mjpeg, yuvj420p, 792x514 [PAR 150:150 DAR 396:257], 25 fps, 25 tbr, 25 tbn
File 'movie.mkv' already exists. Overwrite ? [y/N] y
[libx264 # 0x1811dc0] using SAR=1/1
[libx264 # 0x1811dc0] using cpu capabilities: MMX2 SSE2Fast LZCNT
[libx264 # 0x1811dc0] profile High, level 3.1
[libx264 # 0x1811dc0] 264 - core 142 r2389 956c8d8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=10 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.25 aq=1:1.00
Output #0, matroska, to 'movie.mkv':
Metadata:
encoder : Lavf54.20.4
Stream #0.0: Video: libx264, yuvj420p, 792x514 [PAR 150:150 DAR 396:257], q=-1--1, 1k tbn, 10 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> libx264)
Press ctrl-c to stop encoding
frame= 179 fps= 53 q=32766.0 Lsize= 158kB time=17.70 bitrate= 73.1kbits/s s
video:154kB audio:0kB global headers:0kB muxing overhead 2.300587%
[libx264 # 0x1811dc0] frame I:1 Avg QP:17.62 size: 87993
[libx264 # 0x1811dc0] frame P:46 Avg QP:16.44 size: 1477
[libx264 # 0x1811dc0] frame B:132 Avg QP:22.30 size: 26
[libx264 # 0x1811dc0] consecutive B-frames: 1.7% 0.0% 0.0% 98.3%
[libx264 # 0x1811dc0] mb I I16..4: 4.1% 88.4% 7.5%
[libx264 # 0x1811dc0] mb P I16..4: 0.1% 0.6% 0.1% P16..4: 2.8% 0.4% 0.4% 0.0% 0.0% skip:95.6%
[libx264 # 0x1811dc0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.2% 0.0% 0.0% direct: 0.0% skip:99.8% L0:42.2% L1:57.8% BI: 0.0%
[libx264 # 0x1811dc0] 8x8 transform intra:82.7% inter:98.4%
[libx264 # 0x1811dc0] coded y,uvDC,uvAC intra: 87.0% 81.3% 53.6% inter: 0.4% 0.8% 0.2%
[libx264 # 0x1811dc0] i16 v,h,dc,p: 7% 84% 3% 6%
[libx264 # 0x1811dc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 9% 29% 18% 17% 4% 3% 4% 5% 12%
[libx264 # 0x1811dc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 19% 9% 12% 6% 5% 4% 9% 11%
[libx264 # 0x1811dc0] i8c dc,h,v,p: 36% 45% 15% 3%
[libx264 # 0x1811dc0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x1811dc0] ref P L0: 96.3% 0.0% 1.9% 1.9%
[libx264 # 0x1811dc0] ref B L0: 78.5% 12.5% 9.0%
[libx264 # 0x1811dc0] ref B L1: 95.0% 5.0%
[libx264 # 0x1811dc0] kb/s:71.22
The resulting video runs about 18s, but seems to contain only the first frame. Changing the framerate will still end up with ~18s and only the first frame.
My expectation was: Every image would be used for one frame and the higher the framerate the shorter the video. And of course: The video should contain all images.
Is my expectation wrong? Or what could be the cause for my problem?
My command is mainly based on: https://libav.org/avconv.html#toc-image2-1
I would much rather like to delete the question.
When converting the input frames from tif (which were not accepted by avconv) to jpg, I must have hosed them up. All 447 images were actually a copy of the first one. That explains the video issues, which were no issues really.

Resources