[FFmpeg-devel] Concatenate NAL units in av_write_frame call

Andreas Rheinhardt andreas.rheinhardt at googlemail.com
Fri Apr 12 16:01:00 EEST 2019


Andriy Gelman:
> Hello, 
> 
> I've been working with HEVC + mpegts at low bitrates 10-20kbps. 
> 
> At these bitrates, mpegts can create a substantial overhead due
> to the 188 byte frame size (i.e. a NAL unit of 200 bytes will get
> rounded up to 376 bytes).  
> 
> I've tried to get around this by concatenating multiple NAL units into a single
> call to av_write_frame.  
> 
> This seems to work; the parser in av_read_frame outputs separate NAL
> units. The only issue is that only the first NAL unit of the super packet has
> the correct time stamp. The subsequent timestamps are AV_NOPTS_VALUE. 
> 
> Would it be of interest to community for me to: 
> 1. Fix the AV_NOPTS_VALUE issue
> 2. Add option to concatenate multiple NAL units in single call to av_write_frame
> 
Fixing 1. would be very desirable, not only for HEVC, but for other
codecs as well. E.g. #6903 is about the H.264 analogue of this where
remuxing fails because the a PES packet contained two separately coded
fields the second of which lacked timestamps.

- Andreas


More information about the ffmpeg-devel mailing list