summaryrefslogtreecommitdiff
path: root/hacks/make_dummy_files
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-07 01:20:21 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-07 01:20:21 +0100
commitf0a5b013d52d4d36f4b2c758d53c3e132d7a705f (patch)
tree1f7eb5dc7c438840796140b57f2d2b2b52f9a81b /hacks/make_dummy_files
parent576b7e8eee6c17a5a7f0f4c3bfb1787768f4f276 (diff)
Add an audio stream to ffmpeg files and support <Image> in hacks/make_dummy_files.
Diffstat (limited to 'hacks/make_dummy_files')
-rwxr-xr-xhacks/make_dummy_files12
1 files changed, 11 insertions, 1 deletions
diff --git a/hacks/make_dummy_files b/hacks/make_dummy_files
index 6428348a4..f506b2545 100755
--- a/hacks/make_dummy_files
+++ b/hacks/make_dummy_files
@@ -13,6 +13,11 @@ if len(sys.argv) < 2:
tree = ET.parse(os.path.join(sys.argv[1], 'metadata.xml'))
+try:
+ os.makedirs(os.path.join(sys.argv[1], 'dummy'))
+except:
+ pass
+
for c in tree.getroot().find('Playlist').findall('Content'):
type = c.find('Type').text
if type == 'DCP':
@@ -76,6 +81,11 @@ for c in tree.getroot().find('Playlist').findall('Content'):
video_frame_rate = int(c.find('VideoFrameRate').text)
video_length = int(c.find('VideoLength').text)
path = os.path.join(sys.argv[1], 'dummy', ntpath.basename(c.find('Path').text))
- os.system('ffmpeg -t %d -s qcif -f rawvideo -pix_fmt rgb24 -r %d -i /dev/zero %s' % (float(video_length) / video_frame_rate, video_frame_rate, path))
+ os.system('ffmpeg -t %d -s qcif -f rawvideo -pix_fmt rgb24 -r %d -i /dev/zero -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=48000 -shortest "%s"' % (float(video_length) / video_frame_rate, video_frame_rate, path))
+ elif type == 'Image':
+ width = int(c.find('VideoWidth').text)
+ height = int(c.find('VideoHeight').text)
+ path = os.path.join(sys.argv[1], 'dummy', ntpath.basename(c.find('Path').text))
+ os.system('convert -size %dx%d xc:black "%s"' % (width, height, path))
else:
print 'Skipped %s' % type