[FFmpeg-devel] [PATCH v2] libavformat/mpegtsenc.c: correctly re-emit extradata ahead of IDR pictures

Marton Balint cus at passwd.hu
Tue Feb 21 00:21:33 EET 2023

On Mon, 20 Feb 2023, Anton Khirnov wrote:

> I'm wondering if there isn't a bsf that could do this in a cleaner way
> than messing with codec internals in a muxer.

I thought about that too, but in the end I sticked to the more simple 
approach, because I could not decide which would be better, adding a 
single new bsf which works for any codec you may want to mux into mpegts 
(h264, hevc, av1) or hack some new options to existing *_metadata bsf-s to 
make them create mpegts-compliant output.

The problem with using *_metadata is that I am not sure if more complex 
insertion rules belong to those filters, and the way they work - 
parsing everything with the CBS framework - they have significant CPU 

A separate BSF could use the same or very similar code as mpegtsenc.c 
right now, but by having it separate we have to maintain it separately 
from mpegtsenc, and that can also cause problems, if a newer version of 
mpegtsenc expects the BSF to do something different than the older 


More information about the ffmpeg-devel mailing list