From: Gyan Doshi <ffmpeg@gyani.pro> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH] avformat/dashdec: accept and relay CENC decryption key Date: Sat, 14 May 2022 14:47:56 +0530 Message-ID: <20220514091756.6255-1-ffmpeg@gyani.pro> (raw) Allows to process CENC-encrypted media segments. Option arg syntax is same as that for option decryption_key in MOV demuxer --- doc/demuxers.texi | 11 +++++++++++ libavformat/dashdec.c | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 238b8e03a8..c95a9ae594 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -274,6 +274,17 @@ which streams to actually receive. Each stream mirrors the @code{id} and @code{bandwidth} properties from the @code{<Representation>} as metadata keys named "id" and "variant_bitrate" respectively. +@subsection Options + +This demuxer accepts the following option: + +@table @option + +@item cenc_decryption_key +16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). + +@end table + @section imf Interoperable Master Format demuxer. diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 0b5ff5aeb9..0f66251354 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -150,6 +150,7 @@ typedef struct DASHContext { char *allowed_extensions; AVDictionary *avio_opts; int max_url_size; + char *cenc_decryption_key; /* Flags for init section*/ int is_init_section_common_video; @@ -1893,6 +1894,9 @@ static int reopen_demux_for_component(AVFormatContext *s, struct representation pls->ctx->pb = &pls->pb.pub; pls->ctx->io_open = nested_io_open; + if (c->cenc_decryption_key) + av_dict_set(&in_fmt_opts, "decryption_key", c->cenc_decryption_key, AV_OPT_FLAG_DECODING_PARAM); + // provide additional information from mpd if available ret = avformat_open_input(&pls->ctx, "", in_fmt, &in_fmt_opts); //pls->init_section->url av_dict_free(&in_fmt_opts); @@ -2344,6 +2348,7 @@ static const AVOption dash_options[] = { OFFSET(allowed_extensions), AV_OPT_TYPE_STRING, {.str = "aac,m4a,m4s,m4v,mov,mp4,webm,ts"}, INT_MIN, INT_MAX, FLAGS}, + { "cenc_decryption_key", "Media decryption key (hex)", OFFSET(cenc_decryption_key), AV_OPT_TYPE_STRING, {.str = NULL}, INT_MIN, INT_MAX, .flags = FLAGS }, {NULL} }; -- 2.36.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next reply other threads:[~2022-05-14 9:18 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-14 9:17 Gyan Doshi [this message] 2022-05-14 10:38 ` Steven Liu 2022-05-14 10:59 ` Gyan Doshi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220514091756.6255-1-ffmpeg@gyani.pro \ --to=ffmpeg@gyani.pro \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git