[FFmpeg-user] ffmpeg architecture question

pdr0 pdr0 at shaw.ca
Sat Apr 18 01:19:22 EEST 2020


Paul B Mahol wrote
> Interleave filter use frame pts/timestamps for picking frames.


I think Paul is correct. 

@Mark -
Everything in filter chain works as expected, except interleave in this case

You can test and verify the output of each node in a filter graph,
individually, by splitting and using -map.

D2 below demonstrates that the output of blend is working properly , and
this also implies that G,H were correct, but you could split and -map them
too to double check

 ffmpeg -i 23.976p_framenumber.mp4 -filter_complex
"telecine=pattern=46,split[A][B],[A]select='not(eq(mod(n+1\,5)\,3))'[C],[B]split[E][F],[E]select='eq(mod(n+1\,5)\,2)',datascope=size=1920x1080:x=45:y=340:mode=color2[G],[F]select='eq(mod(n+1\,5)\,3)'[H],[G][H]blend=all_mode=average,split[D][D2],[C][D]interleave[out]"
-map [out] -c:v libx264 -crf 20 testout.mkv  -map [D2] -c:v libx264 -crf 20
testD2.mkv  -y

As Paul pointed out, interleave works using timestamps , not "frames". If
you took 2 separate video files, with the same fps, same timestamps, they
won't interleave correctly in ffmpeg. The example in the documentation
actually does not work if they had the same timestamps. You would have to
offset the PTS of one relative to the other for interleave to work
correctly. 

If you check the timestamps of each output node, you will see why it's not
working here, and why it works properly in some other cases .  To get it
working in this example, you would need [D] to assume [H]'s timestamps,
because those are where the "gaps" or "holes" are in [C] . It might be
possible using an expression using setpts





--
Sent from: http://www.ffmpeg-archive.org/


More information about the ffmpeg-user mailing list