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,17 +468,29 @@ 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: if p == False:
message("transcoding failure", os.path.basename(original_path)) # add another option, try transcoding again
try: # done to avoid this error;
os.unlink(transcode_path) # x264 [error]: baseline profile doesn't support 4:2:2
except: message("transcoding failure, trying yuv420p", os.path.basename(original_path))
pass tmp_transcode_cmd.append('-pix_fmt')
self.is_valid = False tmp_transcode_cmd.append('yuv420p')
return tmp_transcode_cmd.append(transcode_path)
self._video_metadata(transcode_path, False) p = VideoTranscodeWrapper().call(*tmp_transcode_cmd)
if p == False:
message("transcoding failure", os.path.basename(original_path))
try:
os.unlink(transcode_path)
except:
pass
self.is_valid = False
return
self._video_metadata(transcode_path, False)
@property @property
def name(self): def name(self):