[FFmpeg-user] ffmpeg architecture question

pdr0 pdr0 at shaw.ca
Sun Apr 19 23:48:26 EEST 2020


pdr0 wrote
> 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
> "interleave" is 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

 
 Here's your "proof", and why Paul's succinct "perfect" answer was indeed
correct
 
The blend filter in your example, combined (n-1) with (n). This messed up
the timestamps if you -map the output node of blend suggested earlier such
as [D2] - they don't match the "holes" or the missing ones in [C] . Ie. they
are not "complementary" . 
 
 I was looking for a -vf setpts expression to fix and offset the timestamps,
or somehow "assume" the [H] branch timestamps, because those are the ones
that are complementary and "fit".
 
 But it turns out that it's much easier - the input timestamps from blend
filter take on the first node. Originally it was [G][H] ; [H][G] makes blend
take H's timestamps
 
(Sorry about the long line, I have a problem with "^" split in windows with
-filter_complex)
 
 ffmpeg -i 23.976p_framenumber.mp4 -filter_complex
"telecine=pattern=5,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],[H][G]blend=all_mode=average,split[D][D2],
[C][D]interleave[out]" -map [out] -c:v libx264 -crf 20 testout2.mkv  -map
[D2] -c:v libx264 -crf 20 testD2pts.mkv  -y 




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


More information about the ffmpeg-user mailing list