Skip to content

Instantly share code, notes, and snippets.

@shaposhnikoff
Created December 24, 2014 19:17
Show Gist options
  • Save shaposhnikoff/d22e7a778480f5fcd8f5 to your computer and use it in GitHub Desktop.
Save shaposhnikoff/d22e7a778480f5fcd8f5 to your computer and use it in GitHub Desktop.
#! /bin/bash -x
VBR="2500k"
FPS="30"
QUAL="medium"
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
SOURCE="rtsp://xxx.xxx.xxx:554/Streaming/Channels/1"
KEY="xxxxxxxxxxxxxxxx.xxx-xxx-qms4-emuc"
#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" -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv "$YOUTUBE_URL/$KEY"
#ffmpeg -i "$SOURCE" -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -preset $QUAL -r $FPS -vcodec copy -acodec aac -b:v $VBR -ab 128k -g 50 -strict experimental -f flv "$YOUTUBE_URL/$K
EY"
@arnauldb
Copy link

Hello,

thank you for this script.
My video on youtube is a little choppy/jerky and if I look at the terminal from where I launched your script I have these messages:

frame=111934 fps=7.0 q=-1.0 size= 866944kB time=04:24:49.83 bitrate= 447.0kbitsframe=111937 fps=7.0 q=-1.0 size= 867002kB time=04:24:50.51 bitrate= 447.0kbits[rtsp @ 0x5624b5e39e80] max delay reached. need to consume packet
[rtsp @ 0x5624b5e39e80] RTP: missed 450 packets
[rtsp @ 0x5624b5e39e80] max delay reached. need to consume packet
[rtsp @ 0x5624b5e39e80] RTP: missed 76 packets

Any idea why ?

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