diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-07-17 17:47:28 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-07-17 17:47:28 +0100 |
| commit | b6718fb437f242fd5127194d4c94e39d71c5e1ad (patch) | |
| tree | e6c0fb61d5252bb72969cdeaa752875bb06e14e3 /test | |
| parent | 1c22ef308a1d62b4c6935ede8233b1fea082b0ca (diff) | |
Some comments; fix up a UUID I think.
Diffstat (limited to 'test')
| -rw-r--r-- | test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml | 30 | ||||
| -rw-r--r-- | test/ref/DCP/ASSETMAP.xml | 12 | ||||
| -rw-r--r-- | test/ref/DCP/audio.mxf | bin | 305326 -> 305326 bytes | |||
| -rw-r--r-- | test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml | 39 | ||||
| -rw-r--r-- | test/ref/DCP/video.mxf | bin | 26080 -> 26080 bytes | |||
| -rwxr-xr-x | test/ref/make.py | 45 |
6 files changed, 44 insertions, 82 deletions
diff --git a/test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml b/test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml deleted file mode 100644 index 0e62ce07..00000000 --- a/test/ref/DCP/8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL"> - <Id>urn:uuid:8e293965-f8ad-48c6-971d-261b01f65cdb</Id> - <AnnotationText>A Test DCP</AnnotationText> - <IssueDate>2012-07-17T04:45:18+00:00</IssueDate> - <Issuer>OpenDCP 0.0.25</Issuer> - <Creator>OpenDCP 0.0.25</Creator> - <AssetList> - <Asset> - <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id> - <AnnotationText>video.mxf</AnnotationText> - <Hash>E2vhyxdJQhEzSQZdp31w84ZZpfk=</Hash> - <Size>26080</Size> - <Type>application/mxf</Type> - </Asset> - <Asset> - <Id>urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7</Id> - <AnnotationText>audio.mxf</AnnotationText> - <Hash>9OVODrw+zTkSbkGduoQ30k3Kk6Y=</Hash> - <Size>305326</Size> - <Type>application/mxf</Type> - </Asset> - <Asset> - <Id>urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb</Id> - <Hash>5E8Q9swcc2bBbFF3IEPNXfIP8gM=</Hash> - <Size>1526</Size> - <Type>text/xml</Type> - </Asset> - </AssetList> -</PackingList> diff --git a/test/ref/DCP/ASSETMAP.xml b/test/ref/DCP/ASSETMAP.xml index edb62bda..b0168478 100644 --- a/test/ref/DCP/ASSETMAP.xml +++ b/test/ref/DCP/ASSETMAP.xml @@ -1,17 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"> - <Id>urn:uuid:18be072e-5a0f-44e1-b2eb-c8a52ae12789</Id> + <Id>urn:uuid:b135d5cf-d180-43d8-b0b3-7373737b73bf</Id> <Creator>OpenDCP 0.0.25</Creator> <VolumeCount>1</VolumeCount> <IssueDate>2012-07-17T04:45:18+00:00</IssueDate> <Issuer>OpenDCP 0.0.25</Issuer> <AssetList> <Asset> - <Id>urn:uuid:8e293965-f8ad-48c6-971d-261b01f65cdb</Id> + <Id>urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb</Id> <PackingList>true</PackingList> <ChunkList> <Chunk> - <Path>8e293965-f8ad-48c6-971d-261b01f65cdb_pkl.xml</Path> + <Path>df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_pkl.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> <Length>1049</Length> @@ -19,10 +19,10 @@ </ChunkList> </Asset> <Asset> - <Id>urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb</Id> + <Id>urn:uuid:9892e944-5046-4dbb-af7c-f50742f62fc2</Id> <ChunkList> <Chunk> - <Path>df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml</Path> + <Path>9892e944-5046-4dbb-af7c-f50742f62fc2_cpl.xml</Path> <VolumeIndex>1</VolumeIndex> <Offset>0</Offset> <Length>1526</Length> @@ -41,7 +41,7 @@ </ChunkList> </Asset> <Asset> - <Id>urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7</Id> + <Id>urn:uuid:67b9341e-cadd-4dac-9d5c-f5a1d59f2d06</Id> <ChunkList> <Chunk> <Path>audio.mxf</Path> diff --git a/test/ref/DCP/audio.mxf b/test/ref/DCP/audio.mxf Binary files differindex 8910b6fb..52f92d21 100644 --- a/test/ref/DCP/audio.mxf +++ b/test/ref/DCP/audio.mxf diff --git a/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml b/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml deleted file mode 100644 index bb8775fd..00000000 --- a/test/ref/DCP/df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_cpl.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<CompositionPlaylist xmlns="http://www.smpte-ra.org/schemas/429-7/2006/CPL"> - <Id>urn:uuid:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb</Id> - <AnnotationText>A Test DCP</AnnotationText> - <IssueDate>2012-07-17T04:45:18+00:00</IssueDate> - <Creator>OpenDCP 0.0.25</Creator> - <ContentTitleText>A Test DCP</ContentTitleText> - <ContentKind>feature</ContentKind> - <ContentVersion> - <Id>urn:uri:df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_2012-07-17T04:45:18+00:00</Id> - <LabelText>df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb_2012-07-17T04:45:18+00:00</LabelText> - </ContentVersion> - <RatingList/> - <ReelList> - <Reel> - <Id>urn:uuid:b135d5cf-d180-43d8-b0b3-7373737b73bf</Id> - <AssetList> - <MainPicture> - <Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id> - <AnnotationText>video.mxf</AnnotationText> - <EditRate>24 1</EditRate> - <IntrinsicDuration>24</IntrinsicDuration> - <EntryPoint>0</EntryPoint> - <Duration>24</Duration> - <FrameRate>24 1</FrameRate> - <ScreenAspectRatio>32 32</ScreenAspectRatio> - </MainPicture> - <MainSound> - <Id>urn:uuid:c38bdd62-ce03-4988-8603-195f134207c7</Id> - <AnnotationText>audio.mxf</AnnotationText> - <EditRate>24 1</EditRate> - <IntrinsicDuration>24</IntrinsicDuration> - <EntryPoint>0</EntryPoint> - <Duration>24</Duration> - </MainSound> - </AssetList> - </Reel> - </ReelList> -</CompositionPlaylist> diff --git a/test/ref/DCP/video.mxf b/test/ref/DCP/video.mxf Binary files differindex 645fb85a..70040fc3 100644 --- a/test/ref/DCP/video.mxf +++ b/test/ref/DCP/video.mxf diff --git a/test/ref/make.py b/test/ref/make.py index 0b469e24..ac8ff155 100755 --- a/test/ref/make.py +++ b/test/ref/make.py @@ -1,23 +1,52 @@ #!/usr/bin/python +# +# This slightly ridiculous script gets OpenDCP to generate +# a DCP using out test reference data (in j2c/ and wav/) +# and then adjusts its XML output to account for the fact +# that OpenDCP will generate its own random UUIDs (and use +# current timestamps). We set UUIDs and timestamps back +# to what our test suite will expect. +# +# The output of this script is checked into git, so +# there's normally no need to run it. +# +# If you do run it, the XML should be right but the +# MXFs that OpenDCP generates will not be quite what +# we expect, as they also contain random UUIDs. I don't +# think there's an easy way round that, so after running +# this script you will need to check that the libdcp +# test code generates correct MXFs (by verification on +# a projector, probably), and then copy those MXFs into the +# test/ref/DCP directory. +# + import os import sys import fileinput from lxml import etree +# Namespaces for the various XML files assetmap_namespace = 'http://www.smpte-ra.org/schemas/429-9/2007/AM' cpl_namespace = 'http://www.smpte-ra.org/schemas/429-7/2006/CPL' pkl_namespace = 'http://www.smpte-ra.org/schemas/429-8/2007/PKL' -wanted_cpl_id = 'df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb' -wanted_pkl_id = '8e293965-f8ad-48c6-971d-261b01f65cdb' -wanted_assetmap_id = '18be072e-5a0f-44e1-b2eb-c8a52ae12789' +# The UUIDs of things that we want to put into the +# OpenDCP-generated XML +wanted_cpl_id = '9892e944-5046-4dbb-af7c-f50742f62fc2' +wanted_pkl_id = 'df0e4141-13c3-4a7a-bef8-b5a04fcbc4bb' +wanted_assetmap_id = 'b135d5cf-d180-43d8-b0b3-7373737b73bf' wanted_video_mxf_id = '81fb54df-e1bf-4647-8788-ea7ba154375b' -wanted_audio_mxf_id = 'c38bdd62-ce03-4988-8603-195f134207c7' -wanted_reel_id = 'b135d5cf-d180-43d8-b0b3-7373737b73bf' -wanted_asset_hashes = ['E2vhyxdJQhEzSQZdp31w84ZZpfk=', '9OVODrw+zTkSbkGduoQ30k3Kk6Y=', '5E8Q9swcc2bBbFF3IEPNXfIP8gM='] +wanted_audio_mxf_id = '67b9341e-cadd-4dac-9d5c-f5a1d59f2d06' +wanted_reel_id = '379fa64c-ad71-46cf-bef7-b45624006610' + +# The hashes of the assets: first is the video MXF, second the audio MXF and third the CPL. +wanted_asset_hashes = ['VB9LCTmiD9OLlw4SvrEWUm5d67Q=', 'HapNpn7MjiJLa1OHRI61Rx8N/is=', 'PbXuvpUOKccTLMxg/lEbaXvNCT4='] + +# The issue date that we want to use wanted_issue_date = '2012-07-17T04:45:18+00:00' +# Get OpenDCP to make the DCP os.system('rm -rf DCP') os.mkdir('DCP') os.system('opendcp_mxf -i j2c -o DCP/video.mxf -r 24') @@ -25,6 +54,7 @@ os.system('opendcp_mxf -i wav -o DCP/audio.mxf -r 24') os.system('opendcp_xml --reel DCP/video.mxf DCP/audio.mxf -k feature -t "A Test DCP" -a "A Test DCP"') os.system('mv *.xml DCP') +# Find what IDs it used cpl_id = None pkl_id = None assetmap_id = None @@ -39,6 +69,7 @@ for r, d, f in os.walk('DCP'): elif n.endswith('pkl.xml'): pkl_id = n[0:-8] +# (along the way, rename the CPL/PKL files) os.rename('DCP/%s_cpl.xml' % cpl_id, 'DCP/%s_cpl.xml' % wanted_cpl_id) os.rename('DCP/%s_pkl.xml' % pkl_id, 'DCP/%s_pkl.xml' % wanted_pkl_id) @@ -77,13 +108,13 @@ xml = etree.parse('DCP/%s_pkl.xml' % wanted_pkl_id) asset_list = xml.getroot().find(pkl_name('AssetList')) asset_hashes = [] -print asset_list for a in asset_list.iter(): if a.tag == "{%s}Hash" % pkl_namespace: asset_hashes.append(a.text) issue_date = xml.getroot().find(pkl_name('IssueDate')).text +# Now run through the XML files doing the replacements for r, d, f in os.walk('DCP'): for n in f: if n.endswith('.xml'): |
