[FFmpeg-user] Question about tmix filter

Paul B Mahol onemda at gmail.com
Wed Mar 6 21:17:56 EET 2019


On 3/6/19, Michael Koch <astroelectronic at t-online.de> wrote:
> Am 06.03.2019 um 17:12 schrieb Paul B Mahol:
>> On 3/6/19, Michael Koch <astroelectronic at t-online.de> wrote:
>>> I'd like to know which frames does the tmix filter use for averaging.
>>> Let's assume tmix=frames=9.
>>> To make the n_th frame of the output video, does it use input frames n-8
>>> to n, or n-4 to n+4, or n to n+8?
>>> How does the filter behave at the beginning and end of the video, where
>>> not all required input frames exist?
>> Filter output first frame after frames=9 it got from input. At
>> encountering eof it simply ends.
>
> I did make this test with a 5 seconds @25fps input video with
> tmix=frames=50, so that the output should be 2 seconds shorter. But the
> output video has the same length as the input.

Your interpretation of test results is invalid.
You should count frames.

>
> F:\Meteore>c://ffmpeg/ffmpeg -i sternschnuppe167.mp4 -vf tmix=frames=50
> -q:v 1 -
> y test.mp4
> ffmpeg version N-93219-gc679119a73 Copyright (c) 2000-2019 the FFmpeg
> developers
>
>    built with gcc 8.2.1 (GCC) 20190212
>    configuration: --enable-gpl --enable-version3 --enable-sdl2
> --enable-fontconfi
> g --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d
> --enable-libb
> luray --enable-libfreetype --enable-libmp3lame
> --enable-libopencore-amrnb --enab
> le-libopencore-amrwb --enable-libopenjpeg --enable-libopus
> --enable-libshine --e
> nable-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 --enab
> le-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
> --enable-libmysofa --en
> able-libspeex --enable-libxvid --enable-libaom --enable-libmfx
> --enable-amf --en
> able-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc
> --enable-nvdec --e
> nable-dxva2 --enable-avisynth --enable-libopenmpt
>    libavutil      56. 26.100 / 56. 26.100
>    libavcodec     58. 47.102 / 58. 47.102
>    libavformat    58. 26.101 / 58. 26.101
>    libavdevice    58.  6.101 / 58.  6.101
>    libavfilter     7. 48.100 /  7. 48.100
>    libswscale      5.  4.100 /  5.  4.100
>    libswresample   3.  4.100 /  3.  4.100
>    libpostproc    55.  4.100 / 55.  4.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sternschnuppe167.mp4':
>    Metadata:
>      major_brand     : isom
>      minor_version   : 512
>      compatible_brands: isomiso2avc1mp41
>      encoder         : Lavf58.26.101
>    Duration: 00:00:05.03, start: 0.000000, bitrate: 10351 kb/s
>      Stream #0:0(und): Video: h264 (High 4:2:2) (avc1 / 0x31637661),
> yuv422p, 120
> 0x1200 [SAR 1:1 DAR 1:1], 10276 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
> (default
> )
>      Metadata:
>        handler_name    : VideoHandler
>      Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
> stereo, flt
> p, 127 kb/s (default)
>      Metadata:
>        handler_name    : SoundHandler
> 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
> [libx264 @ 000000000304fa40] -qscale is ignored, -crf is recommended.
> [libx264 @ 000000000304fa40] using SAR=1/1
> [libx264 @ 000000000304fa40] using cpu capabilities: MMX2 SSE2Fast SSSE3
> SSE4.2
> AVX FMA3 BMI2 AVX2
> [libx264 @ 000000000304fa40] profile High 4:2:2, level 4.0, 4:2:2, 8-bit
> [libx264 @ 000000000304fa40] 264 - core 157 r2935 545de2f - H.264/MPEG-4
> AVC cod
> ec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options:
> cabac=1 r
> ef=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_pski
> p=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0
> nr=0 deci
> mate=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=2
> 5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
> qcomp=0.6
> 0 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
> Output #0, mp4, to 'test.mp4':
>    Metadata:
>      major_brand     : isom
>      minor_version   : 512
>      compatible_brands: isomiso2avc1mp41
>      encoder         : Lavf58.26.101
>      Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661),
> yuv422p, 1200x1
> 200 [SAR 1:1 DAR 1:1], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
>      Metadata:
>        handler_name    : VideoHandler
>        encoder         : Lavc58.47.102 libx264
>      Side data:
>        cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
>      Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
> stereo, flt
> p, 128 kb/s (default)
>      Metadata:
>        handler_name    : SoundHandler
>        encoder         : Lavc58.47.102 aac
> frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:02.11 bitrate=
> 0.2kbits/s
> frame=    3 fps=2.2 q=0.0 size=       0kB time=00:00:02.19 bitrate=
> 0.2kbits/s
> frame=    5 fps=2.5 q=0.0 size=       0kB time=00:00:02.26 bitrate=
> 0.2kbits/s
> frame=    7 fps=2.6 q=0.0 size=       0kB time=00:00:02.34 bitrate=
> 0.2kbits/s
> frame=    9 fps=2.8 q=0.0 size=       0kB time=00:00:02.43 bitrate=
> 0.2kbits/s
> frame=   11 fps=2.8 q=0.0 size=       0kB time=00:00:02.51 bitrate=
> 0.2kbits/s
> frame=   13 fps=2.9 q=0.0 size=       0kB time=00:00:02.58 bitrate=
> 0.1kbits/s
> frame=   15 fps=2.9 q=0.0 size=       0kB time=00:00:02.66 bitrate=
> 0.1kbits/s
> frame=   17 fps=2.9 q=0.0 size=       0kB time=00:00:02.75 bitrate=
> 0.1kbits/s
> frame=   19 fps=3.0 q=0.0 size=       0kB time=00:00:02.83 bitrate=
> 0.1kbits/s
> frame=   21 fps=3.0 q=0.0 size=       0kB time=00:00:02.90 bitrate=
> 0.1kbits/s
> frame=   23 fps=3.0 q=0.0 size=       0kB time=00:00:02.98 bitrate=
> 0.1kbits/s
> frame=   25 fps=3.0 q=0.0 size=       0kB time=00:00:03.07 bitrate=
> 0.1kbits/s
> frame=   27 fps=3.0 q=0.0 size=       0kB time=00:00:03.15 bitrate=
> 0.1kbits/s
> frame=   29 fps=3.0 q=0.0 size=       0kB time=00:00:03.22 bitrate=
> 0.1kbits/s
> frame=   31 fps=3.0 q=0.0 size=       0kB time=00:00:03.30 bitrate=
> 0.1kbits/s
> frame=   33 fps=3.1 q=0.0 size=       0kB time=00:00:03.39 bitrate=
> 0.1kbits/s
> frame=   35 fps=3.1 q=0.0 size=       0kB time=00:00:03.47 bitrate=
> 0.1kbits/s
> frame=   37 fps=3.1 q=0.0 size=       0kB time=00:00:03.54 bitrate=
> 0.1kbits/s
> frame=   39 fps=3.1 q=0.0 size=       0kB time=00:00:03.62 bitrate=
> 0.1kbits/s
> frame=   41 fps=3.1 q=0.0 size=       0kB time=00:00:03.71 bitrate=
> 0.1kbits/s
> frame=   43 fps=3.1 q=0.0 size=       0kB time=00:00:03.79 bitrate=
> 0.1kbits/s
> frame=   45 fps=3.1 q=0.0 size=       0kB time=00:00:03.86 bitrate=
> 0.1kbits/s
> frame=   47 fps=3.1 q=0.0 size=       0kB time=00:00:03.94 bitrate=
> 0.1kbits/s
> frame=   49 fps=3.1 q=0.0 size=       0kB time=00:00:04.03 bitrate=
> 0.1kbits/s
> frame=   51 fps=3.1 q=28.0 size=       0kB time=00:00:04.11 bitrate=
> 0.1kbits/
> frame=   53 fps=3.1 q=28.0 size=       0kB time=00:00:04.18 bitrate=
> 0.1kbits/
> frame=   55 fps=3.1 q=28.0 size=     256kB time=00:00:04.26 bitrate=
> 491.6kbits/
> frame=   57 fps=3.1 q=28.0 size=     256kB time=00:00:04.35 bitrate=
> 482.0kbits/
> frame=   59 fps=3.1 q=28.0 size=     256kB time=00:00:04.43 bitrate=
> 472.7kbits/
> frame=   61 fps=3.1 q=28.0 size=     256kB time=00:00:04.50 bitrate=
> 466.0kbits/
> frame=   63 fps=3.1 q=28.0 size=     256kB time=00:00:04.58 bitrate=
> 457.3kbits/
> frame=   65 fps=3.1 q=28.0 size=     256kB time=00:00:04.67 bitrate=
> 449.0kbits/
> frame=   67 fps=3.1 q=28.0 size=     256kB time=00:00:04.75 bitrate=
> 440.9kbits/
> frame=   69 fps=3.1 q=28.0 size=     256kB time=00:00:04.82 bitrate=
> 435.1kbits/
> frame=   72 fps=3.1 q=28.0 size=     256kB time=00:00:04.97 bitrate=
> 422.0kbits/
> frame=   74 fps=3.1 q=28.0 size=     256kB time=00:00:04.97 bitrate=
> 422.0kbits/
> frame=   76 fps=3.1 q=28.0 size=     256kB time=00:00:04.97 bitrate=
> 422.0kbits/
> frame=   76 fps=3.0 q=-1.0 Lsize=     872kB time=00:00:05.01
> bitrate=1424.2kbits
> /s speed=0.198x
> video:790kB audio:78kB subtitle:0kB other streams:0kB global headers:0kB
> muxing
> overhead: 0.393023%
> [libx264 @ 000000000304fa40] frame I:1     Avg QP:19.44  size:259014
> [libx264 @ 000000000304fa40] frame P:75    Avg QP:19.56  size:  7319
> [libx264 @ 000000000304fa40] mb I  I16..4: 12.4% 69.2% 18.4%
> [libx264 @ 000000000304fa40] mb P  I16..4:  0.0%  0.0%  0.0% P16..4:
> 19.5%  0.3
> %  1.6%  0.0%  0.0%    skip:78.5%
> [libx264 @ 000000000304fa40] 8x8 transform intra:69.2% inter:62.8%
> [libx264 @ 000000000304fa40] coded y,uvDC,uvAC intra: 89.1% 0.0% 0.0%
> inter: 9.9
> % 0.0% 0.0%
> [libx264 @ 000000000304fa40] i16 v,h,dc,p: 33%  4% 56%  7%
> [libx264 @ 000000000304fa40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  8% 12% 40%
> 6%  6%
>   6%  6%  7%  8%
> [libx264 @ 000000000304fa40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9% 10% 24%
> 11% 10%
>   9%  9%  9% 10%
> [libx264 @ 000000000304fa40] i8c dc,h,v,p: 100%  0%  0%  0%
> [libx264 @ 000000000304fa40] Weighted P-Frames: Y:0.0% UV:0.0%
> [libx264 @ 000000000304fa40] ref P L0: 97.8%  1.4%  0.8%  0.0%
> [libx264 @ 000000000304fa40] kb/s:2126.23
> [aac @ 0000000003282780] Qavg: 176.570
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list