I'm tying to split mov file to .ts segments with m3u8 playlist.
All is ok except of audio. Audio doesn't work and it seems that ffmpeg ignores audio stream.
This is my command:
ffmpeg -i stepteen2.mov
-c:a aac
-c:v libx264
-an
-map 0
-muxdelay 0
-muxpreload 0
-output_ts_offset 0
-segment_time 2
-segment_wrap 1000
-segment_list_size 0
-segment_list temp.m3u8
-segment_list_flags +cache
-segment_list_type m3u8
-f segment
temp-%03d.ts
After this command I receive 5 ts segments and m3u8 playlist with segment paths list.
If I open properties of segment files there are no any information in Audio and Video tabs (although video works)
This is output:
ffmpeg version n4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix= --prefix=/usr --disable-debug --disable-doc --disable-static --enable-avisynth --enable-cuda --enable-cuvid --enable-libdrm --enable-ffplay --enable-gnutls --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopus --enable-libpulse --enable-sdl2 --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-nonfree --enable-nvenc --enable-omx --enable-openal --enable-opencl --enable-runtime-cpudetect --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-xlib
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
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'stepteen2.mov':
Metadata:
creation_time : 1998-11-12T18:28:20.000000Z
Duration: 00:00:28.60, start: 0.000000, bitrate: 111 kb/s
Stream #0:0(eng): Video: svq1 (SVQ1 / 0x31515653), yuv410p, 160x120, 90 kb/s, 7.52 fps, 7.50 tbr, 600 tbn, 600 tbc (default)
Metadata:
creation_time : 1998-11-12T18:28:20.000000Z
handler_name : Apple Video Media Handler
encoder : Sorenson Video
Stream #0:1(eng): Audio: qdmc (QDMC / 0x434D4451), 44100 Hz, mono, s16, 20 kb/s (default)
Metadata:
creation_time : 1998-11-12T18:28:20.000000Z
handler_name : Apple Sound Media Handler
Stream mapping:
Stream #0:0 -> #0:0 (svq1 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 # 0x55a5a80b8dc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 # 0x55a5a80b8dc0] profile High, level 1.0
[libx264 # 0x55a5a80b8dc0] 264 - core 152 r2854 e9a5903 - 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=4 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=7 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
[segment # 0x55a5a7fd2e00] Opening 'temp-000.ts' for writing
Output #0, segment, to 'temp-%03d.ts':
Metadata:
encoder : Lavf58.20.100
Stream #0:0(eng): Video: h264 (libx264), yuv420p, 160x120, q=-1--1, 7.50 fps, 90k tbn, 7.50 tbc (default)
Metadata:
creation_time : 1998-11-12T18:28:20.000000Z
handler_name : Apple Video Media Handler
encoder : Lavc58.35.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
[segment # 0x55a5a7fd2e00] Opening 'temp.m3u8.tmp' for writing
[segment # 0x55a5a7fd2e00] Opening 'temp-001.ts' for writing
[segment # 0x55a5a7fd2e00] Opening 'temp.m3u8.tmp' for writing
[segment # 0x55a5a7fd2e00] Opening 'temp-002.ts' for writing
[segment # 0x55a5a7fd2e00] Opening 'temp.m3u8.tmp' for writing
[segment # 0x55a5a7fd2e00] Opening 'temp-003.ts' for writing
[segment # 0x55a5a7fd2e00] Opening 'temp.m3u8.tmp' for writing
[segment # 0x55a5a7fd2e00] Opening 'temp-004.ts' for writing
[segment # 0x55a5a7fd2e00] Opening 'temp.m3u8.tmp' for writing
[segment # 0x55a5a7fd2e00] Opening 'temp-005.ts' for writing
[segment # 0x55a5a7fd2e00] Opening 'temp.m3u8.tmp' for writing
frame= 215 fps=0.0 q=-1.0 Lsize=N/A time=00:00:28.26 bitrate=N/A speed= 162x
video:217kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 # 0x55a5a80b8dc0] frame I:8 Avg QP:14.15 size: 2625
[libx264 # 0x55a5a80b8dc0] frame P:93 Avg QP:21.28 size: 1295
[libx264 # 0x55a5a80b8dc0] frame B:114 Avg QP:24.62 size: 703
[libx264 # 0x55a5a80b8dc0] consecutive B-frames: 27.0% 2.8% 12.6% 57.7%
[libx264 # 0x55a5a80b8dc0] mb I I16..4: 28.3% 23.0% 48.8%
[libx264 # 0x55a5a80b8dc0] mb P I16..4: 1.5% 6.2% 7.0% P16..4: 21.3% 17.8% 15.1% 0.0% 0.0% skip:31.1%
[libx264 # 0x55a5a80b8dc0] mb B I16..4: 1.2% 1.8% 1.5% B16..8: 28.1% 16.0% 10.0% direct:11.0% skip:30.4% L0:43.4% L1:31.9% BI:24.8%
[libx264 # 0x55a5a80b8dc0] 8x8 transform intra:35.9% inter:39.5%
[libx264 # 0x55a5a80b8dc0] coded y,uvDC,uvAC intra: 73.6% 71.0% 48.2% inter: 34.9% 32.7% 4.3%
[libx264 # 0x55a5a80b8dc0] i16 v,h,dc,p: 61% 12% 26% 2%
[libx264 # 0x55a5a80b8dc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 14% 23% 5% 4% 5% 4% 7% 6%
[libx264 # 0x55a5a80b8dc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 16% 15% 6% 5% 8% 6% 7% 7%
[libx264 # 0x55a5a80b8dc0] i8c dc,h,v,p: 53% 17% 21% 9%
[libx264 # 0x55a5a80b8dc0] Weighted P-Frames: Y:14.0% UV:9.7%
[libx264 # 0x55a5a80b8dc0] ref P L0: 65.2% 16.8% 12.2% 5.4% 0.4%
[libx264 # 0x55a5a80b8dc0] ref B L0: 92.3% 6.2% 1.4%
[libx264 # 0x55a5a80b8dc0] ref B L1: 97.3% 2.7%
[libx264 # 0x55a5a80b8dc0] kb/s:61.84
I see that Output #0, segment, to 'temp-%03d.ts' contains only video stream:
Stream #0:0(eng): Video: h264 (libx264), yuv420p, 160x120, q=-1--1, 7.50 fps, 90k tbn, 7.50 tbc (default)
...
video:217kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Remove -an. This option means "no audio".
Related
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
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
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.
The output file has the double duration :
Source video duration :00:01:58.88
output video duration :00:03:57.76
(video's duration is double ,audio's duration is correct. So, the video looks like played twice, with no sound in the second half )
here is the log:
./ffmpeg -i /Volumes/LANKEXIN/1383.mp4 out.mp4
ffmpeg version N-82977-g8fd3e02-tessus Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-version3 --disable-ffplay --disable-indev=qtkit --disable-indev=x11grab_xcb
libavutil 55. 43.100 / 55. 43.100
libavcodec 57. 70.100 / 57. 70.100
libavformat 57. 61.100 / 57. 61.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 68.100 / 6. 68.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/LANKEXIN/1383.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isom
creation_time : 2017-10-30T14:58:05.000000Z
encoder : mp4creator 1.6.1d
Duration: 00:01:58.88, start: 0.000000, bitrate: 1918 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1729 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
Metadata:
creation_time : 2017-10-30T14:58:05.000000Z
encoder : VC Coding
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
Metadata:
creation_time : 2017-10-30T14:58:05.000000Z
File 'out.mp4' already exists. Overwrite ? [y/N] y
[libx264 # 0x7fbaca003c00] using SAR=1/1
[libx264 # 0x7fbaca003c00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 # 0x7fbaca003c00] profile High, level 3.1
[libx264 # 0x7fbaca003c00] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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 'out.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isom
encoder : Lavf57.61.100
Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
creation_time : 2017-10-30T14:58:05.000000Z
encoder : Lavc57.70.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2017-10-30T14:58:05.000000Z
encoder : Lavc57.70.100 aac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 46 fps=0.0 q=0.0 size= 0kB time=00:00:00.93 bitrate= 0.0kbits/sframe= 64 fps= 45 q=28.0 size= 137kB time=00:00:01.66 bitrate= 672.2kbits/frame= 85 fps= 44 qframe= 5944 fps= 33 q=-1.0 Lsize= 38746kB time=00:03:57.64 bitrate=1335.7kbits/s speed=1.33x 4kB time=00:00:02.94 bitrate= 818.0kbits/s speed= 1.2x
video:36779kB audio:1846kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.311413%
[libx264 # 0x7fbaca003c00] frame I:24 Avg QP:19.49 size: 67090
[libx264 # 0x7fbaca003c00] frame P:1806 Avg QP:21.65 size: 14304
[libx264 # 0x7fbaca003c00] frame B:4114 Avg QP:25.42 size: 2484
[libx264 # 0x7fbaca003c00] consecutive B-frames: 2.2% 8.1% 25.5% 64.2%
[libx264 # 0x7fbaca003c00] mb I I16..4: 20.6% 55.8% 23.6%
[libx264 # 0x7fbaca003c00] mb P I16..4: 5.2% 9.3% 0.8% P16..4: 36.0% 9.9% 4.2% 0.0% 0.0% skip:34.5%
[libx264 # 0x7fbaca003c00] mb B I16..4: 0.5% 1.0% 0.0% B16..8: 27.2% 1.8% 0.2% direct: 0.9% skip:68.5% L0:48.6% L1:47.6% BI: 3.8%
[libx264 # 0x7fbaca003c00] 8x8 transform intra:60.9% inter:78.2%
[libx264 # 0x7fbaca003c00] coded y,uvDC,uvAC intra: 38.3% 61.5% 12.3% inter: 6.6% 11.3% 0.6%
[libx264 # 0x7fbaca003c00] i16 v,h,dc,p: 22% 35% 10% 33%
[libx264 # 0x7fbaca003c00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 24% 21% 5% 6% 6% 6% 5% 6%
[libx264 # 0x7fbaca003c00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 33% 11% 4% 7% 6% 6% 4% 4%
[libx264 # 0x7fbaca003c00] i8c dc,h,v,p: 43% 30% 20% 7%
[libx264 # 0x7fbaca003c00] Weighted P-Frames: Y:0.3% UV:0.2%
[libx264 # 0x7fbaca003c00] ref P L0: 73.5% 9.0% 13.8% 3.7% 0.0%
[libx264 # 0x7fbaca003c00] ref B L0: 92.4% 6.6% 1.1%
[libx264 # 0x7fbaca003c00] ref B L1: 97.7% 2.3%
[libx264 # 0x7fbaca003c00] kb/s:1267.21
[aac # 0x7fbaca021800] Qavg: 897.576
I'm doing some extreme slow motion in ffmpeg on a video, both video and audio track, but can't quite get my calculations correct.
The input video is 00:06:41:00 at 24fps (9624 frames).
I need the output video to be 34:00:00:00 at 24fps (2937600 frames).
I tried these for the video and audio:
setpts=305.237*PTS
atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.807668329177057
However the video overshoots by 00:01:19:08 and the audio I'm unsure, on one player it stops somewhere around 8 hours but on another it just continues. What are the correct formulas?
Also on VLC the video has grey frames between video frames - do I need to interpolate to have continuous video frames?
Edit by #Mulvya:
fred-macbookpro:~ srederiquefantune$ ffmpeg -i /Users/srederiquefantune/Desktop/test.mp4 -filter_complex "[0:v]setpts=305.237*PTS, scale=320:240[v];[0:a]atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.5, atempo=0.807668329177057[a]" -map "[v]" -map "[a]" /Users/srederiquefantune/Desktop/output2.mp4
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --disable-indev=jack --disable-outdev=xv --disable-audiotoolbox --disable-videotoolbox --disable-sdl2 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --disable-filter=coreimage --disable-filter=coreimagesrc --enable-vda --disable-indev=avfoundation --arch=x86_64 --enable-yasm --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
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 '/Users/srederiquefantune/Desktop/test.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
Duration: 00:06:41.25, start: 0.000000, bitrate: 2294 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2172 kb/s, 24 fps, 120 tbr, 90k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 112 kb/s (default)
Metadata:
handler_name : VideoHandler
[libx264 # 0x104801200] using SAR=4/3
[libx264 # 0x104801200] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.1 Cache64
[libx264 # 0x104801200] profile High, level 1.3
[libx264 # 0x104801200] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - 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=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 '/Users/srederiquefantune/Desktop/output2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.56.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 320x240 [SAR 4:3 DAR 16:9], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
Metadata:
encoder : Lavc57.64.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), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
encoder : Lavc57.64.101 aac
Stream mapping:
Stream #0:0 (h264) -> setpts
Stream #0:1 (aac) -> atempo
scale -> Stream #0:0 (libx264)
atempo -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[output stream 0:1 # 0x104105420] 100 buffers queued in output stream 0:1, something may be wrong.
frame= 1 fps=0.0 q=0.0 size= 3kB time=00:00:22.01 bitrate= 1.2kbits/s
…
frame=2938515 fps=281 q=-1.0 Lsize= 2439310kB time=35:19:08.66 bitrate= 157.2kbits/s dup=2928888 drop=1 speed=12.1x
video:389302kB audio:1994106kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.345466%
[libx264 # 0x104801200] frame I:15399 Avg QP:14.27 size: 20680
[libx264 # 0x104801200] frame P:740673 Avg QP:17.21 size: 68
[libx264 # 0x104801200] frame B:2182443 Avg QP:25.83 size: 14
[libx264 # 0x104801200] consecutive B-frames: 0.9% 0.2% 0.1% 98.8%
[libx264 # 0x104801200] mb I I16..4: 7.9% 47.3% 44.8%
[libx264 # 0x104801200] mb P I16..4: 0.0% 0.1% 0.1% P16..4: 0.7% 0.1% 0.1% 0.0% 0.0% skip:99.0%
[libx264 # 0x104801200] 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:14.0% L1:85.9% BI: 0.0%
[libx264 # 0x104801200] 8x8 transform intra:48.2% inter:52.8%
[libx264 # 0x104801200] coded y,uvDC,uvAC intra: 91.4% 90.7% 88.0% inter: 0.1% 0.1% 0.0%
[libx264 # 0x104801200] i16 v,h,dc,p: 78% 4% 11% 7%
[libx264 # 0x104801200] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 13% 17% 7% 8% 10% 7% 10% 10%
[libx264 # 0x104801200] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 13% 11% 8% 10% 11% 8% 10% 9%
[libx264 # 0x104801200] i8c dc,h,v,p: 62% 15% 16% 7%
[libx264 # 0x104801200] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 # 0x104801200] ref P L0: 87.6% 7.8% 4.0% 0.6% 0.0%
[libx264 # 0x104801200] ref B L0: 50.0% 49.6% 0.4%
[libx264 # 0x104801200] ref B L1: 91.3% 8.7%
[libx264 # 0x104801200] kb/s:26.05
[aac # 0x104802a00] Qavg: 632.499
fred-macbookpro:~ srederiquefantune$