-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoFormatHandler.py
More file actions
35 lines (34 loc) · 931 Bytes
/
VideoFormatHandler.py
File metadata and controls
35 lines (34 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class VideoFormatHandler:
video_file_formats = [
"mp4",
"webm",
"avi",
"mov",
"wmv",
"mkv",
"flv",
]
@staticmethod
def get_codec(output_format):
if output_format == "mp4":
return "libx264"
elif output_format == "webm":
return "libvpx"
elif output_format == "avi":
return "mpeg4"
elif output_format == "mov":
return "libx264"
elif output_format == "wmv":
return "wmv2"
elif output_format == "mkv":
return "libx264"
elif output_format == "flv":
return "flv"
elif output_format == "mpeg":
return "mpeg2video"
elif output_format == "3gp":
return "libx264"
elif output_format == "hevc":
return "libx265"
else:
return None # Unsupported format