[FFmpeg-devel] [PATCH] ffmpeg: remove obsolete workaround in trim insertion.

Paul B Mahol onemda at gmail.com
Fri Aug 9 15:34:54 CEST 2013

On 8/9/13, Nicolas George <nicolas.george at normalesup.org> wrote:
> Le duodi 22 thermidor, an CCXXI, Paul B Mahol a ecrit :
>> But is such behaviour correct?
> What do you mean?
> If you have an input stream with 2048 samples frames, and request 1 second
> at 44100 Hz, the old behaviour would transmit 22 frames, and therefore 956
> samples beyond what you requested. The new behaviour will transmit 21
> frames
> and 1091 samples from the 22nd, and therefore exactly 44100 samples.
> (If the output codec is framed, the result will then be padded to its frame
> size with zeroes, that can not be avoided, and at least it is silence.)
> The same, I suppose, happens for the start time.
> I consider this behaviour more correct. I had started working on something
> similar a long time ago, but never finished it.

But arguments for trim filters given by ffmpeg are in doubles,
original time is expressed in
integers so I fail to see why just replacing doubles with ints and
removing division and using
'durationi' & 'starti' instead of 'duration' & 'start' is not correct.
So with additional different rounding it also adds extra processing
(more/less irrelevant).

More information about the ffmpeg-devel mailing list