Created
September 16, 2022 12:12
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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