Fix issue with transcoding old MJPEG-movies.

This commit is contained in:
Joachim Tingvold 2015-07-07 14:33:16 +02:00
parent 0e258a46dc
commit 05475b6ed0

View File

@ -468,8 +468,20 @@ class Photo(object):
if len(filters): if len(filters):
transcode_cmd.append('-vf') transcode_cmd.append('-vf')
transcode_cmd.append(','.join(filters)) transcode_cmd.append(','.join(filters))
tmp_transcode_cmd = transcode_cmd[:]
transcode_cmd.append(transcode_path) transcode_cmd.append(transcode_path)
p = VideoTranscodeWrapper().call(*transcode_cmd) p = VideoTranscodeWrapper().call(*transcode_cmd)
if p == False:
# add another option, try transcoding again
# done to avoid this error;
# x264 [error]: baseline profile doesn't support 4:2:2
message("transcoding failure, trying yuv420p", os.path.basename(original_path))
tmp_transcode_cmd.append('-pix_fmt')
tmp_transcode_cmd.append('yuv420p')
tmp_transcode_cmd.append(transcode_path)
p = VideoTranscodeWrapper().call(*tmp_transcode_cmd)
if p == False: if p == False:
message("transcoding failure", os.path.basename(original_path)) message("transcoding failure", os.path.basename(original_path))
try: try: