Changes between Version 4 and Version 5 of EncodingForStreamingSites


Ignore:
Timestamp:
Mar 10, 2016, 9:07:50 PM (3 years ago)
Author:
coral
Comment:

Twitch doesn't recommend encoding to MP3 anymore (source: i work at Twitch), while it's still supported for legacy reasons, i updated the guide to use aac now when the native encoder is in 3.0 stable. Also, Justin.TV does not exist anymore and is folded into Twitch, so i updated the hostnames of the RTMP to match.

Legend:

Unmodified
Added
Removed
Modified
  • EncodingForStreamingSites

    v4 v5  
    11= Encoding for streaming sites =
    22
    3 Such as justin.tv, twitch.tv, ustream.tv, !YouTube Live, and other RTMP(E) streaming providers. Since FFmpeg development is very active it is recommend that you follow a [[CompilationGuide|compilation guide]] to take advantage of bug fixes and new features.
     3Such as twitch.tv, ustream.tv, !YouTube Live, and other RTMP(E) streaming providers. Since FFmpeg development is very active it is recommend that you follow a [[CompilationGuide|compilation guide]] to take advantage of bug fixes and new features.
    44
    55{{{
     
    4949$ ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -framerate 30 -video_size 1280x720 \
    5050-i :0.0+0,0 -vcodec libx264 -preset veryfast -maxrate 1984k -bufsize 3968k \
    51 -vf "format=yuv420p" -g 60 -acodec libmp3lame -b:a 96k -ar 44100 \
    52 -f flv rtmp://live.justin.tv/app/<stream key>
     51-vf "format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 \
     52-f flv rtmp://live.twitch.tv/app/<stream key>
    5353}}}
    5454
     
    6060$ ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -framerate 30 -video_size 1680x1050 \
    6161-i :0.0+0,0 -vcodec libx264 -preset veryfast -maxrate 3000k -bufsize 3000k \
    62 -vf "scale=1280:-1,format=yuv420p" -g 60 -acodec libmp3lame -b:a 96k -ar 44100 \
    63 -f flv rtmp://live.justin.tv/app/<stream key>
     62-vf "scale=1280:-1,format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 \
     63-f flv rtmp://live.twitch.tv/app/<stream key>
    6464}}}
    6565
     
    7878 [bg][fg]overlay=W-w-10:10,format=yuv420p[out]"
    7979-map "[out]" -map 2:a -vcodec libx264 -preset veryfast \
    80 -maxrate 3000k -bufsize 4000k -acodec libmp3lame -ar 44100 -b:a 128k \
    81 -f flv rtmp://live.justin.tv/app/<stream key>
     80-maxrate 3000k -bufsize 4000k -c:a aac -b:a 160k -ar 44100 \
     81-f flv rtmp://live.twitch.tv/app/<stream key>
    8282}}}
    8383
     
    9999 [bg2][3:v]overlay=W-w-10:H-h-10,format=yuv420p[out]"
    100100-map "[out]" -map 2:a -vcodec libx264 -preset veryfast \
    101 -maxrate 3000k -bufsize 4000k -acodec libmp3lame -ar 44100 -b:a 128k \
    102 -f flv rtmp://live.justin.tv/app/<stream key>
     101-maxrate 3000k -bufsize 4000k -c:a aac -b:a 160k -ar 44100 -b:a 128k \
     102-f flv rtmp://live.twitch.tv/app/<stream key>
    103103}}}
    104104
     
    109109{{{
    110110$ ffmpeg -re -i input.mkv -vcodec libx264 -preset veryfast -maxrate 3000k \
    111 -bufsize 6000k -pix_fmt yuv420p -g 50 -acodec libmp3lame -b:a 128k -ac 2 \
    112 -ar 44100 -f flv rtmp://live.justin.tv/app/<stream key>
     111-bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 \
     112-ar 44100 -f flv rtmp://live.twitch.tv/app/<stream key>
    113113}}}
    114114
     
    124124Then [http://ffmpeg.org/ffmpeg.html#Stream-copy stream copy] it to the streaming service:
    125125{{{
    126 $ ffmpeg -re -i file.flv -codec copy -f flv rtmp://live.justin.tv/app/<stream key>
     126$ ffmpeg -re -i file.flv -codec copy -f flv rtmp://live.twitch.tv/app/<stream key>
    127127}}}
    128128