summaryrefslogtreecommitdiffstats
path: root/dom/media/test/bipbop-cenc.sh
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/media/test/bipbop-cenc.sh
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/media/test/bipbop-cenc.sh')
-rwxr-xr-xdom/media/test/bipbop-cenc.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/dom/media/test/bipbop-cenc.sh b/dom/media/test/bipbop-cenc.sh
new file mode 100755
index 000000000..a00c38ae8
--- /dev/null
+++ b/dom/media/test/bipbop-cenc.sh
@@ -0,0 +1,29 @@
+mkdir work.tmp
+
+for r in 225w_175kbps 300_215kbps 300wp_227kbps 360w_253kbps 480_624kbps 480wp_663kbps 480_959kbps 480wp_1001kbps
+do
+ for k in 1 2
+ do
+ # Encrypt bipbop_<res>.mp4 with the keys specified in this file,
+ # and output to |bipbop_<res>-cenc-{video,audio}.mp4|
+ MP4Box -crypt bipbop-cenc-audio-key${k}.xml -rem 1 -out work.tmp/bipbop_${r}-cenc-audio-key${k}.mp4 bipbop_${r}.mp4
+ MP4Box -crypt bipbop-cenc-video-key${k}.xml -rem 2 -out work.tmp/bipbop_${r}-cenc-video-key${k}.mp4 bipbop_${r}.mp4
+
+ # Fragment |bipbop_<res>-cenc-*.mp4| into 500ms segments:
+ MP4Box -dash 500 -rap -segment-name work.tmp/bipbop_${r}-cenc-audio-key${k}- -subsegs-per-sidx 5 work.tmp/bipbop_${r}-cenc-audio-key${k}.mp4
+ MP4Box -dash 500 -rap -segment-name work.tmp/bipbop_${r}-cenc-video-key${k}- -subsegs-per-sidx 5 work.tmp/bipbop_${r}-cenc-video-key${k}.mp4
+
+ # The above command will generate a set of fragments |bipbop_<res>-cenc-{video,audio}-*.m4s
+ # and |bipbop_<res>-cenc-{video,audio}-init.mp4| containing just the init segment.
+
+ # Remove unneeded mpd files.
+ rm bipbop_${r}-cenc-{audio,video}-key${k}_dash.mpd
+ done
+done
+
+# Only keep the first 4 audio & 2 video segments:
+cp work.tmp/*-init[.]mp4 ./
+cp work.tmp/*audio*-[1234][.]m4s ./
+cp work.tmp/*video*-[12][.]m4s ./
+
+rm -Rf work.tmp