[FFmpeg-user] Zoompan filter, frame counts seem to start from 2 and 1, not 0 -- expected behaviour?

Jim DeLaHunt from.ffmpeg-user at jdlh.com
Sat Jun 2 12:09:06 EEST 2018


On 2018-06-02 01:22, Gyan Doshi wrote:
>
> This isn't related to the zoompan filter. If you ask ffmpeg to not 
> compress the log messages by setting the repeat flag `-v +repeat`, 
> you'll see that the crop filter processes the first frame twice.
Thank you for the prompt response!

Below I've pasted the result of running ffmpeg with flag '-v +repeat', 
both for the filter sequence of *crop* followed by *zoompan* [1], and 
for just the *zoompan *filter [2].

Yes, the crop filter appears to process the first frame twice:

1234000.000000
1234000.000000
2718002.000000
3142001.000000

But even without the *crop* filter, the *zoompan* filter appears to be 
starting its *in* and *on* frame counts at 3 and 2:

2718002.000000
3142001.000000

On 2018-06-02 01:22, Gyan Doshi wrote:
> I suspect that this is related to the commit,
>
> ffmpeg: init filtergraphs only after we have a frame on each input
>
> viewed at 
> http://git.videolan.org/?p=ffmpeg.git;a=commit;h=af1761f7b5b1b72197dc40934953b775c2d951cc
>
> I'll try to bisect later and test. Feel free to raise a ticket.
I guess you are saying you don't see a rationale for the zoompan:in and 
zoompan:on values to start at 3 and 2. I still don't know whether to 
expect 1 as a reasonable value. I hope for 0, for consistency with 
crop:n and other frame number options. So sure, I'll make a note to open 
a ticket.

Here are the update command invocations:

[1] ffmpeg with flag '-v +repeat', with the filter sequence of *crop* 
followed by *zoompan
*

% ./ffmpeg -v +repeat -to 0.3 -i fate-suite/h264/interlaced_crop.mp4 -an -vf "crop=x=print(1234000+n)*0,zoompan=d=1:s=qhd:zoom=print(2718000+in)*0+print(3142000+on)*0+1" -f mp4 -y /dev/null
ffmpeg version N-91206-g9827bb88e7 Copyright (c) 2000-2018 the FFmpeg developers
   built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
   configuration: --samples=fate-suite
   libavutil      56. 18.102 / 56. 18.102
   libavcodec     58. 19.105 / 58. 19.105
   libavformat    58. 17.100 / 58. 17.100
   libavdevice    58.  4.100 / 58.  4.100
   libavfilter     7. 24.100 /  7. 24.100
   libswscale      5.  2.100 /  5.  2.100
   libswresample   3.  2.100 /  3.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'fate-suite/h264/interlaced_crop.mp4':
   Metadata:
     major_brand     : avc1
     minor_version   : 0
     compatible_brands: isomavc1
     creation_time   : 2010-10-07T15:03:51.000000Z
   Duration: 00:00:05.04, start: 0.000000, bitrate: 551 kb/s
     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 547 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
     Metadata:
       creation_time   : 2010-10-07T15:03:51.000000Z
       handler_name    : GPAC ISO Video Handler
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
1234000.000000
1234000.000000
2718002.000000
3142001.000000
Output #0, mp4, to '/dev/null':
   Metadata:
     major_brand     : avc1
     minor_version   : 0
     compatible_brands: isomavc1
     encoder         : Lavf58.17.100
     Stream #0:0(und): Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
     Metadata:
       creation_time   : 2010-10-07T15:03:51.000000Z
       handler_name    : GPAC ISO Video Handler
       encoder         : Lavc58.19.105 mpeg4
     Side data:
       cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
1234001.000000
1234001.000000
2718003.000000
3142002.000000
1234002.000000
1234002.000000
2718004.000000
3142003.000000
1234003.000000
1234003.000000
2718005.000000
3142004.000000
1234004.000000
1234004.000000
2718006.000000
3142005.000000
1234005.000000
1234005.000000
2718007.000000
3142006.000000
1234006.000000
1234006.000000
2718008.000000
3142007.000000
1234007.000000
1234007.000000
2718009.000000
3142008.000000
frame=    8 fps=0.0 q=12.1 Lsize=     107kB time=00:00:00.28 bitrate=3127.5kbits/s speed=5.04x
video:106kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.837148%


[2] ffmpeg with flag '-v +repeat', with just the *zoompan *filter*.

*

% ./ffmpeg -v +repeat -to 0.3 -i fate-suite/h264/interlaced_crop.mp4 -an -vf "zoompan=d=1:s=qhd:zoom=print(2718000+in)*0+print(3142000+on)*0+1" -f mp4 -y /dev/null
ffmpeg version N-91206-g9827bb88e7 Copyright (c) 2000-2018 the FFmpeg developers
   built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
   configuration: --samples=fate-suite
   libavutil      56. 18.102 / 56. 18.102
   libavcodec     58. 19.105 / 58. 19.105
   libavformat    58. 17.100 / 58. 17.100
   libavdevice    58.  4.100 / 58.  4.100
   libavfilter     7. 24.100 /  7. 24.100
   libswscale      5.  2.100 /  5.  2.100
   libswresample   3.  2.100 /  3.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'fate-suite/h264/interlaced_crop.mp4':
   Metadata:
     major_brand     : avc1
     minor_version   : 0
     compatible_brands: isomavc1
     creation_time   : 2010-10-07T15:03:51.000000Z
   Duration: 00:00:05.04, start: 0.000000, bitrate: 551 kb/s
     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 547 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
     Metadata:
       creation_time   : 2010-10-07T15:03:51.000000Z
       handler_name    : GPAC ISO Video Handler
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
2718002.000000
3142001.000000
Output #0, mp4, to '/dev/null':
   Metadata:
     major_brand     : avc1
     minor_version   : 0
     compatible_brands: isomavc1
     encoder         : Lavf58.17.100
     Stream #0:0(und): Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
     Metadata:
       creation_time   : 2010-10-07T15:03:51.000000Z
       handler_name    : GPAC ISO Video Handler
       encoder         : Lavc58.19.105 mpeg4
     Side data:
       cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
2718003.000000
3142002.000000
2718004.000000
3142003.000000
2718005.000000
3142004.000000
2718006.000000
3142005.000000
2718007.000000
3142006.000000
2718008.000000
3142007.000000
2718009.000000
3142008.000000
frame=    8 fps=0.0 q=12.1 Lsize=     107kB time=00:00:00.28 bitrate=3127.5kbits/s speed=7.98x
video:106kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.837148%

-- 
     --Jim DeLaHunt, jdlh at jdlh.com     http://blog.jdlh.com/ (http://jdlh.com/)
       multilingual websites consultant

       355-1027 Davie St, Vancouver BC V6E 4L2, Canada
          Canada mobile +1-604-376-8953



More information about the ffmpeg-user mailing list