[FFmpeg-user] ffmpeg architecture question

Mark Filipak markfilipak.windows+ffmpeg at gmail.com
Sat Apr 18 01:52:57 EEST 2020


On 04/17/2020 06:19 PM, pdr0 wrote:
> 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

The only problem I have with 'interleave' is that it doesn't halt at end-of-stream, but that's no 
big deal.

> 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

Ah! I see what you're doing with [D2]. I'll try that in a few minutes (as soon as I figure out how I 
can pass-through LPCM 5.1 without error).

I'm not using the 46 telecine anymore because you introduced me to 'pp=linblenddeint' -- thanks 
again! -- which allowed me to decomb via the 55 telecine.

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

That sounds like a PITA. Good thing I'm not merging 2 streams. I don't anticipate ever having to do 
that.

> 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

Gee, pdr0, I'm sorry you took the time to write about 'interleave' not working because it is working 
for me.

Oops! Got to run. I just received an email from Farook Farshad <fujiwara at ne.jp> of Saudi Aramco Oil 
informing me of a proposal and that I need to "revert back".  ;-)


More information about the ffmpeg-user mailing list