-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdv-to-mp3.py
More file actions
32 lines (24 loc) · 741 Bytes
/
dv-to-mp3.py
File metadata and controls
32 lines (24 loc) · 741 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
import subprocess
import os
def convert_dvr_to_mp4(input_file, output_file):
try:
command = [
"ffmpeg",
"-i", input_file,
"-vcodec", "libx264",
"-acodec", "aac",
output_file
]
subprocess.run(command, check=True)
print("Conversion completed:", output_file)
except subprocess.CalledProcessError:
print("Error during conversion")
def main():
input_file = input("Enter DVR file path: ")
if not os.path.exists(input_file):
print("File not found")
return
output_file = os.path.splitext(input_file)[0] + ".mp4"
convert_dvr_to_mp4(input_file, output_file)
if __name__ == "__main__":
main()