Skip to content

Instantly share code, notes, and snippets.

@leon-anavi
Last active September 9, 2024 18:59
Show Gist options
  • Save leon-anavi/04ed8b2dd0f3cf5a07fbbc111641af05 to your computer and use it in GitHub Desktop.
Save leon-anavi/04ed8b2dd0f3cf5a07fbbc111641af05 to your computer and use it in GitHub Desktop.
ffmpeg extract
  • Extract audio from movie:
ffmpeg -i test.MP4 -ac 2 -f wav test.wav
  • Improve audio
  • Replace the audio in the movie:
ffmpeg -i test.MP4 -i test-fixed.wav -acodec copy -vcodec copy -map 0:v:0 -map 1:a:0 test.mov
  • Convert mp4 to mov for QT:
ffmpeg -i rpi5-setup.mp4 -c:v libx264 -pix_fmt yuv420p -profile:v high -level 4.1 -c:a aac -b:a 160k -movflags +faststart output.mov
  • Convert webm to MP4:
ffmpeg -i  input.webm -c:v libx264 -preset slow -crf 22 -c:a aac -b:a 128k output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment