FFmpeg Time Lapse from Sources with Long Frozen Tail End - ffmpeg

My source for inputs into FFmpeg is either one AVI file or a concat of many of them. Either way my resulting timelapse file has a long tail of frames that are a repeat of a single frame. It's like a very long freeze frame is resulting on the end of my output file.
I'm on an older Mac Pro so I can't update my FFmpeg. I have a laptop that has a newer version and I get the same there as well. I'm not sure if it's because my source files are AVI or not.
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags=-I/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/ --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[avi # 0x7fa82080c800] sample size (1) != block align (2)
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'concat:16460001.AVI|16460002.AVI|16460003.AVI|16460004.AVI|16460005.AVI|16460006.AVI|16460007.AVI|16460008.AVI|16460009.AVI|16460010.AVI|16460011.AVI|16460012.AVI|16460013.AVI|16460014.AVI|16460015.AVI|16460016.AVI|16460017.AVI|16460018.AVI|16460019.AVI|16460020.AVI|16460021.AVI':
Duration: 00:10:02.00, start: 0.000000, bitrate: 365923 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj420p(pc, bt470bg/unknown/unknown), 1280x720, 30 fps, 30 tbr, 30 tbn, 30 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 32000 Hz, mono, s16, 512 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 # 0x7fa82082cc00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
[libx264 # 0x7fa82082cc00] profile High, level 3.1
[libx264 # 0x7fa82082cc00] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - 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=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=2 keyint=250 keyint_min=16 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 'out.mp4':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj420p(pc, progressive), 1280x720, q=-1--1, 16 fps, 16384 tbn, 16 tbc
Metadata:
encoder : Lavc58.35.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, mono, fltp, 69 kb/s
Metadata:
encoder : Lavc58.35.100 aac
frame= 1962 fps=1.2 q=-1.0 Lsize= 136725kB time=03:24:07.00 bitrate= 91.5kbits/s dup=0 drop=365448 speed=7.41x
video:31548kB audio:103624kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.149437%
[libx264 # 0x7fa82082cc00] frame I:10 Avg QP:18.74 size: 62176
[libx264 # 0x7fa82082cc00] frame P:514 Avg QP:21.24 size: 30528
[libx264 # 0x7fa82082cc00] frame B:1438 Avg QP:22.74 size: 11121
[libx264 # 0x7fa82082cc00] consecutive B-frames: 1.4% 2.0% 2.0% 94.6%
[libx264 # 0x7fa82082cc00] mb I I16..4: 2.1% 97.2% 0.7%
[libx264 # 0x7fa82082cc00] mb P I16..4: 2.0% 33.3% 0.1% P16..4: 37.7% 12.0% 10.4% 0.0% 0.0% skip: 4.5%
[libx264 # 0x7fa82082cc00] mb B I16..4: 0.7% 11.5% 0.0% B16..8: 29.1% 4.8% 1.3% direct:12.0% skip:40.6% L0:47.5% L1:42.9% BI: 9.6%
[libx264 # 0x7fa82082cc00] 8x8 transform intra:94.3% inter:83.0%
[libx264 # 0x7fa82082cc00] coded y,uvDC,uvAC intra: 73.4% 66.7% 8.5% inter: 25.9% 46.8% 2.2%
[libx264 # 0x7fa82082cc00] i16 v,h,dc,p: 17% 33% 26% 24%
[libx264 # 0x7fa82082cc00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 23% 51% 1% 2% 1% 4% 1% 2%
[libx264 # 0x7fa82082cc00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 21% 19% 5% 8% 7% 13% 5% 5%
[libx264 # 0x7fa82082cc00] i8c dc,h,v,p: 46% 29% 23% 2%
[libx264 # 0x7fa82082cc00] Weighted P-Frames: Y:47.5% UV:19.3%
[libx264 # 0x7fa82082cc00] ref P L0: 45.0% 13.8% 20.6% 15.7% 5.0%
[libx264 # 0x7fa82082cc00] ref B L0: 61.1% 30.4% 8.5%
[libx264 # 0x7fa82082cc00] ref B L1: 85.8% 14.2%
[libx264 # 0x7fa82082cc00] kb/s:2107.54
[aac # 0x7fa82081ea00] Qavg: 130.084
I've read this thread and tried to follow it:
Create time lapse video from other video
Here are some trials I've attempted before, all with the same output:
# ffmpeg -y -i $mov -vf framestep=10,setpts=N/FRAME_RATE/TB,fps=2 -r 30 $out
# ffmpeg -y -i $mov -vf framestep=10,setpts=.01*PTS -r 30 $out
# ffmpeg -y -i $mov -vf framestep=10,setpts=.1*PTS -r 30 $out
# ffmpeg -y -i "concat:16460001.AVI|16460002.AVI|16460003.AVI|16460004.AVI|16460005.AVI|16460006.AVI|16460007.AVI|16460008.AVI|16460009.AVI|16460010.AVI|16460011.AVI|16460012.AVI|16460013.AVI|16460014.AVI|16460015.AVI|16460016.AVI|16460017.AVI|16460018.AVI|16460019.AVI|16460020.AVI|16460021.AVI" -vf framestep=10,setpts=.05*PTS -r 30 $out
ffmpeg -y -i "concat:16460001.AVI|16460002.AVI|16460003.AVI|16460004.AVI|16460005.AVI|16460006.AVI|16460007.AVI|16460008.AVI|16460009.AVI|16460010.AVI|16460011.AVI|16460012.AVI|16460013.AVI|16460014.AVI|16460015.AVI|16460016.AVI|16460017.AVI|16460018.AVI|16460019.AVI|16460020.AVI|16460021.AVI" -r 16 -filter:v "setpts=0.01*PTS" out.mp4
Am I overlooking something? I'm trying to speed up the inputs into a single file to quickly review incoming security footage. How can I do this without the super long useless tail at the end?

Use
ffmpeg -i 16460021.AVI -vf framestep=15,setpts=N/30/TB -r 30 -an out.mp4
I get an output 1/15th the length of the original. When using framestep=X, setpts should be of the form N/X/TB if you wish to avoid frame duplication. Don't use fps when compressing video duration as it uses old stream duration from before compression (a bug). Skip audio, since that will result in original length.

Related

FFmpeg not cropping video correctly

I'm using ffmpeg as:
ffmpeg -i "video.webm" -c:v libx264 -vf "crop=in_w:in_h:in_w/2:in_h" -ss 00:02:56.000 -to 00:03:02.750 cut.mp4 -y
to get left side of screen to crop out right one, but in result I'm getting uncropped video (both sides present), when I change command to get right side (to crop out left one):
ffmpeg -i "video.webm" -c:v libx264 -vf "crop=in_w/2:in_h:in_w:in_h" -ss 00:2:56.000 -to 00:03:02.750 cut.mp4 -y
everything works as it should (only right side of original video presents in "cut.mp4").
What am I doing wrong?
P.S.
ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11.2.1 (Gentoo 11.2.1_p20220115 p4) 20220115
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-4.4.1-r5/html --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --nm=x86_64-pc-linux-gnu-nm --strip=x86_64-pc-linux-gnu-strip --ranlib=x86_64-pc-linux-gnu-ranlib --pkg-config=x86_64-pc-linux-gnu-pkg-config --optflags='-march=native -O2 -pipe' --extra-libs= --disable-static --enable-avfilter --enable-avresample --disable-stripping --disable-optimizations --disable-libcelt --enable-nonfree --disable-indev=v4l2 --disable-outdev=v4l2 --disable-indev=alsa --disable-indev=oss --disable-indev=jack --disable-indev=sndio --disable-outdev=alsa --disable-outdev=oss --disable-outdev=sndio --enable-version3 --enable-bzlib --enable-runtime-cpudetect --disable-debug --disable-gcrypt --enable-gnutls --enable-gmp --enable-gpl --disable-hardcoded-tables --enable-iconv --disable-libxml2 --enable-lzma --enable-network --disable-opencl --enable-openssl --enable-postproc --disable-libsmbclient --disable-ffplay --disable-sdl2 --disable-vaapi --disable-vdpau --disable-vulkan --disable-xlib --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --disable-opengl --disable-libv4l2 --disable-libpulse --disable-libdrm --disable-libjack --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libcodec2 --enable-libdav1d --disable-libfdk-aac --disable-libopenjpeg --disable-libbluray --disable-libgme --disable-libgsm --disable-libaribb24 --disable-mmal --disable-libmodplug --disable-libopus --disable-libilbc --disable-librtmp --disable-libssh --disable-libspeex --disable-libsrt --enable-librsvg --disable-ffnvcodec --disable-libvorbis --disable-libvpx --disable-libzvbi --disable-appkit --disable-libbs2b --disable-chromaprint --disable-cuda-llvm --disable-libflite --disable-frei0r --disable-libvmaf --disable-libfribidi --disable-fontconfig --disable-ladspa --disable-libass --disable-libtesseract --disable-lv2 --enable-libfreetype --disable-libvidstab --disable-librubberband --disable-libzmq --disable-libzimg --disable-libsoxr --enable-pthreads --disable-amf --disable-libvo-amrwbenc --disable-libkvazaar --disable-libaom --disable-libmp3lame --disable-libopenh264 --disable-librav1e --disable-libsnappy --disable-libsvtav1 --disable-libtheora --disable-libtwolame --enable-libwebp --enable-libx264 --disable-libx265 --disable-libxvid --disable-gnutls --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-vfpv3 --disable-armv8 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-vsx --disable-power8 --disable-amd3dnow --disable-amd3dnowext --disable-fma3 --disable-fma4 --disable-xop --cpu=host --disable-doc --disable-htmlpages --enable-manpages
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, matroska,webm, from 'video.webm':
Metadata:
ENCODER : Lavf58.76.100
Duration: 00:36:29.58, start: -0.007000, bitrate: 1066 kb/s
Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv, bt709), 1920x1080, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc (default)
Metadata:
DURATION : 00:36:29.560000000
Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
Metadata:
DURATION : 00:36:29.581000000
Stream mapping:
Stream #0:0 -> #0:0 (vp9 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (opus (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 # 0x564b4eda52c0] using SAR=1/1
[libx264 # 0x564b4eda52c0] using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX
[libx264 # 0x564b4eda52c0] profile Progressive High, level 4.0, 4:2:0, 8-bit
[libx264 # 0x564b4eda52c0] 264 - core 157 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - 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=15 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=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 'cut.mp4':
Metadata:
encoder : Lavf58.76.100
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 12800 tbn (default)
Metadata:
DURATION : 00:36:29.560000000
encoder : Lavc58.134.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
DURATION : 00:36:29.581000000
encoder : Lavc58.134.100 aac
frame= 169 fps= 28 q=-1.0 Lsize= 851kB time=00:00:06.74 bitrate=1033.9kbits/s speed=1.12x
video:738kB audio:106kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.764865%
[libx264 # 0x564b4eda52c0] frame I:1 Avg QP:14.29 size: 31413
[libx264 # 0x564b4eda52c0] frame P:43 Avg QP:16.65 size: 9476
[libx264 # 0x564b4eda52c0] frame B:125 Avg QP:22.36 size: 2529
[libx264 # 0x564b4eda52c0] consecutive B-frames: 1.2% 0.0% 1.8% 97.0%
[libx264 # 0x564b4eda52c0] mb I I16..4: 31.6% 63.8% 4.6%
[libx264 # 0x564b4eda52c0] mb P I16..4: 1.4% 5.4% 0.3% P16..4: 13.8% 3.2% 1.0% 0.0% 0.0% skip:75.0%
[libx264 # 0x564b4eda52c0] mb B I16..4: 0.1% 0.2% 0.0% B16..8: 11.4% 0.7% 0.1% direct: 0.4% skip:87.0% L0:48.2% L1:48.1% BI: 3.7%
[libx264 # 0x564b4eda52c0] 8x8 transform intra:73.0% inter:90.2%
[libx264 # 0x564b4eda52c0] coded y,uvDC,uvAC intra: 38.9% 41.7% 6.4% inter: 2.2% 2.7% 0.0%
[libx264 # 0x564b4eda52c0] i16 v,h,dc,p: 45% 18% 5% 31%
[libx264 # 0x564b4eda52c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 20% 22% 5% 6% 7% 5% 7% 5%
[libx264 # 0x564b4eda52c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 22% 14% 6% 10% 8% 7% 5% 3%
[libx264 # 0x564b4eda52c0] i8c dc,h,v,p: 55% 19% 19% 6%
[libx264 # 0x564b4eda52c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x564b4eda52c0] ref P L0: 67.6% 9.2% 16.0% 7.3%
[libx264 # 0x564b4eda52c0] ref B L0: 88.6% 9.5% 1.9%
[libx264 # 0x564b4eda52c0] ref B L1: 97.3% 2.7%
[libx264 # 0x564b4eda52c0] kb/s:893.47
[aac # 0x564b4edde600] Qavg: 208.505
I think you are quite confused about the crop filter options. Here are the descriptions of the first 4 options:
w, out_w
The width of the output video. It defaults to iw. This expression is evaluated only once during the filter configuration, or when the ‘w’ or ‘out_w’ command is sent.
h, out_h
The height of the output video. It defaults to ih. This expression is evaluated only once during the filter configuration, or when the ‘h’ or ‘out_h’ command is sent.
x
The horizontal position, in the input video, of the left edge of the output video. It defaults to (in_w-out_w)/2. This expression is evaluated per-frame.
y
The vertical position, in the input video, of the top edge of the output video. It defaults to (in_h-out_h)/2. This expression is evaluated per-frame.
If you want to halve the width, then the first option must be in_w/2 regardless of which side to crop from.
Height is unchanged, so always use in_h
To crop from left, x offset must match the width, so in_w/2. To crop from right, no pixels are removed on the left edge, so must be 0.
Because no rows are removed, usey = 0.
So to summarize:
Crop the left edge: crop=in_w/2:in_h:in_w/2:0
Crop the right edge: crop=in_w/2:in_h:0:0

FFMPEG - latest build doesn't work, earlier build does

I have been using FFMPEG to overlay coloured rectangles on a video. I updated FFMPEG and it no longer works. No error is issued, it just doesn't do the job - the resulting video is the same as the input video. Here's the script:
FFMpeg -y -i Input.mp4 -filter_complex \
"nullsrc=size=1920x1080, \
drawbox=x=200:y=100:w=300:h=150:t=20:c=yellow, fade=in:st=10:d=1:alpha=1, fade=out:st=20:d=2:alpha=1 [tmp1]; \
nullsrc=size=1920x1080, \
drawbox=x=240:y=140:w=300:h=150:t=20:c=red, fade=in:st=15:d=1:alpha=1, fade=out:st=25:d=2:alpha=1 [tmp2]; \
[tmp1][tmp2] overlay=0:0:shortest=1[tmp3]; \
[0:v][tmp3] overlay=0:0:shortest=1" \
Output.mp4
The output video should be the input video with a yellow rectangle added from T=10 to T=20 and a red rectangle from T=15 to T=25, fading them in and out.
The version that was working (3.4) was one that came with an ImageMagick installation. The version I updated it to was 4.2.3. I tried it on various other builds I had lying around and it only works with 3.4.
It seems unlikely that this is a regression so I haven't submitted a bug report. I figure it's more likely that I'm not doing something correctly and 3.4 is more lenient on its interpretation of my command.
Whatever, I prefer to be working with a current build, so I invite comments on what the reasons might be.
Console dump of 3.4 run
ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Input.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:01:48.67, start: 0.000000, bitrate: 1693 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1562 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 126 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 (h264) -> overlay:main (graph 0)
overlay (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 # 000001f0d4a0e6a0] using SAR=1/1
[libx264 # 000001f0d4a0e6a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 000001f0d4a0e6a0] profile High, level 4.0
[libx264 # 000001f0d4a0e6a0] 264 - core 152 r2851 ba24899 - 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=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=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-34.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
Metadata:
encoder : Lavc57.107.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc57.107.100 aac
frame= 3260 fps= 25 q=-1.0 Lsize= 21461kB time=00:01:48.56 bitrate=1619.3kbits/s speed=0.828x
video:19713kB audio:1634kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.534457%
[libx264 # 000001f0d4a0e6a0] frame I:14 Avg QP:17.68 size:208205
[libx264 # 000001f0d4a0e6a0] frame P:844 Avg QP:21.55 size: 16867
[libx264 # 000001f0d4a0e6a0] frame B:2402 Avg QP:28.40 size: 1263
[libx264 # 000001f0d4a0e6a0] consecutive B-frames: 0.7% 2.9% 0.4% 96.0%
[libx264 # 000001f0d4a0e6a0] mb I I16..4: 14.0% 39.6% 46.4%
[libx264 # 000001f0d4a0e6a0] mb P I16..4: 0.4% 0.7% 0.2% P16..4: 20.2% 9.1% 4.6% 0.0% 0.0% skip:64.8%
[libx264 # 000001f0d4a0e6a0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 12.4% 0.4% 0.1% direct: 0.1% skip:87.1% L0:42.9% L1:55.2% BI: 1.9%
[libx264 # 000001f0d4a0e6a0] 8x8 transform intra:45.2% inter:68.3%
[libx264 # 000001f0d4a0e6a0] coded y,uvDC,uvAC intra: 64.4% 81.6% 45.1% inter: 2.9% 4.2% 0.1%
[libx264 # 000001f0d4a0e6a0] i16 v,h,dc,p: 32% 26% 6% 37%
[libx264 # 000001f0d4a0e6a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 20% 15% 5% 6% 7% 7% 7% 8%
[libx264 # 000001f0d4a0e6a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 28% 8% 4% 6% 6% 6% 5% 5%
[libx264 # 000001f0d4a0e6a0] i8c dc,h,v,p: 37% 25% 28% 10%
[libx264 # 000001f0d4a0e6a0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 000001f0d4a0e6a0] ref P L0: 70.4% 15.3% 10.8% 3.5%
[libx264 # 000001f0d4a0e6a0] ref B L0: 93.1% 6.0% 0.9%
[libx264 # 000001f0d4a0e6a0] ref B L1: 97.8% 2.2%
[libx264 # 000001f0d4a0e6a0] kb/s:1486.03
[aac # 000001f0d4a10a20] Qavg: 1586.609
And 4.2.3
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200523
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Input.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:01:48.67, start: 0.000000, bitrate: 1693 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1562 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 126 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 (h264) -> overlay:main (graph 0)
overlay (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 # 000001e7b4531d40] using SAR=1/1
[libx264 # 000001e7b4531d40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 000001e7b4531d40] profile High, level 4.0, 4:2:0, 8-bit
[libx264 # 000001e7b4531d40] 264 - core 160 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - 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=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=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-423.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
Metadata:
encoder : Lavc58.54.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc58.54.100 aac
frame= 3260 fps= 28 q=-1.0 Lsize= 21425kB time=00:01:48.56 bitrate=1616.7kbits/s speed=0.917x
video:19686kB audio:1625kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.535352%
[libx264 # 000001e7b4531d40] frame I:14 Avg QP:17.68 size:208355
[libx264 # 000001e7b4531d40] frame P:844 Avg QP:21.54 size: 16838
[libx264 # 000001e7b4531d40] frame B:2402 Avg QP:28.43 size: 1261
[libx264 # 000001e7b4531d40] consecutive B-frames: 0.7% 2.9% 0.4% 96.0%
[libx264 # 000001e7b4531d40] mb I I16..4: 13.9% 39.7% 46.4%
[libx264 # 000001e7b4531d40] mb P I16..4: 0.4% 0.7% 0.2% P16..4: 20.2% 9.1% 4.6% 0.0% 0.0% skip:64.8%
[libx264 # 000001e7b4531d40] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 12.4% 0.4% 0.1% direct: 0.1% skip:87.1% L0:42.9% L1:55.2% BI: 1.9%
[libx264 # 000001e7b4531d40] 8x8 transform intra:45.3% inter:68.3%
[libx264 # 000001e7b4531d40] coded y,uvDC,uvAC intra: 65.2% 82.4% 45.8% inter: 2.9% 4.2% 0.1%
[libx264 # 000001e7b4531d40] i16 v,h,dc,p: 32% 24% 6% 38%
[libx264 # 000001e7b4531d40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 19% 14% 5% 6% 7% 7% 7% 8%
[libx264 # 000001e7b4531d40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 28% 8% 4% 6% 6% 6% 5% 5%
[libx264 # 000001e7b4531d40] i8c dc,h,v,p: 37% 24% 28% 11%
[libx264 # 000001e7b4531d40] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 000001e7b4531d40] ref P L0: 70.4% 15.3% 10.8% 3.5%
[libx264 # 000001e7b4531d40] ref B L0: 93.1% 6.0% 0.9%
[libx264 # 000001e7b4531d40] ref B L1: 97.8% 2.2%
[libx264 # 000001e7b4531d40] kb/s:1483.98
[aac # 000001e7b47fa800] Qavg: 1462.566
There was a bug in the drawbox filter whereby the source alpha pixels would be replaced with the drawbox color's alpha (usually opaque) instead of preserving or blending it. Your command relies on that remaining the case, but I changed that after 3.4 series, so you now have to tell drawbox to replace the alpha for the box pixels.
So,
drawbox=x=200:y=100:w=300:h=150:t=20:c=yellow:replace=1
and
drawbox=x=240:y=140:w=300:h=150:t=20:c=red:replace=1

ffmpeg convert cdg/mp3 to mp4 but cdg track is always sped up by a second

I've tried this:
"C:\Program Files\ffmpeg-4.2.1-win64-static\bin\ffmpeg" -i %1 -i %2 -b:v 1M -y -speed 2 "%~dpn1.mp4"
"C:\Program Files\ffmpeg-4.2.1-win64-static\bin\ffmpeg" -i %1 -i %2 -pix_fmt yuv420p -vcodec libx264 -async 1 -speed 2 "%~dpn1.mp4"
Always same result. The file and quality are great, but obv since its karaoke... the lyrics need to match the timing and the converted files lyrics track is always about a full second or so ahead from when I play the original in a Karaoke program. Any ideas on what settings I could play with to help with this?
Both the original and the converted have the same play length at the end though. so the mp3 track seems to be ok.
EDIT: Added cmd output
"C:\Program Files\ffmpeg-4.2.1-win64-static\bin\ffmpeg" -i "A:\25 Karaoke\English\Linkin Park - In The End [SF Karaoke].cdg" -i "A:\25 Karaoke\English\Linkin Park - In The End [SF Karaoke].mp3" -b:v 1M -y -speed 2 "LP_inTheEnd.mp4"
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190807
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, cdg, from 'A:\25 Karaoke\English\Linkin Park - In The End [SF Karaoke].cdg':
Duration: 00:03:56.21, start: 0.480000, bitrate: 57 kb/s
Stream #0:0: Video: cdgraphics, pal8, 300x216, 300 fps, 300 tbr, 300 tbn, 300 tbc
[mp3 # 000001bb3c14bb40] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from 'A:\25 Karaoke\English\Linkin Park - In The End [SF Karaoke].mp3':
Metadata:
title : In The End [SF Karaoke]
artist : Linkin Park
comment : http://www.otslabs.com/
Duration: 00:03:56.26, start: 0.000000, bitrate: 128 kb/s
Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
Codec AVOption speed () specified for output file #0 (LP_inTheEnd.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.
Stream mapping:
Stream #0:0 -> #0:0 (cdgraphics (native) -> h264 (libx264))
Stream #1:0 -> #0:1 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
[libx264 # 000001bb3c13bc00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 000001bb3c13bc00] profile High 4:4:4 Predictive, level 3.1, 4:4:4, 8-bit
[libx264 # 000001bb3c13bc00] 264 - core 158 r2984 3759fcb - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - 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=4 threads=7 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=abr mbtree=1 bitrate=1000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'LP_inTheEnd.mp4':
Metadata:
encoder : Lavf58.29.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv444p(progressive), 300x216, q=-1--1, 1000 kb/s, 300 fps, 19200 tbn, 300 tbc
Metadata:
encoder : Lavc58.54.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/1000000 buffer size: 0 vbv_delay: -1
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavc58.54.100 aac
More than 1000 frames duplicated
More than 10000 frames duplicated 2048kB time=00:00:42.16 bitrate= 397.9kbits/s dup=9625 drop=0 speed=11.5x
frame=59170 fps=3226 q=-1.0 Lsize= 11887kB time=00:03:56.26 bitrate= 412.2kbits/s dup=43525 drop=0 speed=12.9x
video:7749kB audio:3340kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 7.203599%
[libx264 # 000001bb3c13bc00] frame I:242 Avg QP: 0.26 size: 17214
[libx264 # 000001bb3c13bc00] frame P:16651 Avg QP: 0.14 size: 164
[libx264 # 000001bb3c13bc00] frame B:42277 Avg QP: 0.25 size: 25
[libx264 # 000001bb3c13bc00] consecutive B-frames: 2.7% 4.9% 3.8% 88.6%
[libx264 # 000001bb3c13bc00] mb I I16..4: 73.7% 1.6% 24.7%
[libx264 # 000001bb3c13bc00] mb P I16..4: 0.1% 0.0% 0.1% P16..4: 0.4% 0.0% 0.0% 0.0% 0.0% skip:99.4%
[libx264 # 000001bb3c13bc00] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.3% 0.0% 0.0% direct: 0.0% skip:99.7% L0:44.2% L1:55.6% BI: 0.2%
[libx264 # 000001bb3c13bc00] final ratefactor: -19.48
[libx264 # 000001bb3c13bc00] 8x8 transform intra:1.5% inter:14.0%
[libx264 # 000001bb3c13bc00] coded y,u,v intra: 14.1% 14.8% 14.9% inter: 0.0% 0.0% 0.0%
[libx264 # 000001bb3c13bc00] i16 v,h,dc,p: 90% 0% 9% 0%
[libx264 # 000001bb3c13bc00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 14% 63% 0% 0% 0% 0% 0% 1%
[libx264 # 000001bb3c13bc00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 55% 15% 16% 1% 2% 3% 3% 2% 2%
[libx264 # 000001bb3c13bc00] Weighted P-Frames: Y:0.2% UV:0.2%
[libx264 # 000001bb3c13bc00] ref P L0: 97.9% 0.9% 1.0% 0.2%
[libx264 # 000001bb3c13bc00] ref B L0: 99.6% 0.4% 0.0%
[libx264 # 000001bb3c13bc00] ref B L1: 99.9% 0.1%
[libx264 # 000001bb3c13bc00] kb/s:321.80
[aac # 000001bb3c172e40] Qavg: 6813.878
try:
ffmpeg -itsoffset 1 -i "Linkin Park - In The End [SF Karaoke].cdg" -itsoffset 0 -i "Linkin Park - In The End [SF Karaoke].mp3" -b:v 1M -y -speed 2 "LP_inTheEnd.mp4"
that's your original command (though without the windows-specific bits) adjusted with a timestamp offset of 1 on the video and zero on the audio, so that the video should delay one second but the audio should not.

FFMPEG "buffer queue overflow, dropping" with trim and atrim filters

In FFMPEG I am actually trimming and concating a 24 FPS video. When I apply a complex filter
ffmpeg -i sample.mp4 -filter_complex \
"[0:v]setpts = PTS-STARTPTS[bv];
[bv]split=6[v0][v1][v2][v3][v4][v5];
[v0]trim=start_frame=1:end_frame=142,loop=1:1:1,setpts=N/FRAME_RATE/TB[0v];
[v1]trim=start_frame=846:end_frame=878,loop=1:1:1,setpts=N/FRAME_RATE/TB[1v];
[v2]trim=start_frame=57:end_frame=114,loop=1:1:1,setpts=N/FRAME_RATE/TB[2v];
[v3]trim=start_frame=865:end_frame=885,loop=1:1:1,setpts=N/FRAME_RATE/TB[3v];
[v4]trim=start_frame=70:end_frame=155,loop=1:1:1,setpts=N/FRAME_RATE/TB[4v];
[v5]trim=start_frame=155:end_frame=909,loop=1:1:1,setpts=N/FRAME_RATE/TB[5v];
[0:a]asplit=6[a0][a1][a2][a3][a4][a5];
[a0]atrim=0.041666666666666664:5.917,asetpts=N/SR/TB[0a];
[a1]atrim=35.256:36.603,asetpts=N/SR/TB[1a];
[a2]atrim=2.379:4.767,asetpts=N/SR/TB[2a];
[a3]atrim=36.024:36.859,asetpts=N/SR/TB[3a];
[a4]atrim=2.93:6.438172,asetpts=N/SR/TB[4a];
[a5]atrim=6.438172:37.895,asetpts=N/SR/TB[5a];
[0v][0a][1v][1a][2v][2a][3v][3a][4v][4a][5v][5a]concat=n=6:v=1:a=1[vv][aa]"\
-map "[vv]" -map "[aa]" output.mp4
I am getting "buffer queue overflow, dropping" error. The resultant video and audio is still and not working properly.
ffmpeg version 3.2-1~16.04.york1 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.1 (Ubuntu 5.4.1-3ubuntu1~ubuntu16.04.1york0) 20161019
configuration: --prefix=/usr --extra-version='1~16.04.york1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-libtesseract --disable-stripping --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-opengl --enable-sdl2 --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-openal --enable-frei0r --enable-libopencv --enable-libx264 --enable-chromaprint --enable-shared
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.100 / 57. 64.100
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
track : 0
artist :
album :
date : 0
genre :
lyrics :
title :
encoder : Lavf56.36.100
Duration: 00:00:37.90, start: 0.000000, bitrate: 951 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 820 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 126 kb/s (default)
Metadata:
handler_name : SoundHandler
File 'output.mp4' already exists. Overwrite ? [y/N] y
[libx264 # 0x55650097a540] using SAR=1/1
[libx264 # 0x55650097a540] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 # 0x55650097a540] profile High, level 3.0
[libx264 # 0x55650097a540] 264 - core 148 r2643 5c65704 - 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=24 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
track : 0
artist :
album :
date : 0
genre :
lyrics :
title :
encoder : Lavf57.56.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
Metadata:
encoder : Lavc57.64.100 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), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
encoder : Lavc57.64.100 aac
Stream mapping:
Stream #0:0 (h264) -> setpts
Stream #0:1 (aac) -> asplit
concat:out:v0 -> Stream #0:0 (libx264)
concat:out:a0 -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[Parsed_concat_33 # 0x55650097b420] Buffer queue overflow, dropping. 471.5kbits/s speed=4.94x
Last message repeated 201 times
[Parsed_concat_33 # 0x55650097b420] Buffer queue overflow, dropping. 522.9kbits/s speed=3.89x
Last message repeated 1266 times
[Parsed_concat_33 # 0x55650097b420] Buffer queue overflow, dropping. 557.0kbits/s speed=3.28x
Last message repeated 48 times
[output stream 0:1 # 0x556500947e20] 100 buffers queued in output stream 0:1, something may be wrong.
[Parsed_concat_33 # 0x55650097b420] Buffer queue overflow, dropping. 718.6kbits/s speed=3.46x
Last message repeated 19 times
[output stream 0:0 # 0x5565009785c0] 100 buffers queued in output stream 0:0, something may be wrong.
frame= 1091 fps=117 q=-1.0 Lsize= 2795kB time=00:00:45.51 bitrate= 503.1kbits/s dup=475 drop=0 speed=4.88x
video:2455kB audio:316kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.861779%
[libx264 # 0x55650097a540] frame I:8 Avg QP:19.26 size: 24207
[libx264 # 0x55650097a540] frame P:409 Avg QP:21.33 size: 4108
[libx264 # 0x55650097a540] frame B:674 Avg QP:27.46 size: 949
[libx264 # 0x55650097a540] consecutive B-frames: 10.3% 13.9% 24.5% 51.3%
[libx264 # 0x55650097a540] mb I I16..4: 9.9% 57.0% 33.1%
[libx264 # 0x55650097a540] mb P I16..4: 3.6% 7.6% 2.9% P16..4: 33.0% 10.6% 3.0% 0.0% 0.0% skip:39.2%
[libx264 # 0x55650097a540] mb B I16..4: 0.4% 0.8% 0.4% B16..8: 24.5% 2.6% 0.2% direct: 0.5% skip:70.5% L0:55.5% L1:41.8% BI: 2.7%
[libx264 # 0x55650097a540] 8x8 transform intra:53.8% inter:66.7%
[libx264 # 0x55650097a540] coded y,uvDC,uvAC intra: 44.6% 50.0% 14.8% inter: 6.2% 7.7% 0.2%
[libx264 # 0x55650097a540] i16 v,h,dc,p: 22% 28% 17% 33%
[libx264 # 0x55650097a540] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 23% 28% 3% 4% 3% 11% 3% 5%
[libx264 # 0x55650097a540] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 26% 16% 2% 5% 3% 16% 3% 3%
[libx264 # 0x55650097a540] i8c dc,h,v,p: 60% 22% 13% 6%
[libx264 # 0x55650097a540] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x55650097a540] ref P L0: 72.6% 8.4% 15.1% 3.9%
[libx264 # 0x55650097a540] ref B L0: 88.5% 10.7% 0.8%
[libx264 # 0x55650097a540] ref B L1: 93.3% 6.7%
[libx264 # 0x55650097a540] kb/s:442.30
[aac # 0x556500979280] Qavg: 3215.870
I tried with other stackoverflow questions but none of them worked. Also I think it is partially because the trim timings are mixed. That is start time can be anywhere between 0-end. When I make it strictly increasing it is working fine.
Add a fifo filter at the end of each of the video filterchains.
i.e.
[v0]trim=start_frame=1:end_frame=142,loop=1:1:1,setpts=N/FRAME_RATE/TB,fifo[0v];
Although probably not necessary, you can add afifo to the end of audio chains as well.

flvEncoder .flv output won't convert to .mp4 with ffmpeg [duplicate]

This question already has an answer here:
FFmpeg converting image sequence to video results in blank video [closed]
(1 answer)
Closed 5 years ago.
My current project involves creating a .flv using AIR (using https://github.com/zeropointnine/leelib/tree/master/src/leelib/util/flvEncoder) - which then has to be converted into an .mp4, for which we are using ffmpeg.
The .mp4 output is the correct dimensions and duration, but blank (no images). Audio is not an issue as the original output has no audio.
ffmpeg version N-55020-g768e40b Copyright (c) 2000-2013 the FFmpeg developers
built on Jul 28 2013 18:05:44 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --e
nable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable
-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enab
le-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheo
ra --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --en
able-libxavs --enable-libxvid --enable-zlib
libavutil 52. 40.100 / 52. 40.100
libavcodec 55. 19.100 / 55. 19.100
libavformat 55. 12.102 / 55. 12.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 81.103 / 3. 81.103
libswscale 2. 4.100 / 2. 4.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100
Input #0, flv, from 'testWithAudio.flv':
Metadata:
canSeekToEnd : true
metadatacreator : FlvEncoder v0.9 Lee Felarca
Duration: 00:00:44.77, start: 0.000000, bitrate: 56730 kb/s
Stream #0:0: Video: flashsv, bgr24, 400x400, 30 tbr, 1k tbn, 1k tbc
Stream #0:1: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 # 00000000002e1da0] using cpu capabilities: MMX2 SSE2Fast SSEMisalign LZCNT
[libx264 # 00000000002e1da0] profile High 4:4:4 Predictive, level 2.1, 4:4:4 8-bit
[libx264 # 00000000002e1da0] 264 - core 135 r2345 f0c1c53 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - 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=4 threads=1 lookahead_threads=1 sl
iced_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 dire
ct=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 'testWithAudio.mp4':
Metadata:
canSeekToEnd : true
metadatacreator : FlvEncoder v0.9 Lee Felarca
encoder : Lavf55.12.102
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 400x400, q=-1--1, 15360 tbn, 30 tbc
Stream #0:1: Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (flashsv -> libx264)
Stream #0:1 -> #0:1 (pcm_s16le -> libvo_aacenc)
Press [q] to stop, [?] for help
frame= 1343 fps= 25 q=29.0 Lsize= 2680kB time=00:00:44.70 bitrate= 491.2kbits/s
video:1943kB audio:691kB subtitle:0 global headers:0kB muxing overhead 1.756713%
[libx264 # 00000000002e1da0] frame I:25 Avg QP:20.44 size: 14523
[libx264 # 00000000002e1da0] frame P:614 Avg QP:23.20 size: 2319
[libx264 # 00000000002e1da0] frame B:704 Avg QP:24.59 size: 287
[libx264 # 00000000002e1da0] consecutive B-frames: 25.6% 11.0% 7.4% 56.0%
[libx264 # 00000000002e1da0] mb I I16..4: 17.6% 67.0% 15.3%
[libx264 # 00000000002e1da0] mb P I16..4: 7.6% 9.9% 0.8% P16..4: 28.0% 8.3% 4.0% 0.0% 0.0% skip:41.4%
[libx264 # 00000000002e1da0] mb B I16..4: 0.4% 0.5% 0.0% B16..8: 16.3% 1.1% 0.1% direct: 0.2% skip:81.4% L0:39.7% L
1:57.4% BI: 2.8%
[libx264 # 00000000002e1da0] 8x8 transform intra:56.3% inter:85.5%
[libx264 # 00000000002e1da0] coded y,u,v intra: 35.7% 17.0% 19.1% inter: 7.7% 3.8% 3.4%
[libx264 # 00000000002e1da0] i16 v,h,dc,p: 26% 28% 17% 30%
[libx264 # 00000000002e1da0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 21% 33% 4% 4% 5% 4% 4% 4%
[libx264 # 00000000002e1da0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 21% 16% 5% 6% 9% 6% 6% 6%
[libx264 # 00000000002e1da0] Weighted P-Frames: Y:6.5% UV:3.3%
[libx264 # 00000000002e1da0] ref P L0: 56.8% 16.5% 18.2% 8.0% 0.6%
[libx264 # 00000000002e1da0] ref B L0: 82.3% 14.1% 3.7%
[libx264 # 00000000002e1da0] ref B L1: 93.7% 6.3%
[libx264 # 00000000002e1da0] kb/s:355.47
Any ideas?
See the informational message:
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
So, add -pix_fmt yuv420p and you should be fine.

Resources