[FFmpeg-devel] avformat/movenc: add param for filtering nal types

Eran Kornblau eran.kornblau at kaltura.com
Tue Mar 6 16:51:55 EET 2018


Hi all,

The attached patch adds a parameter that enables the user to choose which AVC/HEVC NAL units to include in the output.
The parameter is supplied as a bitmask in order to keep things simple.

A short background on why we need it - in our transcoding process, we partition the video in chunks, the chunks are
transcoded in parallel and packaged in MPEG-TS container. The transcoded TS chunks are then concatenated and
packaged in MP4. These MP4 files are later repackaged on-the-fly to various protocols (HLS/DASH etc.) using our
JIT packager.
For performance reasons (can get into more detail if anyone's interested...), when packaging the MP4 to DASH/CENC,
we configure the packager to assume that each AVC frame contains exactly one NAL unit.
The problem is that the transition through MPEG-TS adds additional NAL units (NAL AUD before each frame + SPS/PPS
before each key frame), and this assumption fails.
Using the attached patch we can pass '-nal_types_mask 0x3e' which will make ffmpeg output only VCL NALs in the stream.

Thanks!

Eran
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-movenc-add-param-for-filtering-nal-types.patch
Type: application/octet-stream
Size: 15154 bytes
Desc: 0001-avformat-movenc-add-param-for-filtering-nal-types.patch
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180306/7408129b/attachment.obj>


More information about the ffmpeg-devel mailing list