Home | Rules and Guide | Sign In/Create Account | Write a Post | Reddit | #ludumdare on irc.afternet.org (Info)

Ludum Dare 26 — April 26th-29th Weekend — Theme: Minimalism

  • Judging Ends: in 2 days, 2 hours, 9 minutes, 18 seconds
  • Play and Rate Games | View All Games | Edit | View My Entry
    Twitter | #ludumdare on irc.afternet.org

    [ Warmup Weekend | Real World Gatherings | Tools | Ludum Deals (yep, we got it) ]


    Broadcasting to twitch.tv using ffmpeg

    Posted by
    April 13th, 2012 12:42 pm

    There wasn’t 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.  It’s simple and for speed reasons I’m not broadcasting sound myself. (I get unrealiable levels of upload lag so if i add sound it’s kinda distorted…I really wish their streams allowed speex codec :/)

    #!/bin/bash

    SIZE=”1600×1200″
    BITRATE=”128k”
    FRAMERATE=”20″
    KEY=”your key here”

    ffmpeg -f x11grab -s $SIZE -r $FRAMERATE -i :0.0 -vb $BITRATE -vcodec libx264 -threads 0 -f flv “rtmp://live.justin.tv/app/$KEY”

    if you do want sound, you can change it to this for alsa

    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 “rtmp://live.justin.tv/app/$KEY”

    or for OSS

    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 “rtmp://live.justin.tv/app/$KEY”

    Tags:

    Leave a Reply

    You must be logged in to post a comment.


    All posts, images, and comments are owned by their creators.

    [cache: storing page]