[FFmpeg-devel] [PATCH] libavformat/qsvenc: repeat mpeg2 missing headers [v2]

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Jun 4 21:29:30 EEST 2019

On 04.06.2019, at 15:07, Andreas Håkon <andreas.hakon at protonmail.com> wrote:

> Hi,
> I need to admit that I'm completely wrong in the end. After spending a lot
> of time on a patch to solve the problem (making the MPEG-2 QSV encoder
> compatible with broadcasts), I discovered that this solution works:
> $ ffmpeg  ... -c:v mpeg2_qsv -bsf:v 'dump_extra' -f mpegts ...
> Using this bitstream filter every GOP includes the missing sequence headers.
> However, one flaw persists:
> - The first GOP has duplicated SEQ_START_CODE and EXT_START_CODE headers.
> The problem is that the dump_extra filter re-injects the headers
> without **verifying** their existence.
> Until someone fixes this, I'm commenting it here for documentation.
> In addition, I hope that an example will be incorporated into the
> Documentation as a reference.

I think ideally MPEG-TS/ES/... muxers would detect such cases and print a warning suggesting this command, which I think would be much better than documentation.
Maybe it could even detect relevant cases and insert it itself.
But either way, ideally someone would spend some time considering what the right way is to design this.

More information about the ffmpeg-devel mailing list