[FFmpeg-devel] [PATCH] filters: add the vediting and aediting filters

Federico Simoncelli federico.simoncelli at gmail.com
Tue Jan 7 13:22:52 CET 2014

On Tue, Jan 7, 2014 at 7:55 AM, Clément Bœsch <u at pkh.me> wrote:
> What's the difference with
> select=between(t,START_TS1,END_TS1)+between(t,START_TS2,END_TS2)+...?
> [...]

I started working on this filter because with select/between you'll
have an "hole" between END_TS1 and START_TS2 (no frames / no audio).
What you want to do is shift back START_TS2 to END_TS1 +

Another reason is to give ffmpeg a specific filter for editing audio/video.
Even if I really like the composability of select I think we need
something specifically designed for this task.

I'll give you an example, you can try to workaround the problem of the
gap between END_TS1 and START_TS2 using setpts/asetpts:

 select="between(t,START_TS1,END_TS1)+between(t,START_TS2,END_TS2)+..." \
 aselect="between(t,START_TS1,END_TS1)+between(t,START_TS2,END_TS2)+..." \
 setpts=N/(FRAME_RATE*TB) \

(hopefully I got it right with the setpts/asetpts thing, I haven't
double-checked it, anyway you get the idea)

but this won't handle damaged streams as you may have less/more video
frames than audio frames and you'll experience desynchronization.

Maybe we can try to come up with a complex composition of multiple
filters in order to achieve editing and handle all the problems, but
that exercise at the moment is left to the reader, and the first
impression is that either ffmpeg doesn't have editing at all, or if it
does you're on your own trying to solve all the issues yourself.


More information about the ffmpeg-devel mailing list