Giter VIP home page Giter VIP logo

Comments (3)

Noxalus avatar Noxalus commented on May 23, 2024

Hello,

If you also use FFMpeg to encode your stream to Twitch (like in the default configuration of this project), you can specify the keyframe using some additional paramaters:

-x264-params keyint=60:no-scenecut=1

The value of keyint should be the max keyframe you want * FPS. So for a max keyinterval of 2 and with a stream locked to 30 FPS, the value of keyint will be 2 * 30 = 60.

(source)

Same thing to use a constant bitrate, you need to use a new parameter:

-x264opts bitrate=3500:vbv-maxrate=3500:vbv-bufsize=116

  • vbv-maxrate = bitrate = B = target bitrate
  • vbv-bufsize = B / fps (in this video's case that's 30 fps)

(source)

At the end, you should have something like that in your Nginx configuration file:

exec ffmpeg -i rtmp://localhost/$app/$name -c:v libx264 -preset veryfast -c:a copy 
    -b:v 3500k 
    -bufsize 3500k
    -maxrate 3500k 
    -s 1280x720 -r 30
    -x264-params keyint=60:no-scenecut=1:bitrate=3500:vbv-maxrate=3500:vbv-bufsize=116
    -f flv rtmp://localhost/twitch/$name;

I didn't test the solutions here and I'm not an expert of FFMpeg. I advise you to look at the FFMpeg official documentation if you still have some problems with your stream encoding.

Let me know if it works as expected ;)

from multi-streaming-server.

dwbstreet avatar dwbstreet commented on May 23, 2024

Thanks so much. After updating the config the twitch account showed excellent at first connection. After I refreshed the page, this changed to acceptable and listed the same issues (CBR not constant, Keyframe 8). I don't understand..

from multi-streaming-server.

dwbstreet avatar dwbstreet commented on May 23, 2024

Here is a screenshot of the twitch video statistics directly:
image
I have both my original feed from OBS and the Vagrant config set to 30fps, not 60. I noticed that today, as well.

from multi-streaming-server.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.