[FFmpeg-user] the trim filter

Mark Filipak markfilipak.imdb at gmail.com
Thu Jul 4 23:25:24 EEST 2024


On 04/07/2024 14.22, Paul B Mahol wrote:
> On Thu, Jul 4, 2024 at 8:05 PM Mark Filipak <markfilipak.imdb at gmail.com>
> wrote:
> 
>> Is there some secret to the trim filter?
>>
>> --filter_complex "split=2[i5][i6],
>>    [i5]trim=start_frame=481:end_frame=134047[o5],
>>    [i6]trim=start_frame=138745:end_frame=246719[o6],
>>    [o5][o6]concat=n=2"
>>
>> I get "dup=481", instead, and wind up with 20.061708[3..] seconds of black
>> frames preceding the
>> segment I want, and the frame rate is 19.181 FPS.
>>
>>
> You need to rewrite audio timestamps, otherwise you get 'empty' gaps.

Have you found an atrim expression that works?

I tried adding atrim=start=20.062. Now playback goes for 20.061708[3..] sec of black frames, then 
freezes for another 20.061708[3..] sec, then continues as though nothing strange had happened.

Actually changing the audio frame's PTSes is going to be harder than hard.

--Mark.




More information about the ffmpeg-user mailing list