Skip to content

Instantly share code, notes, and snippets.

@syntaxhacker
Last active October 11, 2021 16:17
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 syntaxhacker/ed4e93c69d1ff3bce4df153327b20b16 to your computer and use it in GitHub Desktop.
Save syntaxhacker/ed4e93c69d1ff3bce4df153327b20b16 to your computer and use it in GitHub Desktop.
youtube ffmpeg
VBR="2500k"
FPS="30"
QUAL="veryfast"
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
SOURCE="/tmp/Aot.mkv"
KEY=""
ffmpeg \
-stream_loop -1 -i "$SOURCE" -deinterlace \
-vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
-acodec libmp3lame -ar 44100 -threads 4 -qscale 3 -b:a 712000 -bufsize 512k \
-f flv "$YOUTUBE_URL/$KEY"
https://superuser.com/questions/624563/how-to-resize-a-video-to-make-it-smaller-with-ffmpeg
//capture desktop video
#!/bin/bash
ffmpeg -video_size 1920x1080 -framerate 60 -f x11grab -i :0.0 -f pulse -ac 2 -i default -c:v libx264 -pix_fmt yuv420p -c:a ac3 -ab 320k $HOME/`date +%H%M%d%m%Y`_output.mp4
//capture desktop video (no audio)
#!/bin/bash
ffmpeg -video_size 1920x1080 -framerate 60 -f x11grab -i :0.0 -c:v libx264 -pix_fmt yuv420p $HOME/`date +%H%M%d%m%Y`_output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment