Aevann 2024-04-06 14:02:41 +02:00
parent 628b3dc3b5
commit c7841d437a
1 changed files with 6 additions and 3 deletions

View File

@ -168,9 +168,12 @@ def process_video(file, v):
new = f'{old}.mp4'
try:
video_info = ffmpeg.probe(old)['streams'][0]
codec = video_info['codec_name']
bitrate = int(video_info.get('bit_rate', 3000000))
video_info = ffmpeg.probe(old)['streams']
for stream in video_info:
if stream["codec_type"] == "video":
codec = stream['codec_name']
bitrate = int(stream.get('bit_rate', 3000000))
break
except:
os.remove(old)
abort(400, "Something went wrong processing your video on our end. Please try uploading it to https://pomf2.lain.la and post the link instead.")