summaryrefslogtreecommitdiff
path: root/hacks
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-12-06 00:24:22 +0000
committerCarl Hetherington <cth@carlh.net>2018-12-06 00:24:22 +0000
commit97ae56d7f801172a4ef72fa81c0e5fcf7c013034 (patch)
treea98c98d63abde84aeb8de0359a5558ba3089528a /hacks
parent527a2613dd6854becc8ba9bc82f9b9e7d3fee623 (diff)
Tweak to make_dummy_files.
Diffstat (limited to 'hacks')
-rwxr-xr-xhacks/make_dummy_files9
1 files changed, 5 insertions, 4 deletions
diff --git a/hacks/make_dummy_files b/hacks/make_dummy_files
index f506b2545..009ae864a 100755
--- a/hacks/make_dummy_files
+++ b/hacks/make_dummy_files
@@ -78,10 +78,11 @@ for c in tree.getroot().find('Playlist').findall('Content'):
audio_length = int(c.find('AudioLength').text)
os.system('sox -n -r %d -c %d %s trim 0.0 %f' % (audio_frame_rate, channels, path, float(audio_length) / audio_frame_rate))
elif type == 'FFmpeg':
- 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 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=48000 -shortest "%s"' % (float(video_length) / video_frame_rate, video_frame_rate, path))
+ if c.find('VideoFrameRate') is not None:
+ 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 -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)