{"assets":[],"author_link":"author\/raptor85\/","author_name":"Raptor85","cat":"LD #23","categories":["LD #23"],"comments":[],"epoch":1334320920,"event":"LD23","likes":8,"metadata":{"p_key":"76758","p_author":"Raptor85","p_authorkey":"0","p_urlkey":"284594","p_title":"Broadcasting to twitch.tv using ffmpeg","p_cat":"LD #23","p_event":"LD23","p_time":"1334320920","p_likes":"8","p_comments":"0","p_status":"WAYBACK","us_key":null,"us_name":null,"us_username":null,"event_start":"1334880000","event_key":"10","event_name":"LD23"},"source_url":"2012\/04\/13\/broadcasting-to-twitch-tv-using-ffmpeg\/","text":"<p>There wasn\u2019t a whole lot of information about it around but I managed to piece together a quick script to do live streaming from a linux desktop.\u00a0 It\u2019s simple and for speed reasons I\u2019m not broadcasting sound myself. (I get unrealiable levels of upload lag so if i add sound it\u2019s kinda distorted\u2026I really wish their streams allowed speex codec :\/)<\/p>\n<div class=\"stb-grey_box\" id=\"stb-box-8274\">#!\/bin\/bash\n<p>SIZE=\u201d1600\u00d71200\u2033<br\/>\nBITRATE=\u201d128k\u201d<br\/>\nFRAMERATE=\u201d20\u2033<br\/>\nKEY=\u201dyour key here\u201d<\/p>\n<p>ffmpeg -f x11grab -s $SIZE -r $FRAMERATE -i :0.0 -vb $BITRATE -vcodec libx264 -threads 0 -f flv \u201crtmp:\/\/live.justin.tv\/app\/$KEY\u201d<\/p><\/div>\n<p>if you do want sound, you can change it to this for alsa<\/p>\n<div class=\"stb-grey_box\" id=\"stb-box-7688\">ffmpeg -f x11grab -s $SIZE -r $FRAMERATE -i :0.0 -f alsa -ac 2 -i hw:0,0 -vb $BITRATE -vcodec libx264 -threads 0 -acodec libmp3lame -ab 128k -ar 22050 -f flv \u201crtmp:\/\/live.justin.tv\/app\/$KEY\u201d<\/div>\n<p>or for OSS<\/p>\n<div class=\"stb-grey_box\" id=\"stb-box-9818\">ffmpeg -f x11grab -s $SIZE -r $FRAMERATE -i :0.0 -f oss -i \/dev\/dsp -vb $BITRATE -vcodec libx264 -threads 0 -acodec libmp3lame -ab 128k -ar 22050 -f flv \u201crtmp:\/\/live.justin.tv\/app\/$KEY\u201d<\/div>\n<p>Tags: <a href=\"http:\/\/www.ludumdare.com\/compo\/tag\/tips\/\" rel=\"tag\">tips<\/a><\/p> <div style=\"float: right;border: 1px solid #eee;padding: 2px;background: #fff;\"><div class=\"iLikeThis\" id=\"iLikeThis-111386\"><span class=\"counter\"><a class=\"image\" onclick=\"likeThis(111386);\">8<\/a><\/span><\/div><\/div>\n<p class=\"postmetadata alt\">\n<small>\n\t\t\t\t\t\tThis entry was posted\n\t\t\t\t\t\t\t\t\t\t\t\ton Friday, April 13th, 2012 at 12:42 pm\t\t\t\t\t\tand is filed under <a href=\"http:\/\/www.ludumdare.com\/compo\/category\/ld-23\/\" rel=\"category tag\" title=\"View all posts in LD #23\">LD #23<\/a>.\n\t\t\t\t\t\tYou can follow any responses to this entry through the <a href=\"http:\/\/www.ludumdare.com\/compo\/2012\/04\/13\/broadcasting-to-twitch-tv-using-ffmpeg\/feed\/\">RSS 2.0<\/a> feed.\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tYou can <a href=\"#respond\">leave a response<\/a>, or <a href=\"http:\/\/www.ludumdare.com\/compo\/2012\/04\/13\/broadcasting-to-twitch-tv-using-ffmpeg\/trackback\/\" rel=\"trackback\">trackback<\/a> from your own site.\n\n\t\t\t\t\t\t\n\t\t\t\t\t<\/small>\n<\/p>","time":"April 13th, 2012 12:42 pm","title":"Broadcasting to twitch.tv using ffmpeg"}