summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-11-01 22:39:12 +0100
committerCarl Hetherington <cth@carlh.net>2021-11-01 22:39:12 +0100
commiteb8b8cf6d9eef1d8673c4693b5750e01a9dd774a (patch)
tree0f22bba4a30f0fe3ca94d7f203807cdac1ca991a
parent6a76119a4f87da9740bd116dd14efa69567bc3d8 (diff)
Fix the filmsum script up a little.
-rwxr-xr-xhacks/filmsum9
1 files changed, 6 insertions, 3 deletions
diff --git a/hacks/filmsum b/hacks/filmsum
index bda8740c3..39393729f 100755
--- a/hacks/filmsum
+++ b/hacks/filmsum
@@ -21,7 +21,7 @@ def note(k, v, highlight=None):
print('%20s: %s' % (k, v))
def bool_note(k, v, highlight=None):
- v = 'yes' if v == 1 else 'no'
+ v = 'yes' if (v is not None and v.text == "1") else 'no'
note(k, v, highlight)
def dcp_time(s):
@@ -36,6 +36,7 @@ def dcp_time(s):
m -= h * 60
return '%s DCP_%02d:%02d:%02d.%02d' % (str(raw).ljust(8), h, m, s, f)
+
def content_time_from_frames(s, r):
raw = int(s.text)
f = raw
@@ -54,8 +55,8 @@ note('J2K bandwidth', soup.Metadata.J2KBandwidth.text, lambda x: int(x) < 200000
note('Video frame rate', soup.Metadata.VideoFrameRate.text, lambda x: int(x) not in [24, 25, 30])
dcp_rate = int(soup.Metadata.VideoFrameRate.text)
note('Audio channels', soup.Metadata.AudioChannels.text)
-bool_note('3D', soup.Metadata.ThreeD.text, lambda x: not x)
-bool_note('Encrypted', soup.Metadata.ThreeD.text, lambda x: not x)
+bool_note('3D', soup.Metadata.ThreeD, lambda x: not x)
+bool_note('Encrypted', soup.Metadata.ThreeD, lambda x: not x)
reel_types = ['single', 'by-video', 'by-length']
note('Reel type', reel_types[int(soup.ReelType.text)])
for c in soup.Metadata.Playlist.children:
@@ -63,6 +64,8 @@ for c in soup.Metadata.Playlist.children:
print()
note(' Type', c.Type.text)
note(' Position', dcp_time(c.Position))
+ note(' Trim start', c.TrimStart.text)
+ note(' Trim end', c.TrimEnd.text)
if c.VideoFrameRate:
note(' Video rate', c.VideoFrameRate.text)
note(' Video length', content_time_from_frames(c.VideoLength, float(c.VideoFrameRate.text)))