Log in

View Full Version : Recommend me settings for WEB streaming


DoomNlNE
25th August 2013, 17:07
Hi,
I want to host and stream my own videos at 60 FPS.

Which settings should I use for web streaming, using x264?

My typical source material:

Type: Video game
Video codec: CamStudio lossless
FPS: 60
Resolution: 320x240 (SD) | 1280x720 (HD) [some games are SD, some are HD]

Please help me encode so that:

1. The quality is high (better than YouTube) - I think YT's 720p bit rate is 2-3mbps
2. The file size is as small as possible - does this mean I should use placebo preset?
3. The user doesn't download too much of the video too quickly (wastes bandwidth) - which vbv settings?


(I'll be using the native HTML 5 capability in Wordpress for streaming.)

So, I will need settings for my SD and HD resolutions! :)

sneaker_ger
25th August 2013, 17:20
1. Just experiment with the bitrate a bit until you're happy - it is a very subjective question.
2. Placebo is called "placebo" because it is usually considered a waste of time. In the end, just pick the slowest preset whose speed you're still willing to accept.
3. --vbv-maxrate should usually be the connection speed of your user (don't forget some head room for audio, container and tolerance)
--vbv-bufsize sets the size of the buffer. If you set it to 3x your maxrate (putting units aside) the user will need to buffer up to 3 seconds for example.
You cannot use these to control how much of the video your users can pre-load - you have to solve that problem in your server software.

Maybe you should also experiment with lower frame rates.

Blue_MiSfit
25th August 2013, 23:21
I'm assuming this is all offline?

In any case, are you going to encode a single stream, or multiple streams with adaptive switching? The latter (via HLS or similar) usually gives a much better user experience, but needs to be encoded specially (i.e. gop-aligned fragmented MPEG-TS files). It also requires player support, and I know nothing about HTML5 players. I do know that flash players like JWPlayer can handle HLS. A cursory search reveals that HTML5 should have no issues with HLS.

Set --vbv-maxrate to connection speed minus audio, container overhead, and some fudge factor. Set --vbv-bufsize to n*maxrate, where n is the number of seconds you want people to buffer. Make this as high as you can stand, as it will help quality to a point (by absorbing things like big I frames). At least a second is great, 2-3 seconds is better. There's not much benefit beyond 5 seconds. Set --bitrate either to the same rate as maxrate (CBR), or set a CRF value. Both are perfectly valid approaches, though CRF may give you the advantage of smaller bitrates in low complexity scenes.

If you do multi bitrate, then you should ramp from 720p60 at 6 Mbps or so down to 240p30 at 512 Kbps or so. If it's a single bitrate, then use as much as you can afford, and really - do multi bitrate if you can :)

Use the slowest preset you can tolerate. In practice, the defaults are extremely good, and you quickly hit diminishing returns going slower. I wouldn't go faster than --preset faster, since you start to lose a lot of cool stuff at that point.