[FFmpeg-devel] [PATCH 1/3] avformat/mov: Increase support for common encryption.

Jacob Trimble modmaker at google.com
Wed Apr 18 19:47:17 EEST 2018


On Tue, Apr 17, 2018 at 7:11 PM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
> On Tue, Apr 03, 2018 at 04:08:51PM -0700, Jacob Trimble wrote:
>> >>
>> >> Ping again.  I know this is low priority, but I would like to get
>> >> these merged soon.
>> >
>> > Ping.  Despite being almost 2 months old, these patches still apply
>> > cleanly.  Please take a look.  These have been in review for almost 3
>> > months.
>>
>> Ping (going to keep pinging this until someone merges this or tells me
>> why not).  Day after tomorrow this will be in review for 4 months!!!
>>
>> Also noticed a bug when integrating this, so here is an updated patch.
>
>>  libavformat/isom.h                     |   14 +
>>  libavformat/mov.c                      |  396 ++++++++++++++++++++++++++-------
>>  tests/fate/mov.mak                     |    8
>>  tests/ref/fate/mov-frag-encrypted      |   57 ++++
>>  tests/ref/fate/mov-tenc-only-encrypted |   57 ++++
>>  5 files changed, 450 insertions(+), 82 deletions(-)
>> 9f1b7e04bc8001ad9faa59485090189f529cbf24  0001-avformat-mov-Increase-support-for-v7.patch
>> From 282effab6026341c49a52950cf8ba11afc9dc6aa Mon Sep 17 00:00:00 2001
>> From: Jacob Trimble <modmaker at google.com>
>> Date: Wed, 6 Dec 2017 16:17:54 -0800
>> Subject: [PATCH] avformat/mov: Increase support for common encryption.
>
> maybe iam missing something but applying this to master seems to cause
> fate to fail
>
>
> --- ./tests/ref/fate/mov-3elist-encrypted       2018-04-17 14:20:30.560366780 +0200
> +++ tests/data/fate/mov-3elist-encrypted        2018-04-18 03:53:32.872157901 +0200
> @@ -1,57 +0,0 @@
> -#format: frame checksums
> -#version: 2
> -#hash: MD5
> -#tb 0: 1/24
> -#media_type 0: video
> -#codec_id 0: rawvideo
> -#dimensions 0: 640x480
> -#sar 0: 0/1
> -#stream#, dts,        pts, duration,     size, hash
> -0,          0,          0,        1,   460800, 80fbbdec589e15e6c493b44d243f92a9
> -0,          1,          1,        1,   460800, f4b23293bb2ecf69cc3570853d8c56a1
> -0,          2,          2,        1,   460800, 0c03ce2c1c6ec405d7455465ecd559a3
> -0,          3,          3,        1,   460800, 7921791695537fba2c3c123da4834cb9
> -0,          4,          4,        1,   460800, 30c8e2903a561b84d4cbaf95c668d236
> -0,          5,          5,        1,   460800, 7ff42e998217c17592ddf6b584f26cef
> -0,          6,          6,        1,   460800, 5e402c48bf097db2d31b82bb4194a382
> -0,          7,          7,        1,   460800, 824c49e92c8ae6d99a0207b514dd756c
> -0,          8,          8,        1,   460800, 24f189216a1d9cf2313b2d6dbe3dbdd3
> -0,          9,          9,        1,   460800, 519179a8e74275d26b183374637e003f
> -0,         10,         10,        1,   460800, f18331ddcef0adf5b069bfa98baf8db4
> -0,         11,         11,        1,   460800, 081f61688690d47dbdddd5384e5d5a70
> -0,         12,         12,        1,   460800, 90dbf019b9035433371a8df41a9268b7
> -0,         13,         13,        1,   460800, bb5adfb9c66732898b34186eca1667ba
> -0,         14,         14,        1,   460800, cc08cfd64f37783ecddaf143f6ad78bc
> -0,         15,         15,        1,   460800, b8ae21d024fe4df903d56f4521993c72
> -0,         16,         16,        1,   460800, b45a99907f045dcadf0a2befc11555e3
> -0,         17,         17,        1,   460800, 603ba935845e65ab6cccbbec88bbf60d
> -0,         18,         18,        1,   460800, df80c8d3e6a77258a306903f17995a18
> -0,         19,         19,        1,   460800, 4b7e90c0a5fd0e0cd958d47f0afac636
> -0,         20,         20,        1,   460800, 9feb6e36182f1745be6387edea240eb6
> -0,         21,         21,        1,   460800, 86e6de4bd0a5ff7558f4cf6c1ec3930d
> -0,         22,         22,        1,   460800, 726b69df77edbe7b503d4698656d1320
> -0,         23,         23,        1,   460800, d282fb7a953ac205b0a43d00c2d60a33
> -0,         24,         24,        1,   460800, eece3daa70cc20208dd75d91ac84c8fd
> -0,         25,         25,        1,   460800, c86d23e73bcce351fc315fb1f13348da
> -0,         26,         26,        1,   460800, 93497b4f7c5ad9d61212239b7c9d2770
> -0,         27,         27,        1,   460800, eb217d2c12de67903835a8c58f620488
> -0,         28,         28,        1,   460800, d966480867bb54c8cd044f18388ed486
> -0,         29,         29,        1,   460800, 3ea6207942b3181fdd8e8aa6cae1062a
> -0,         30,         30,        1,   460800, 2620df54aca086ec0fb9527c6e6f5135
> -0,         31,         31,        1,   460800, 43bb7320f0bb583188dc965ddbfade90
> -0,         32,         32,        1,   460800, 0cddaa04645f804e02f65b0836412113
> -0,         33,         33,        1,   460800, 83b2dc95807289d7f4a4632bf18c2e97
> -0,         34,         34,        1,   460800, 98134d0e41e6dd12827049ccf33b4669
> -0,         35,         35,        1,   460800, 56f55631731fa39c7acbab0afeb2eb1b
> -0,         36,         36,        1,   460800, 379c1105be09d836a515dc909455ddf4
> -0,         37,         37,        1,   460800, 1df87c47e9d98731faf1c3885b77e5da
> -0,         38,         38,        1,   460800, 9a8734bcbfdb4d97e530683b8b556a26
> -0,         39,         39,        1,   460800, c7a7990d0cddc5adfbe27da7a42e025e
> -0,         40,         40,        1,   460800, 0c81e46011e03be410feaf056207fd55
> -0,         41,         41,        1,   460800, ca76e4e63016ff29d8aeeb9cb053bb6c
> -0,         42,         42,        1,   460800, cebfbe299c17c1f8fc1e6b189555c3c2
> -0,         43,         43,        1,   460800, 4f002c5feca5e75f07089e0df47507dd
> -0,         44,         44,        1,   460800, c5fd83fc4a745abee9b3d9a6eec9dd3e
> -0,         45,         45,        1,   460800, 57d9bad9b45aa2746de5d8bdc2c24969
> -0,         46,         46,        1,   460800, 9831673ad7dec167af4a959f64258949
> -0,         47,         47,        1,   460800, 77a1cb208f70f51bcb01e28d8cba73b4
> Test mov-3elist-encrypted failed. Look at tests/data/fate/mov-3elist-encrypted.err for details.
> make: *** [fate-mov-3elist-encrypted] Error 1
> TEST    mov-gpmf-remux
> --- ./tests/ref/fate/mov-frag-encrypted 2018-04-18 03:27:04.860164700 +0200
> +++ tests/data/fate/mov-frag-encrypted  2018-04-18 03:53:32.984157900 +0200
> @@ -31,27 +31,3 @@
>  0,         21,         21,        1,     9360, e96af3b6c0cc931463ca77d6be0f1148
>  0,         22,         22,        1,     9360, 04a904d798361959971361401879c7e4
>  0,         23,         23,        1,     9360, 2f119642340df6d25362b5590ded46b7
> -0,         24,         24,        1,     9360, 5993fca2e60050706f857ac76e48f386
> -0,         25,         25,        1,     9360, 2ff3b5775fed3d527bfbbeea786787fe
> -0,         26,         26,        1,     9360, 42024dbe23d3fb5b0d8987ae1ce390a8
> -0,         27,         27,        1,     9360, d804204f0bd9db5f6a758e2c934d9e38
> -0,         28,         28,        1,     9360, e322712e6e34c58ec1a2ab5e2c1e3bfe
> -0,         29,         29,        1,     9360, 3975bd1a5f6a6b6260276777f9de611e
> -0,         30,         30,        1,     9360, 4388f0412efc6310706a7cdedc859ea9
> -0,         31,         31,        1,     9360, b4b9a11b0b86635267345a569640e8d4
> -0,         32,         32,        1,     9360, 31879c7b8d6b67a4209ffde786bb8cb4
> -0,         33,         33,        1,     9360, 4b6dc02d7c889fe4abd4e013b25f585a
> -0,         34,         34,        1,     9360, dc73aae82bd39a1220d1106c8d3e8252
> -0,         35,         35,        1,     9360, 54c7dfbd49f312806f6c1a89f7c2c36f
> -0,         36,         36,        1,     9360, 150abc64f8994d444a521ea90570443c
> -0,         37,         37,        1,     9360, d277cdc7dcadbe0016f2e950459e7ebf
> -0,         38,         38,        1,     9360, 2196bf338ead90ea54687b85c73c8229
> -0,         39,         39,        1,     9360, 53ce5da5365abc0bd3217dd98e7c465d
> -0,         40,         40,        1,     9360, 34ee9832aea55c0c4e6f4381c413c10e
> -0,         41,         41,        1,     9360, 1769c7b5849e4681119067a06ac29a4f
> -0,         42,         42,        1,     9360, 71f53df739ef283a5184c91ef4b158e8
> -0,         43,         43,        1,     9360, d2d394739e9a59c06f0354c16843cb63
> -0,         44,         44,        1,     9360, d8e458e92ae29344505a24a3059fc584
> -0,         45,         45,        1,     9360, 0f1b11a09911851b798df2ef76253a7f
> -0,         46,         46,        1,     9360, 5c4a9f22baecf4e749c0d5c65a4f1007
> -0,         47,         47,        1,     9360, 3e2b7e7262fdca08d9d1ef6070125c4b
> Test mov-frag-encrypted failed. Look at tests/data/fate/mov-frag-encrypted.err for details.
> make: *** [fate-mov-frag-encrypted] Error 1
> TEST    mov-440hz-10ms
> TEST    mov-ibi-elst-starts-b
> TEST    mov-elst-ends-betn-b-and-i
> --- ./tests/ref/fate/mov-tenc-only-encrypted    2018-04-18 03:27:04.868164700 +0200
> +++ tests/data/fate/mov-tenc-only-encrypted     2018-04-18 03:53:32.932157900 +0200
> @@ -1,57 +0,0 @@
> -#format: frame checksums
> -#version: 2
> -#hash: MD5
> -#tb 0: 1/24
> -#media_type 0: video
> -#codec_id 0: rawvideo
> -#dimensions 0: 1024x436
> -#sar 0: 1/1
> -#stream#, dts,        pts, duration,     size, hash
> -0,          0,          0,        1,   669696, f48f296a85eda5ba069dc851a3228bef
> -0,          1,          1,        1,   669696, a50c5f69bfa3387d49b5bdf738e6529c
> -0,          2,          2,        1,   669696, 05061299003760f6a4795b408f72aa31
> -0,          3,          3,        1,   669696, 2572119f0b0cdd83f8a7e06252cecd3b
> -0,          4,          4,        1,   669696, 29fe6a6bdb4a69018e318886a297f07e
> -0,          5,          5,        1,   669696, e8233c7fbaecfbff965c7dfdd3982b1b
> -0,          6,          6,        1,   669696, d9259df9880ff5d4a4b38282e67f407b
> -0,          7,          7,        1,   669696, 3e8d795195038993503ea9ab6984c915
> -0,          8,          8,        1,   669696, bc4e2d253b715a34f85aae1b080e3460
> -0,          9,          9,        1,   669696, 09aba8b3a96f53f9268e7420a10bfab6
> -0,         10,         10,        1,   669696, 179447977dd580da8b35fb5310a809ca
> -0,         11,         11,        1,   669696, 7a0eea9d54577990345f5705ab9882be
> -0,         12,         12,        1,   669696, 5bb96eb76f461825740e5938456df759
> -0,         13,         13,        1,   669696, bd4ac4a760ead774b9422a27dc071964
> -0,         14,         14,        1,   669696, 1cc05f760a9b751fc89e77f2bcc97259
> -0,         15,         15,        1,   669696, 825d0dee6f0174ba7102892c7de30b4d
> -0,         16,         16,        1,   669696, d26a2ef5267f6bb03c4e1d8514eee0df
> -0,         17,         17,        1,   669696, c916ffdeadca76596a8f7fd47914b5ef
> -0,         18,         18,        1,   669696, 6e085acfa7fee0658ea0ae6188274c17
> -0,         19,         19,        1,   669696, 1e95fa5b3561283f05bf0bd44cb91721
> -0,         20,         20,        1,   669696, 37e3d135aba9dfb8b87e441753115374
> -0,         21,         21,        1,   669696, 9c398310e8564491de624393c16265ce
> -0,         22,         22,        1,   669696, c87209e4d2617bc2ab40a75f455f09da
> -0,         23,         23,        1,   669696, 2679c2f8d1d1af21982e245945c1ee60
> -0,         24,         24,        1,   669696, 6151ab4781f31c5beb66b356ad547122
> -0,         25,         25,        1,   669696, f7ef6293bfb3a6a329061cb6a5ed5a38
> -0,         26,         26,        1,   669696, 2f6e666d14dfc407ca0c0f347b13eb08
> -0,         27,         27,        1,   669696, 3454fa1730d79b1aa8dbbc865dc150f4
> -0,         28,         28,        1,   669696, e93dc683e2453419a0419ab9af0f8f95
> -0,         29,         29,        1,   669696, 031eb3154f7f83cf86d42bee66be9cf7
> -0,         30,         30,        1,   669696, 1205c36723e88811206c68892d3aaed6
> -0,         31,         31,        1,   669696, 7dd7a8a19dcd73b31ddc6a6d0c597a42
> -0,         32,         32,        1,   669696, 7c91115368ea2531262a1197468bc3f4
> -0,         33,         33,        1,   669696, 3cf6d9ba385e0fff76da33299ed5380c
> -0,         34,         34,        1,   669696, 859fc8c3ef049e3c1175a85fb0a90a3d
> -0,         35,         35,        1,   669696, 1d09ce6c7027103d99a4d5799f6e72ab
> -0,         36,         36,        1,   669696, 3dcb8357408ac88abd734128d8f5dd6f
> -0,         37,         37,        1,   669696, 4dafce137a0a5178f6efaec878e64d36
> -0,         38,         38,        1,   669696, 44c478f29a1399ed03275a7357f57d48
> -0,         39,         39,        1,   669696, 6e9edaac7414c0e14591ac3d4d0b1ac4
> -0,         40,         40,        1,   669696, 522e4aaeea0825da27f631a9e690d654
> -0,         41,         41,        1,   669696, 85f2502a718440834c40051d30f8a65e
> -0,         42,         42,        1,   669696, ae8816f7bd4645ef1a17ee6d09b4c8d2
> -0,         43,         43,        1,   669696, 914b006fa92f1eb3e590245749f6810d
> -0,         44,         44,        1,   669696, 9406901542e94c429dff46108782ed69
> -0,         45,         45,        1,   669696, 324c13641c39eef5c476023e358c0391
> -0,         46,         46,        1,   669696, 4058e886e17c22e4eb9da1dd0d6ad891
> -0,         47,         47,        1,   669696, 9edf9cd15eea985b42fd1f5035b1d693
> Test mov-tenc-only-encrypted failed. Look at tests/data/fate/mov-tenc-only-encrypted.err for details.
> make: *** [fate-mov-tenc-only-encrypted] Error 1
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> While the State exists there can be no freedom; when there is freedom there
> will be no State. -- Vladimir Lenin
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

I changed the byte order of the scheme in the previous update but
forgot to update it in the decrypt call.  I also updated the comment
in the struct to indicate the byte order.

Also, since it may have been forgotten, this adds two files that need
to be uploaded to fate:

https://storage.googleapis.com/shaka-demo-assets/_bugs/ffmpeg-fate-files/mov-frag-encrypted.mp4
https://storage.googleapis.com/shaka-demo-assets/_bugs/ffmpeg-fate-files/mov-tenc-only-encrypted.mp4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-mov-Increase-support-for-v8.patch
Type: text/x-patch
Size: 32243 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180418/2c1a3a7d/attachment.bin>


More information about the ffmpeg-devel mailing list