Skip to content

Instantly share code, notes, and snippets.

@ScribbleGhost
Created September 16, 2022 12:12
Show Gist options
  • Select an option

  • Save ScribbleGhost/c422a3f50a71934844a6636ab7acde52 to your computer and use it in GitHub Desktop.

Select an option

Save ScribbleGhost/c422a3f50a71934844a6636ab7acde52 to your computer and use it in GitHub Desktop.
A simple example on how you can run FFmpeg in a Python script
import subprocess
ffmpeg_options = [
'ffmpeg',
"-i", 'C:\\Users\\admin\\Desktop\\your_file.xyz',
'-c:v', 'copy',
'-c:a', 'copy',
'-y',
'out.mp4'
]
if subprocess.run(ffmpeg_options).returncode == 0:
print ("FFmpeg completed successfully")
else:
print ("FFmpeg error")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment