VideoHelp Forum


Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!


Try StreamFab Downloader and download streaming video from Youtube, Netflix, Amazon! Download free trial.


+ Reply to Thread
Results 1 to 12 of 12
Thread
  1. Member
    Join Date
    Feb 2013
    Location
    United States
    Search Comp PM
    I'd like to convert a shell script that worked beautifully in Ubuntu (HEAPS better audio quality than Xsplit gives and I'm guessing an even smaller overhead.

    The ffmpeg settings should already be fine as they are. Unless converting to a .bat requires a restructuring it.

    Code:
    #! /bin/bash
     
    # originaly from http://tinyurl.com/twitch-linux from taladan
    # www.youtube.com/user/taladan
     
    # gist created by brodul
     
    INRES="1366x768"                                            # input resolution
    #OUTRES="1024x640"                                           # Output resolution
    OUTRES="1366x768"                                           # Output resolution
    FPS="30"                                                    # target FPS
    QUAL="fast"                                               # one of the many FFMPEG preset on (k)ubuntu found in /usr/share/ffmpeg
    # If you have low bandwidth, put the qual preset on 'fast' (upload bandwidth)
    # If you have medium bandwitch put it on normal to medium
     
    # Write your key in a file named .twitch_key in your home directory
    STREAM_KEY="live_STREAMKEYNOTPASTEDFOROBVIOUSREASONS"   # This is your streamkey generated by jtv/twitch found at: http://www.justin.tv/broadcast/adv_other
     
    ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0+0,0 -f alsa -ac 2 -i pulse -vcodec libx264 -vpre "$QUAL" -s $OUTRES -acodec libmp3lame -ar 44100 -threads 2 -qscale 5 -b 712000 -f flv "rtmp://live.justin.tv/app/$STREAM_KEY"
    The place I originally got the shell script was in this wonderful video
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    You need to adjust the screengrab, see
    https://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20grab%20the%20desktop%20(screen)%20with%20FFmpeg

    Test it first so it works.
    Quote Quote  
  3. Member
    Join Date
    Feb 2013
    Location
    United States
    Search Comp PM
    Funny. I truncated a lot of it and stopped using the variables at the top and opting for putting the stuff straight into script itself.

    Then I get the x11grab error. Promptly returned here and you already have the answer. Thanks.

    It looks like this now.
    Code:
    ffmpeg -f dshow -s "1366x768" -r "30" -i :0.0+0,0 -f alsa -ac 2 -i pulse -vcodec libx264 -vpre "fast" -s 1366x768 -acodec libmp3lame -ar 44100 -threads 2 -qscale 5 -b 712000 -f flv "rtmp://live.justin.tv/app/STREAMKEY"
    Guessing a lot of those others things are going to be deleted since I'm getting "[dshow @ 02534100] Malformed dshow input string.
    :0.0+0,0: Input/output error"
    Last edited by RabblerouserGT; 8th Feb 2013 at 14:33.
    Quote Quote  
  4. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Try change the
    -i :0.0+0,0
    to
    -i video="UScreenCapture"
    Quote Quote  
  5. Member
    Join Date
    Feb 2013
    Location
    United States
    Search Comp PM
    Now I'm getting "file for preset 'fast' not found"
    Quote Quote  
  6. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    I'm no ffmpeg expert. I usually just google the error messages. Like I found

    Presets are now used with the -preset option, so simply replace -vpre with -preset.
    Quote Quote  
  7. Member
    Join Date
    Feb 2013
    Location
    United States
    Search Comp PM
    Yeah, I did that. It's streaming, but it's only streaming a black screen now.
    Quote Quote  
  8. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Try output to a file and see if it works at all. Use
    output.flv
    instead of
    "rtmp://live.justin.tv/app/STREAMKEY"

    Play the flv with vlc.
    Quote Quote  
  9. Member
    Join Date
    Feb 2013
    Location
    United States
    Search Comp PM
    It's outputting just a big grey image.


    Code so far:
    Code:
    ffmpeg -f dshow -i video="UScreenCapture":audio="SoundMAX Digital Audio" -r "24" -ac 2 -vcodec libx264 -preset fast -s 1366x768 -acodec libmp3lame -ar 44100 -threads 2 -qscale 5 -b 712000 -f flv "output.flv"
    UScreenCapture seems to work when opening it in my Webcam testing software.
    Last edited by RabblerouserGT; 8th Feb 2013 at 15:15.
    Quote Quote  
  10. Member
    Join Date
    Feb 2013
    Location
    United States
    Search Comp PM
    I'm guessing I should head over to FFMpeg forums now that I have it at least outputting to a file/connecting to Twitch.tv.
    Quote Quote  
  11. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    I guess so. I'm out of ideas.
    Quote Quote  
  12. Member
    Join Date
    Feb 2013
    Location
    United States
    Search Comp PM
    Thanks a ton for the help. I'll do just that.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!