Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- streaming() {
- INRES="640x480" # input resolution
- OUTRES="640x480"
- FPS="30" # target FPS
- QUAL="fast" # one of the many FFMPEG preset
- #STREAM_KEY="$1"
- STREAM_KEY="live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
- #URL="rtmp://live.justin.tv/app/$STREAM_KEY" #flashver=FMLE/3.0\20(compatible;\20FMSc/1.0)"
- URL="rtmp://live.twitch.tv/app/$STREAM_KEY" #flashver=FMLE/3.0\20(compatible;\20FMSc/1.0)"
- ffmpeg -f v4l2 -s "$INRES" -r "$FPS" -i /dev/video0 \
- -f alsa -ac 2 -i hw:2 -vcodec libx264 -crf 30 -preset "$QUAL" -s "640x480" \
- -acodec libmp3lame -ab 128k -ar 44100 -threads 0 \
- -f flv "$URL"
- }
Advertisement
Add Comment
Please, Sign In to add comment