Skip to content

Instantly share code, notes, and snippets.

@CathyLou
Created March 18, 2021 16:19
Show Gist options
  • Select an option

  • Save CathyLou/2c2aea808c817b87f1b7bec7d91ddf8a to your computer and use it in GitHub Desktop.

Select an option

Save CathyLou/2c2aea808c817b87f1b7bec7d91ddf8a to your computer and use it in GitHub Desktop.
import subprocess
command = 'ffmpeg -y -i {} -strict -2 {}'.format('SRC.mp4', 'SRC_VOICE.wav')
subprocess.call(command, shell=True)
save_filename = 'result.mp4'
command = 'ffmpeg -y -i {} -i {} -strict -2 -q:v 1 {}'.format('SRC_VOICE.wav', 'TARGET.mp4', save_filename)
subprocess.call(command, shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment