some browsers / devices only support yuv420p
This commit is contained in:
parent
56fa0986be
commit
57a0c3a032
|
@ -202,10 +202,16 @@ class Content(models.Model):
|
|||
video_path = self.photo.image.path.replace('.gif', '.mp4')
|
||||
image_path = self.photo.image.path.replace('.gif', '.jpg')
|
||||
if not os.path.exists(video_path):
|
||||
height = self.photo.image.height
|
||||
if height % 2:
|
||||
height += 1
|
||||
cmd = [
|
||||
'ffmpeg',
|
||||
'-hide_banner', '-nostats', '-loglevel', 'error',
|
||||
'-i', self.photo.image.path, video_path
|
||||
'-i', self.photo.image.path,
|
||||
'-vf', 'scale=-2:%s' % height,
|
||||
'-pix_fmt', 'yuv420p',
|
||||
video_path
|
||||
]
|
||||
subprocess.call(cmd)
|
||||
if not os.path.exists(image_path):
|
||||
|
|
Loading…
Reference in New Issue
Block a user