[FFmpeg-user] Modify sequence header in MPEG with no transcoding?

Moritz Barsnick barsnick at gmx.net
Thu Jul 27 22:10:18 EEST 2017


On Thu, Jul 27, 2017 at 13:16:37 +0100, David Griffiths wrote:

> But before I do so I just want to check that I haven’t missed some
> obscure ffmpeg feature that will allow me to do this? From what I
> read it appears you either have to decode and then reencode or there
> is the copy option, but the copy option doesn’t touch the sequence
> headers (I tried "ffmpeg -i file.mod -acodec copy -vcodec copy
> -aspect 16:9 file.mpeg”)

Good work on analyzing this.

Ah, if it's really the sequence headers, and they are part of the
stream, you would be looking for a so-called bitstream filter (in
combination with "-c copy").

I can't find a suitable one in the list (they're all documented or at
least named, I think it was me who ensured that in the documentation -
otherwise use "ffmpeg -bsfs"). If you can describe the algorithm used -
i.e. what you do in the hex editor (e.g. look for a certain byte
sequence, go N bytes further, find the float number 1.333, change it to
1.78 - or something like that), that can likely be done in a few lines
of code.

Do you have a small sample file, output from ffprobe before and after
the modification, and a description of how you modify?

Cheers,
Moritz


More information about the ffmpeg-user mailing list