Skip to content

Instantly share code, notes, and snippets.

@tsunghanlin
Forked from vielhuber/script.sh
Created October 6, 2022 16:01
Show Gist options
  • Save tsunghanlin/0af5eab9dc6fef5e0be0a7688549cb73 to your computer and use it in GitHub Desktop.
Save tsunghanlin/0af5eab9dc6fef5e0be0a7688549cb73 to your computer and use it in GitHub Desktop.
ffmpeg: Video convert m2ts to mp4, mp4 to webm, mp4 to ogv #tools
MP4 TO MP4 (MEDIUM)
ffmpeg -i input.mp4 -b 1000000 output.mp4
M2TS TO MP4
ffmpeg -i input.m2ts -vcodec libx264 -crf 20 -acodec ac3 -vf "yadif" output.mp4
MP4 TO WEBM (HIGH)
ffmpeg -i input.mp4 -aq 5 -ac 2 -qmax 25 -threads 2 output.webm
ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 30 -b:v 0 -b:a 128k -c:a libopus output.webm
MP4 TO WEBM (MEDIUM)
ffmpeg -i input.mp4 -aq 5 -ac 2 -qmax 35 -threads 2 output.webm
MP4 TO OGV (HIGH)
ffmpeg -i input.mp4 -vcodec libtheora -acodec libvorbis -q:v 6 -q:a 5 output.ogv
MP4 TO OGV (MEDIUM)
ffmpeg -i input.mp4 -vcodec libtheora -acodec libvorbis -q:v 2 -q:a 4 output.ogv
@tsunghanlin
Copy link
Author

epgstation:
$ time ffmpeg -y -fix_sub_duration -i source.m2ts -map 0:v -c:v libx264 -vf yadif -map 0:a -c:a aac -map 0:s? -c:s mov_text -preset veryfast -crf 26 output.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment