[FFmpeg-devel] Support seek in encrypted MP4

Michael Niedermayer michael at niedermayer.cc
Wed Mar 16 02:55:34 CET 2016


On Tue, Mar 15, 2016 at 10:57:02PM +0000, Eran Kornblau wrote:
> > > > 
> > > > check tests/fate/seek.mak
> > > > also you can pass parameters to seek-test see fate-seek-cache-pipe
> > > > i dont know if there is anything else special needed for this
> > > >
> > > Thanks Michael, I looked at this some more, and there's one thing that I'm still
> > > missing - where do I get the sample encrypted file from ?
> > > 
> > > As I understand, I can either:
> > > 1. Generate one on the machine running the tests - in this case, where do I write 
> > > the ffmpeg command line for doing that ?
> > 
> > see for example: fate-filter-hls
> > 
> > 
> > > 2. Upload a sample, that will later be pulled by 'make fate-rsync' - in this option, 
> > > what is the process for submitting such samples ?
> > 
> > you can just add a url to the file, i can add it to the fate samples
> > but in that case the file should be small as thousands of samples
> > add up ...
> >
> 
> Patch attached, I went with option #1 (generate the test files with ffmpeg)
> 
> Thanks
> 
> Eran

>  fate/seek.mak        |   24 +++++++++++++++++++++++
>  ref/seek/enc-mp4-aac |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  ref/seek/enc-mp4-avc |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 130 insertions(+)
> d90a14503a4835a36c78f32f3efa78916f94a296  0001-add-seek-tests-for-encrypted-mp4.patch
> From 5dab98182ac6e64d62cd873b5cbc0dd50a7007ca Mon Sep 17 00:00:00 2001
> From: erankor <eran.kornblau at kaltura.com>
> Date: Wed, 16 Mar 2016 00:45:07 +0200
> Subject: [PATCH] add seek tests for encrypted mp4
> 
> one for aac (sample encryption), one for avc (subsample encryption)
> ---
>  tests/fate/seek.mak        | 24 +++++++++++++++++++++
>  tests/ref/seek/enc-mp4-aac | 53 ++++++++++++++++++++++++++++++++++++++++++++++
>  tests/ref/seek/enc-mp4-avc | 53 ++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 130 insertions(+)
>  create mode 100644 tests/ref/seek/enc-mp4-aac
>  create mode 100644 tests/ref/seek/enc-mp4-avc

the aac test fails on x86-32 (passes on 64bit)
does it use floating point aac ? if so that wont be binary identical
between platforms

also
> +tests/data/enc-avc.mp4: TAG = GEN
> +tests/data/enc-avc.mp4: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
> +       $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
> +        -f rawvideo -pix_fmt rgb24 -t 10 -r 30 -s 320x240 -i /dev/zero -f mov -flags +bitexact -codec:v libx264 \

libx264 is not guranteed to be available and if available 2 versions
of it could generate different output


make: *** [tests/data/enc-avc.mp4] Error 1
make: *** Waiting for unfinished jobs....
 libavformat/seek-test ffmpeg/tests/data/enc-aac.mp4 -decryption_key 12345678901234567890123456789012
--- ffmpeg/tests/ref/seek/enc-mp4-aac  2016-03-16 02:20:25.725653079 +0100
+++ tests/data/fate/seek-enc-mp4-aac    2016-03-16 02:41:07.557679241 +0100
@@ -2,52 +2,52 @@
 ret: 0         st:-1 flags:0  ts:-1.000000
 ret: 0         st: 0 flags:1 dts:-0.023220 pts:-0.023220 pos:     36 size:   286
 ret: 0         st:-1 flags:1  ts: 1.894167
-ret: 0         st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos:  16769 size:   224
+ret: 0         st: 0 flags:1 dts: 1.880816 pts: 1.880816 pos:  16742 size:   223
 ret: 0         st: 0 flags:0  ts: 0.788345
-ret: 0         st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos:   7196 size:   206
+ret: 0         st: 0 flags:1 dts: 0.789478 pts: 0.789478 pos:   7117 size:   204
 ret: 0         st: 0 flags:1  ts:-0.317506
 ret: 0         st: 0 flags:1 dts:-0.023220 pts:-0.023220 pos:     36 size:   286
 ret: 0         st:-1 flags:0  ts: 2.576668
-ret: 0         st: 0 flags:1 dts: 2.577415 pts: 2.577415 pos:  22827 size:   203
+ret: 0         st: 0 flags:1 dts: 2.577415 pts: 2.577415 pos:  22740 size:   202
 ret: 0         st:-1 flags:1  ts: 1.470835
-ret: 0         st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos:  13234 size:   224
+ret: 0         st: 0 flags:1 dts: 1.462857 pts: 1.462857 pos:  13195 size:   224
 ret: 0         st: 0 flags:0  ts: 0.365011
-ret: 0         st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos:   3489 size:   246
+ret: 0         st: 0 flags:1 dts: 0.371519 pts: 0.371519 pos:   3499 size:   205
 ret: 0         st: 0 flags:1  ts:-0.740839
 ret: 0         st: 0 flags:1 dts:-0.023220 pts:-0.023220 pos:     36 size:   286
 ret: 0         st:-1 flags:0  ts: 2.153336
-ret: 0         st: 0 flags:1 dts: 2.159456 pts: 2.159456 pos:  19192 size:   194
+ret: 0         st: 0 flags:1 dts: 2.159456 pts: 2.159456 pos:  19151 size:   198
 ret: 0         st:-1 flags:1  ts: 1.047503
-ret: 0         st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos:   9465 size:   212
+ret: 0         st: 0 flags:1 dts: 1.044898 pts: 1.044898 pos:   9446 size:   204
 ret: 0         st: 0 flags:0  ts:-0.058322
 ret: 0         st: 0 flags:1 dts:-0.023220 pts:-0.023220 pos:     36 size:   286
 ret: 0         st: 0 flags:1  ts: 2.835828
-ret: 0         st: 0 flags:1 dts: 2.832834 pts: 2.832834 pos:  24949 size:   203
+ret: 0         st: 0 flags:1 dts: 2.832834 pts: 2.832834 pos:  24889 size:   201
 ret: 0         st:-1 flags:0  ts: 1.730004
-ret: 0         st: 0 flags:1 dts: 1.741497 pts: 1.741497 pos:  15617 size:   155
+ret: 0         st: 0 flags:1 dts: 1.741497 pts: 1.741497 pos:  15568 size:   181
 ret: 0         st:-1 flags:1  ts: 0.624171
-ret: 0         st: 0 flags:1 dts: 0.603719 pts: 0.603719 pos:   5548 size:   216
+ret: 0         st: 0 flags:1 dts: 0.603719 pts: 0.603719 pos:   5534 size:   215
 ret: 0         st: 0 flags:0  ts:-0.481655
 ret: 0         st: 0 flags:1 dts:-0.023220 pts:-0.023220 pos:     36 size:   286
 ret: 0         st: 0 flags:1  ts: 2.412494
-ret: 0         st: 0 flags:1 dts: 2.391655 pts: 2.391655 pos:  21199 size:   209
+ret: 0         st: 0 flags:1 dts: 2.391655 pts: 2.391655 pos:  21120 size:   203
 ret: 0         st:-1 flags:0  ts: 1.306672
-ret: 0         st: 0 flags:1 dts: 1.323537 pts: 1.323537 pos:  11886 size:   205
+ret: 0         st: 0 flags:1 dts: 1.323537 pts: 1.323537 pos:  11832 size:   224
 ret: 0         st:-1 flags:1  ts: 0.200839
-ret: 0         st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos:   1881 size:   214
+ret: 0         st: 0 flags:1 dts: 0.185760 pts: 0.185760 pos:   1871 size:   218
 ret: 0         st: 0 flags:0  ts:-0.904989
 ret: 0         st: 0 flags:1 dts:-0.023220 pts:-0.023220 pos:     36 size:   286
 ret: 0         st: 0 flags:1  ts: 1.989184
-ret: 0         st: 0 flags:1 dts: 1.973696 pts: 1.973696 pos:  17566 size:   198
+ret: 0         st: 0 flags:1 dts: 1.973696 pts: 1.973696 pos:  17519 size:   202
 ret: 0         st:-1 flags:0  ts: 0.883340
-ret: 0         st: 0 flags:1 dts: 0.905578 pts: 0.905578 pos:   8206 size:   195
+ret: 0         st: 0 flags:1 dts: 0.905578 pts: 0.905578 pos:   8160 size:   202
 ret: 0         st:-1 flags:1  ts:-0.222493
 ret: 0         st: 0 flags:1 dts:-0.023220 pts:-0.023220 pos:     36 size:   286
 ret: 0         st: 0 flags:0  ts: 2.671678
-ret: 0         st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos:  23786 size:   183
+ret: 0         st: 0 flags:1 dts: 2.693515 pts: 2.693515 pos:  23715 size:   185
 ret: 0         st: 0 flags:1  ts: 1.565850
-ret: 0         st: 0 flags:1 dts: 1.555737 pts: 1.555737 pos:  14095 size:   215
+ret: 0         st: 0 flags:1 dts: 1.555737 pts: 1.555737 pos:  14062 size:   220
 ret: 0         st:-1 flags:0  ts: 0.460008
-ret: 0         st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos:   4311 size:   203
+ret: 0         st: 0 flags:1 dts: 0.464399 pts: 0.464399 pos:   4309 size:   170
 ret: 0         st:-1 flags:1  ts:-0.645825
 ret: 0         st: 0 flags:1 dts:-0.023220 pts:-0.023220 pos:     36 size:   286
Test seek-enc-mp4-aac failed. Look at tests/data/fate/seek-enc-mp4-aac.err for details.
make: *** [fate-seek-enc-mp4-aac] Error 1



[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160316/e17a3ba6/attachment.sig>


More information about the ffmpeg-devel mailing list