mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-01-05 21:59:00 +01:00
Vp9 fixes (#438)
* Fix fo ffprobe appending pipe * Fix media remains pending when only encoding to webm
This commit is contained in:
parent
0f182c2b15
commit
3e7b106482
@ -443,7 +443,8 @@ def media_file_info(input_file):
|
||||
input_file,
|
||||
]
|
||||
stdout = run_command(cmd).get("out")
|
||||
stream_size = sum([int(line) for line in stdout.split("\n") if line != ""])
|
||||
# ffprobe appends a pipe at the end of the output, thus we have to remove it
|
||||
stream_size = sum([int(line.replace("|", "")) for line in stdout.split("\n") if line != ""])
|
||||
audio_bitrate = round((stream_size * 8 / 1024.0) / audio_duration, 2)
|
||||
|
||||
ret.update(
|
||||
|
@ -637,15 +637,16 @@ class Media(models.Model):
|
||||
|
||||
def set_encoding_status(self):
|
||||
"""Set encoding_status for videos
|
||||
Set success if at least one mp4 exists
|
||||
Set success if at least one mp4 or webm exists
|
||||
"""
|
||||
mp4_statuses = set(encoding.status for encoding in self.encodings.filter(profile__extension="mp4", chunk=False))
|
||||
webm_statuses = set(encoding.status for encoding in self.encodings.filter(profile__extension="webm", chunk=False))
|
||||
|
||||
if not mp4_statuses:
|
||||
if not mp4_statuses and not webm_statuses:
|
||||
encoding_status = "pending"
|
||||
elif "success" in mp4_statuses:
|
||||
elif "success" in mp4_statuses or "success" in webm_statuses:
|
||||
encoding_status = "success"
|
||||
elif "running" in mp4_statuses:
|
||||
elif "running" in mp4_statuses or "running" in webm_statuses:
|
||||
encoding_status = "running"
|
||||
else:
|
||||
encoding_status = "fail"
|
||||
|
Loading…
Reference in New Issue
Block a user