This forum is closed. Please visit help.twitch.tv for assistance. (Read More)

Stream Settings Difficulties

Hi,

I'm streaming StarCraft II on Linux using ffmpeg (Intel corei7 920 CPU). I'm trying to find the appropriate knobs to turn for the x264 encoder to get decent quality with only 500 kbps upload to spare for the purpose.

I'm currently using these options:

-strict experimental -vcodec libx264 -threads 4 -profile:v main -preset:v fast -tune:v zerolatency -x264opts crf=25:bitrate=500:fps=15
-acodec aac -ar 22050 -ab 32k -vol 1365
-f flv "rtmp://live.justin.tv/app/$STREAMING_KEY"

The `-tune:v zerolatency` is a last resort measure, as I understand it, as it basically kills any opportunity to properly compress the stream. I get really low quality on the twitch.tv stream. [This also overrides some of the options I specify later, as I understand it.]

The settings [1] I've tried playing with have either (a) looked just as bad as -tune:v zerolatency or (b) caused noticeable lag in the game. Can someone give me some help getting this figured out?

Comments

  • FireFire Moderator
    What resolution are you trying to push? You're not going to push 720 or 1080 on 500k, and using zerolatency is a terrible idea.
  • I'm playing at 1900x1200.

    I'm using zerolatency because every setting I've tried messing usually gives me lag in game.
  • I think I'm pushing the same resolution. I haven't messed with that because I don't know if that would help at all. What things can I do to get the best possible quality given my constraints?
  • FireFire Moderator
    @pjdbatrick yeah you will never be able to push a resolution like that on 500kbit, the most you'd be able to do is something like... 768x432 or 848x480, maybe 1088x612 if you have a slow preset ( which will hammer your processor )
  • Okay so, like an idiot, I thought my game freezing up wasn't related to the uplink getting clogged by streaming. I lowered the bitrate to 400 (yes, DSL sucks; my options are bad). I can actually get no lag in game and the quality is decent on my stream. Still, I'd like to improve the quality if possible since I have CPU to spare:

    This is the command I'm using now:

    ffmpeg -f x11grab -s 1920x1200 -r 30 -i :0.0 \
           -f alsa -ac 2 -i pulse \
           -vcodec libx264 -threads 2 -preset ultrafast -qp 0 \
           -acodec flac \
           "${STREAMING_TITLE}${STREAMING_EXTENSION}" \
           \
           -vf scale=768:480 -vcodec libx264 -threads 4 -profile:v main -preset:v slow -x264opts bitrate=400:fps=10 \
           -acodec libmp3lame -ar 22050 -ab 32k \
           -f flv "rtmp://live.justin.tv/app/$STREAMING_KEY"

    As you can see, I took your advice and scaled down the resolution. I also lowered the FPS to 10. Do you reckon I can improve this quality:


    by messing with settings more? Or have I reached the best of what I can do given a 400 kbps uplink?

    Thanks so much for your help with this!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID