[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 23:23:04 EEST 2018



On 2018-06-02 03:25, Gyan Doshi wrote:
>
>
> On 02-06-2018 02:39 PM, Jim DeLaHunt wrote:
>> But even without the *crop* filter, the *zoompan* filter appears to 
>> be starting its *in* and *on* frame counts at 3 and 2:
>
> That should be "2 and 1"
You are right! Thank you for catching this. I've been reading the output 
incorrectly. The first output of *in* and *on* frame counts from the 
*zoompan* has been 2 and 1 all along. It appears before the metadata for 
the output, which I missed:

... [omitted for brevity] ...
Press [q] to stop, [?] for help
1234000.000000
1234000.000000
2718002.000000
3142001.000000
Output #0, mp4, to '/dev/null':
... [omitted for brevity] ...


For the sake of discussion in the ticket, I'll be arguing that the value 
I expect for the first output of *in* is 0, and the value I expect for 
output of *on* is to start at *in* times *d*, incrementing to (*in* 
times *d*) + (*d* - 1).
> This change occurred when zoompan switched to activate in 
> 2ce43274e39295e3965c51dcfaf802628a5929f9
Interesting. I see a lot in that commit, but the expressions for 
var_values[VAR_IN] and var_values[VAR_OUT] don't seem to change. Lines 
241-242 in 99b6e68, and lines 266-267 in 2ce4327, both seem to read,

     s->var_values[VAR_IN]    = inlink->frame_count_out + 1;
     s->var_values[VAR_ON]    = outlink->frame_count_in + 1;


But there is much in this codebase that I don't understand.

Maybe the detail discussion of the code could move to the ticket, when I 
get time to open it.

Thank you for your attention, Gyan!

-- 
     --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