[FFmpeg-devel] [PATCH] avformat/matroska: Parse generic encryption info from packets.

Jacob Trimble modmaker at google.com
Fri Jul 13 02:45:17 EEST 2018


The attached patch adds parsing for WebM encryption info into the
AVEncryptionInfo side-data.  The AVEncryptionInitInfo will be handled
in another patch.

Spec: https://www.webmproject.org/docs/webm-encryption/

I am currently seeing a problem with this when using Opus audio.  In
read_frame_internal, it will try to parse the resulting packet.  For
video, which uses subsample encryption, it is able to parse the
headers; but for Opus, which uses full-sample encryption, it fails to
parse the headers.  This causes the read_frame_internal to drop the
packet.

I have traced a workaround to opus_parse in opus_parser.c: instead of
setting poutbuf to NULL, set it to the buffer and just pass the packet
to the app to handle it.  The frame will be decrypted before passing
to the decoder.  I can't just disable parsing in the demuxer because I
want to parse the packets for clear content and when using subsample
encryption.

Does anyone have any other ideas to work around this?  Is there a way
to allow parsing but ignore errors?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-matroska-Parse-generic-encryption-info-from.patch
Type: text/x-patch
Size: 7933 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180712/cc1c3a82/attachment.bin>


More information about the ffmpeg-devel mailing list