Skip to content

Instantly share code, notes, and snippets.

@designeng
Forked from blacklee/ffmpeg-to-480p.sh
Created February 24, 2023 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save designeng/5834cb772be65e70d937f58f843e6e43 to your computer and use it in GitHub Desktop.
Save designeng/5834cb772be65e70d937f58f843e6e43 to your computer and use it in GitHub Desktop.
ffmpeg convert video to 480p
ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4
@designeng
Copy link
Author

ffmpeg -i "https://videofile.mp4" -c:v libx264 -preset fast -crf 18 downloadedfile.mp4

This will download videofile.mp4 and will use a fast encoding to compression speed, so the file will be quiet large but it will encode it quickly. A slow -preset will take longer but compress the file better.

@designeng
Copy link
Author

ffmpeg -re -i YOURVIDEO.mp4 -c:v libx264 -b:v 2M -c:a copy -strict -2 -flags +global_header -bsf:a aac_adtstoasc -bufsize 2100k -f flv rtmp://a.rtmp.youtube.com/live2/YOUTUBESTREAMKEY

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