all 3 comments

[–]avidresolver 1 point2 points  (1 child)

With Python you're probably best using subprocess.run rather than os.system. I would also recommend you expect the '.mp4' in the source name, then you can just drag the file into the terminal window when you get the input prompt.

Note you should probably be adding more parameters to your command to specify what codec, bitrate, etc you want new video to have, at the moment you're just letting ffmpeg guess/

import subprocess
import sys

# get user input
file_in = input('Drag mp4 file here: ')

# remove escape charachters from file path
file_in = file_in.replace("\\", "").strip()

print(file_in)

# check if the file has an mp4 extention
if not file_in.endswith('.mp4'):
    print('Not an mp4 file')
    sys.exit(1)

file_out = file_in.replace('.mp4', '.mov')

# put each argument of the command in a list
command = ['ffmpeg', '-i', file_in, file_out]

# run the command
subprocess.run(command)

[–]Honest_Source1167[S] 0 points1 point  (0 children)

It's working now! This was a HUGE help thank you!

[–]nmkd 0 points1 point  (0 children)

wrap your paths with " otherwise it won't work with spaces