[Resolved] 3.0.0-a5: Lack of ffmpeg quality control.

Developers forum for Univeral Media Server-related development (only for programmers)
Locked
Casper
Posts: 32
Joined: Wed Jul 24, 2013 10:20 pm

[Resolved] 3.0.0-a5: Lack of ffmpeg quality control.

Post by Casper »

Changing the Transcoding Quality (MPEG2) in the UI is not changing the ffmpeg (FFmepg Web Video) quality parameter which is always -q:v 3. This utilizes about 30Mbps which is too much for my wireless connection.

I have resorted to using MaxVideoBitrateMbps in the renderer conf file to reduce network usage which replaces -q:v 3 with -maxrate. Strangely changing the maxrate value has no effect, it seems to be limited to only ~7Mbps despite setting the value to 100Mbps which is reflected in the debug log as -maxrate 100000000.

Is there a way to have custom options for ffmpeg like mencoder? I know of the ffmpeg.webfilters file but that is only for specific URLs.
infidel
Developer
Posts: 571
Joined: Thu Jul 12, 2012 5:37 am

Re: 3.0.0-a5: Lack of ffmpeg quality control.

Post by infidel »

Casper wrote: Is there a way to have custom options for ffmpeg like mencoder? I know of the ffmpeg.webfilters file but that is only for specific URLs.
  • I haven't actually tried it, but there's a CustomFFmpegOptions setting defined for renderer confs.
  • You can also use a "specific" rule to match everything in ffmpeg.webfilters

    Code: Select all

    .* | -q:v ...
Casper
Posts: 32
Joined: Wed Jul 24, 2013 10:20 pm

Re: 3.0.0-a5: Lack of ffmpeg quality control.

Post by Casper »

Thanks for the tip. CustomFFmpegOptions works, the custom options are reflected in the debug log and despite the -q option already existing, the custom one appended after overrides it.

The 'q' option (aka 'qscale') controls variable bitrate quality with value between 1-31, with 1 being the highest quality and 31 the lowest. I reduced it from 3 to 8 and the stuttering has mostly gone.

Code: Select all

CustomFFmpegOptions=-q:v 8
ExSport
Posts: 595
Joined: Wed Oct 10, 2012 1:57 am

Re: 3.0.0-a5: Lack of ffmpeg quality control.

Post by ExSport »

Your custom settings was added so it overridden original one? Or original -q:v <number> was replaced by your custom setting?
For MEncoder engine what I remember custom settings rewrites default value so setting is present once. Same should be also for FFMPEG so same settings is not doubled which can make conflicts for some settings.
What is behavior right now? Thx
Casper
Posts: 32
Joined: Wed Jul 24, 2013 10:20 pm

Re: 3.0.0-a5: Lack of ffmpeg quality control.

Post by Casper »

ExSport wrote:Your custom settings was added so it overridden original one?
Yes, in the case of the -q option it is overriding the original value. For example the following has very low quality as you would expect with a value of 31.

Code: Select all

-threads 6 -c:a ac3 -c:v mpeg2video -f vob -q:v 3 -q:a 3 -q:v 31
But like you say, other options may behave differently, existing options should be substituted rather than duplicated.
User avatar
SubJunk
Lead Developer
Posts: 3707
Joined: Sun May 27, 2012 4:12 pm

Re: 3.0.0-a5: Lack of ffmpeg quality control.

Post by SubJunk »

Thanks for reporting this, Casper. The FFmpeg Web Video engine was not paying attention to the quality settings, although the FFmpeg Video engine was. The fix should be in the next release.
Casper
Posts: 32
Joined: Wed Jul 24, 2013 10:20 pm

Re: 3.0.0-a5: Lack of ffmpeg quality control.

Post by Casper »

Now that the the quality settings work perfectly in 3.0.0-b1 I strongly recommend users not to mess with CustomFFmpegOptions.
Locked