- os.system('ffmpeg -t %d %s %s -shortest "%s"' % (float(video_length) / video_frame_rate, video_cmd, audio_cmd, path))
+ if c.find('VideoFrameRate') is not None:
+ video_frame_rate = float(c.find('VideoFrameRate').text)
+ video_length = int(c.find('VideoLength').text)
+ video_cmd = '-s qcif -f rawvideo -pix_fmt rgb24 -r %f -i /dev/zero' % video_frame_rate
+ os.system('ffmpeg -t %f %s %s -shortest "%s"' % (video_length / video_frame_rate, video_cmd, audio_cmd, path))
+ else:
+ os.system('sox -n -r %d -c %d %s trim 0.0 %f' % (audio_frame_rate, audio_channels, path, float(audio_length) / audio_frame_rate))