return probe
Browse files
app.py
CHANGED
@@ -10,31 +10,32 @@ def get_media_info(file_path):
|
|
10 |
"""
|
11 |
try:
|
12 |
probe = ffmpeg.probe(file_path)
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
38 |
|
39 |
except Exception as e:
|
40 |
return {'error': str(e)}
|
|
|
10 |
"""
|
11 |
try:
|
12 |
probe = ffmpeg.probe(file_path)
|
13 |
+
return probe
|
14 |
+
# video_stream = next((stream for stream in probe['streams'] if stream['codec_type'] == 'video'), None)
|
15 |
+
# audio_stream = next((stream for stream in probe['streams'] if stream['codec_type'] == 'audio'), None)
|
16 |
+
|
17 |
+
# if video_stream:
|
18 |
+
# width = int(video_stream['width'])
|
19 |
+
# height = int(video_stream['height'])
|
20 |
+
# frame_rate = video_stream['avg_frame_rate']
|
21 |
+
# frame_count = int(video_stream['nb_frames'])
|
22 |
+
# else:
|
23 |
+
# width, height, frame_rate, frame_count = None, None, None, None
|
24 |
+
|
25 |
+
# if audio_stream:
|
26 |
+
# sample_rate = int(audio_stream['sample_rate'])
|
27 |
+
# channels = int(audio_stream['channels'])
|
28 |
+
# else:
|
29 |
+
# sample_rate, channels = None, None
|
30 |
+
|
31 |
+
# return {
|
32 |
+
# 'width': width,
|
33 |
+
# 'height': height,
|
34 |
+
# 'frame_rate': frame_rate,
|
35 |
+
# 'frame_count': frame_count,
|
36 |
+
# 'sample_rate': sample_rate,
|
37 |
+
# 'channels': channels,
|
38 |
+
# }
|
39 |
|
40 |
except Exception as e:
|
41 |
return {'error': str(e)}
|