Skip to content

Instantly share code, notes, and snippets.

@vietdien2005
Last active October 7, 2017 10:07
Show Gist options
  • Save vietdien2005/93e4720ce12cdb0310454f1e887b1c49 to your computer and use it in GitHub Desktop.
Save vietdien2005/93e4720ce12cdb0310454f1e887b1c49 to your computer and use it in GitHub Desktop.
streaming with ffmpeg
VBR="2500k"
FPS="30"
QUAL="veryfast"
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
SOURCE="http://125.212.211.162:8080/live/super-sunday.m3u8"
SOURCEFB="https://video-hkg3-1.xx.fbcdn.net/hvideo-atn2/v/dash-md/267360413666075-854021.m4a"
KEY="agyz-6wy0-k429-8gqu"
#ffmpeg \
# -i "$SOURCE" -deinterlace \
# -vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
# -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k \
# -f flv "$YOUTUBE_URL/$KEY"
#ffmpeg \
# -i "$SOURCE" -deinterlace \
# -framerate 30 -video_size 1280x720 \
# -vcodec libx264 -preset veryfast -maxrate 1984k -bufsize 3968k \
# -g 60 -c:a aac -b:a 128k -ar 44100 \
# -f flv "$YOUTUBE_URL/$KEY"
ffmpeg \
-i "$SOURCEFB" -deinterlace -video_size 1280x720 \
-vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
-acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 128k -bufsize 3968k -maxrate 1984k \
-f flv "$YOUTUBE_URL/$KEY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment