Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

general structure #229

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
fix dimension bug
  • Loading branch information
hakcats committed Apr 11, 2023
commit e9add2ff3c57d8574b8752acbf95f4cab6e04372
2 changes: 1 addition & 1 deletion app/utilities.py
Original file line number Diff line number Diff line change
@@ -203,7 +203,7 @@ def check_processess():
def video_dimension_unifier(video, uid, extension):
import cv2
video_dimensions = os.popen('ffprobe -v error -select_streams v -show_entries stream=width,height -of json {}'.format(video)).read()
video_width, video_height, _ = json.loads(video_dimensions)['streams'][0].values()
video_width, video_height, *_ = json.loads(video_dimensions)['streams'][0].values()

first_frame_path = "app/files/{}/first_frame.jpg".format(uid)
os.system('ffmpeg -i {} -y -vf "select=eq(n\,0)" -q:v 3 {}'.format(video, first_frame_path))