From: Carl Hetherington Date: Thu, 31 Oct 2019 16:26:20 +0000 (+0100) Subject: Add python script to summarise some film metadata. X-Git-Tag: v2.15.29~15 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=2983479f9e579e8d6ec6cb33226efd7a0f97ec2a;p=dcpomatic.git Add python script to summarise some film metadata. --- diff --git a/hacks/filmsum b/hacks/filmsum new file mode 100755 index 000000000..dae0699d1 --- /dev/null +++ b/hacks/filmsum @@ -0,0 +1,71 @@ +#!/usr/bin/python3 + +import sys +import bs4 +import termcolor + +inside = False +xml = '' +for l in sys.stdin.readlines(): + if l.startswith(''): + inside = True + elif l.startswith(' 235000000) +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) +reel_types = ['single', 'by-video', 'by-length'] +note('Reel type', reel_types[int(soup.ReelType.text)]) +for c in soup.Metadata.Playlist.children: + if isinstance(c, bs4.element.Tag): + print() + note(' Type', c.Type.text) + note(' Position', dcp_time(c.Position)) + note(' Video rate', c.VideoFrameRate.text) + note(' Video length', content_time_from_frames(c.VideoLength, float(c.VideoFrameRate.text))) + note(' Audio rate', c.AudioFrameRate.text) + bool_note(' Reference video', c.ReferenceVideo, lambda x: not x) + bool_note(' Reference audio', c.ReferenceAudio, lambda x: not x) + bool_note(' Reference subtitle', c.ReferenceSubtitle, lambda x: not x)