[FFmpeg-user] Selecting/dropping frames without re-encoding

Moritz Barsnick barsnick at gmx.net
Thu Oct 6 17:07:02 EEST 2016


On Thu, Oct 06, 2016 at 10:53:14 -0300, Marcelo Boufleur wrote:
> I'm not sure that what Mikhail wants really exists. If I understand
> correctly, you want to retain original encoding and drop one frame every
> two frames.

I understand the same thing. (Carl Eugen was concentrating on Mikhail's "not
re-encoding" wording, which can of course be achieved by just decoding.
;-)) Keep every second frames without decoding them, but re-assembling
them to a valid MXF.

> If this would be possible, you would have to work at the DNxHD inner level,
> identify each frame start/end (by headers), bit-stream copy whichever
> frames you would need, and then re-generate the DNxHD layer and headers to
> reflect all the changes you have made.

Exactly. Since you don't want to decode (which implies re-encoding),
this would be with "-c:v copy" and would effectively be a bitstream
filter. I'm not aware that any such filter exists (and whether the
ffmpeg devs would even consider accepting integrating such a bsf). It
pure theory, this *could* even be done for more codecs than just DNxHD.

> I may be wrong, but I believe with current FFmpeg implementation you can
> only work either with stream copy (if you don't want to change encoding,
> nor frame rate, which defies his purpose), or use the previous suggestions
> to cut framerate by half, which implies on re-encoding (which again, defies
> his purpose).

I found the suggestion to use the concat demuxer with streamcopy very
interesting. Assuming it can seek and cut precisely, that could work -
again in theory. Let's experiment with that. :)

Moritz


More information about the ffmpeg-user mailing list