Jump to content

Transcoding limiting bitrate and reducing quality


paul777

Recommended Posts

paul777

Hi, I've just noticed that we set ffmpeg -preset superfast and -maxrate to be no higher than the source or the requested max bit rate. This is probably over limiting and affecting quality where higher bitrate streams are allowed. The reason is that the superfast preset will give the same quality as the other presets but do it faster at the expense of a larger file size. The videos most people have in their collection will probably have been done with a slower preset to save disk space as encoding speed was not an issue when they were created. Consequently if we transcode with superfast it is reasonable to expect the bitrate to increase - maybe double (based of some tests someone did here http://ubuntuforums.org/showthread.php?t=2094655). We should probably only limit the bitrate based on videobitrate in the request rather than the source video, or at least allow twice the source bitrate. I have tested it with a 1920x1080 video and the quality difference was quite noticeable on a big screen, change I made was a simple one in BaseStreamingService.GetVideoBitrateParamValue.

 

Link to comment
Share on other sites

with superfast yes that's inevitable, but i don't really want to intentionally increase btirate, at least not right now. then users who have their setting at 30mbps go and play a 2mbps file and the server will end up returning a much larger stream than necessary. we can play with bumping up to veryfast if the cpu hit isn't so bad.

  • Like 1
Link to comment
Share on other sites

paul777

I wouldn't expect a 2mbps stream to grow to more than about 4mbps with superfast even if the maxrate was set to 30mbps - it is a max rather than a target. Although allowing no more than double would make sure we didn't massively expand a stream that started out life as a very low quality over compressed stream but would allow for the growth we would expect in order to maintain the quality of a high quality stream. This page has another benchmark of the different presets with conversion speeds http://blogs.motokado.com/yoshi/2011/06/25/comparison-of-x264-presets/ superfast does seem to offer the best compromise between speed and size we just need to allow for that extra bit of size.

Of course where people have very powerful servers they may well want to push the preset to veryfast, especially if they are using wifi, or streaming externally over broadband but I think that would be a separate option. My i7 certainly struggles to run the veryfast preset for 1920x1080 content -it can just about handle a single stream.

Link to comment
Share on other sites

  • 1 year later...
roberto188

I wouldn't expect a 2mbps stream to grow to more than about 4mbps with superfast even if the maxrate was set to 30mbps - it is a max rather than a target. Although allowing no more than double would make sure we didn't massively expand a stream that started out life as a very low quality over compressed stream but would allow for the growth we would expect in order to maintain the quality of a high quality stream. This page has another benchmark of the different presets with conversion speeds http://blogs.motokado.com/yoshi/2011/06/25/comparison-of-x264-presets/ superfast does seem to offer the best compromise between speed and size we just need to allow for that extra bit of size.

Of course where people have very powerful servers they may well want to push the preset to veryfast, especially if they are using wifi, or streaming externally over broadband but I think that would be a separate option. My i7 certainly struggles to run the veryfast preset for 1920x1080 content -it can just about handle a single stream.

 

I find it hard to believe your i7 struggles with 1 stream on the veryfast preset. I have used plex with the veryfast preset at 1080p and can encode 3 streams simultaneously. It pegs out my i5 2500 but it does it without causing the clients to buffer. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...