FAQ  •  Register  •  Login

HD Video Quality setting

<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Mon Nov 15, 2010 7:58 pm

HD Video Quality setting

Hi,

I would like to propose to use the video quality options available in ffmpeg.
Some player can not handle such super-high-quality HD videos and therefore stutter.
I'am not an expert in ffmpeg but -qmin -qmax could be a good start to improve playback quality.

thx
<<

Ryster

User avatar

Streaming enthusiast

Posts: 49

Joined: Fri Nov 12, 2010 8:47 pm

Post Mon Nov 15, 2010 8:34 pm

Re: HD Video Quality setting

I second this request. I'd like these settings linkable to each device type though, so it would auto-switch quality setting depending which device was streaming.

Perhaps each time a device connects to Serviio, it's registered on the server. You can then allocate device specific settings to that device, including the quality level.
Serviio Pro Purchaser - 24/07/2012
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Nov 15, 2010 10:34 pm

Re: HD Video Quality setting

you can limit max bitrate on the transcoding element in profiles.xml. This will obviously not affect files that you stream natively.
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Tue Nov 16, 2010 6:50 am

Re: HD Video Quality setting

For testing purposes I tried the following:

<Video targetContainer="mpegts" targetVCodec="mpeg2video" targetACodec="ac3" maxVBitrate="2000">
<Matches container="asf" />
<Matches container="avi" />
<Matches container="mp4" />
<Matches container="matroska" />
<Matches container="mpegvideo" />
<Matches container="mpegts" />
<Matches container="mpeg" />
</Video>

Unfort. ffmpeg is not called, there is no debug log about this - it seems that serviio is not re-encoding regardless of what I configure here. My file is already AVC ... am I doing anything wrong?

thx
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Tue Nov 16, 2010 6:52 am

Re: HD Video Quality setting

I also check the transcoding-temp-9-MPEG2TS.stf ... it still has ~8000 Kbps.

thx
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Tue Nov 16, 2010 8:08 am

Re: HD Video Quality setting

tombert wrote:Unfort. ffmpeg is not called, there is no debug log about this - it seems that serviio is not re-encoding regardless of what I configure here. My file is already AVC ... am I doing anything wrong?...

Are you sure serviio select your modified profile? you could force profile selection on console.
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Nov 16, 2010 9:07 am

Re: HD Video Quality setting

also it might just do remuxing in which case the bitrate is not changed (the stream is just copied)
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Tue Nov 16, 2010 3:04 pm

Re: HD Video Quality setting

Yes it's doing remuxing only ... I restarted serviio in order to be completely sure and deleted the temp file. The profile is automatic but there is only one Bravia and I see in the log which profile is selected ... so it's ok.
Also the log file shows an ffmpeg copy statement only ... no bitrates visible here ...

What I don't get is how PS3 Media Server is doing this ... it's remuxing as well but reduces video quality in the same time with nearly no cpu usage ...

Would it be worth trying to call ffmpeg with a copy statement and a bitrate limitation (or any other switch)? Just to try?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Nov 16, 2010 4:59 pm

Re: HD Video Quality setting

you can give it a go. they might also use other sw than ffmpeg, like tsmuxer.
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Tue Nov 16, 2010 5:08 pm

Re: HD Video Quality setting

Yes they use tsmuxer.

This sounds good: "FFmpeg can also convert from any sample rate to any other, and resize video on the fly with a high quality polyphase filter."

I'll try ...
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Wed Nov 17, 2010 12:36 am

Re: HD Video Quality setting

Well, it was a hard time If you look at the clock - fought my way through nearly all ffmpeg options ...

-muxrate is the option we're looking for - this works if the -vcodec is set to copy and limits the bitrate with no cpu load ...

So I propose this option for the next serviio release as a kind of maximum bitrate when re-muxing. But we don't want to increase the bitrate but only lower it.
What I mean: when the average video bitrate is lower then the configured muxrate do nothing, else apply the muxrate and thus limit the rate.

thx
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Wed Nov 17, 2010 8:30 am

Re: HD Video Quality setting

Ok good, but its an advanced setting not very easy to manage.
-muxrate option set mux rate, mean average mux rate, it is not a maximum bitrate that "clip" the bitrate...
This requires advanced testing

PS: Sorry for my poor English
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Wed Nov 17, 2010 9:00 am

Re: HD Video Quality setting

I agree ... and the first thing is:

You mus't not use the -r option (change the frame rate) ... otherwise Audio and Video goes out of sync. Anything else I left unchanged as serviio logs the ffmpeg command line (changing the audio from DTS to AC3 and change the audio rate).

I already converted a complete 3 hours HD Film without problem. To disable this re-muxing completely (If the Developer(s) decide to implement such a feature in the new release) I leave to the Developer(s) ...

As there are lots of people having problems (also in this forum) with HD streaming and stuttering playback I personally think this could solve many problems.

Clip the bitrate: The bitrate is not clipped, if I set it to 10000k it well goes up to 11000k seen during re-muxing ... it could be similar like tsMuxer does it - and it does it very well - but I can't say any word on how it does it ... ;)

thx
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Nov 17, 2010 9:19 am

Re: HD Video Quality setting

great. Thanks for investigating. Can you post examples of ffmpeg -i <file> for a file before remuzing and after remuxing with a bitrate lower than the original and higher than the original?

I've created a ticket: http://bitbucket.org/xnejp03/serviio/is ... r-remuxing
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Wed Nov 17, 2010 9:34 am

Re: HD Video Quality setting

You mean I should upload three files? original, lower and higher?
PS: created an account in bitbucket - now I'am able to upload files ...
Last edited by tombert on Wed Nov 17, 2010 9:41 am, edited 1 time in total.
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Wed Nov 17, 2010 9:35 am

Re: HD Video Quality setting

Try transcoding with and without -muxrate option:
FFmpeg(Serviio) version SVN-r23012

ffmpeg -i C:\Sample\Sintel_DivXPlusHD_2Titles_6500kbps.mkv
  Code:
C:\Serviio\lib>C:\Serviio\lib\ffmpeg.exe -i C:\Sample\Sintel_DivXPlusHD_2Titles_6500kbps.mkv
FFmpeg version SVN-r23012, Copyright (c) 2000-2010 the FFmpeg developers
  built on May  3 2010 19:05:24 with gcc 3.4.5 (mingw-vista special r3)
  configuration: --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-memalign-hack --enable-libmp3lame --enable-w32threads --extra-ldflags=-L/static/lib --extra-cflags=-I/static/include
  libavutil     50.15. 0 / 50.15. 0
  libavcodec    52.66. 0 / 52.66. 0
  libavformat   52.62. 0 / 52.62. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.10. 0 /  0.10. 0
[matroska @ 013fcf60]Unknown entry 0xC0
[matroska @ 013fcf60]Unknown entry 0xC1
[matroska @ 013fcf60]Unknown entry 0xC6
    Last message repeated 3 times
[matroska @ 013fcf60]Unknown entry 0x7446
[matroska @ 013fcf60]Unknown entry 0xC6
[matroska @ 013fcf60]Unknown entry 0x7446
[matroska @ 013fcf60]Unknown entry 0xC6
[matroska @ 013fcf60]Unknown entry 0x7446
[matroska @ 013fcf60]Unknown entry 0xC6
[matroska @ 013fcf60]Unknown entry 0x7446
[matroska @ 013fcf60]Unknown entry 0xC6
[matroska @ 013fcf60]Unknown entry 0x7446
[matroska @ 013fcf60]Unknown entry 0xC6
[matroska @ 013fcf60]Unknown entry 0x7446
[matroska @ 013fcf60]Unknown entry 0x4661
[matroska @ 013fcf60]Unknown entry 0x4662
[matroska @ 013fcf60]Unknown entry 0x4661
[matroska @ 013fcf60]Unknown entry 0x4662
[matroska @ 013fcf60]Unknown entry 0x4661
[matroska @ 013fcf60]Unknown entry 0x4662
[matroska @ 013fcf60]Unknown entry 0x4661
[matroska @ 013fcf60]Unknown entry 0x4662
[matroska @ 013fcf60]Unknown entry 0x4661
[matroska @ 013fcf60]Unknown entry 0x4662
[matroska @ 013fcf60]Unknown entry 0x4661
[matroska @ 013fcf60]Unknown entry 0x4662
[matroska @ 013fcf60]Unknown entry 0x2AD1D3
[matroska @ 013fcf60]max_analyze_duration reached
[matroska @ 013fcf60]Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 48.00 (48/1)-> 24.00 (48/2)
Input #0, matroska, from 'C:\Sample\Sintel_DivXPlusHD_2Titles_6500kbps.mkv':
  Metadata:
    title           : Sintel
    TITLE           : Sintel
    TITLE/URL       : http://durian.blender.org/about/
    ARTIST          : Durian Blender Open Movie Project
    PRODUCER        : Ton Roosendaal
    COPYRIGHT       : Copyright Blender Foundation | durian.blender.org
    TERMS_OF_USE    : Creative Commons Attribution 3.0 License
    TERMS_OF_USE/URL: http://creativecommons.org/licenses/by/3.0/
    COMMENT         : Encoded in DivX Plus HD!
    License_newathu.ttf: Open Font License for New Athena Unicode, version 3.40, January 2009 (and laterversions)


Copyright (c) 2004-2009, American Philological Association(http://apaclassics.org, apaclassics@sas/upenn.edu),with Reserved Font Name <New Athena Unicode>.
Information and download available at http://apagreekkeys.org.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.

The OFL allows the licensed    License_AlteHaasGroteskRegular.ttf: Alte Haas Grotesk is a typeface that look like an helvetica printed in an old Muller-Brockmann Book.

These fonts are freeware and can be distributed as long as they aretogether with this text file.

I would appreciate very much to see what you have done with it anyway.

yann le coroller
www.yannlecoroller.com
yann@lecoroller.com

  Duration: 00:15:08.91, start: 0.000000, bitrate: 192 kb/s
    Chapter #0.0: start 11.167000, end 40.417000
    Metadata:
      title           : Pr+¦logo
    Chapter #0.1: start 40.417000, end 51.875000
    Metadata:
      title           : campo de nieve
    Chapter #0.2: start 51.875000, end 112.167000
    Metadata:
      title           : Ataque!
    Chapter #0.3: start 112.167000, end 162.625000
    Metadata:
      title           : Rescatados
    Chapter #0.4: start 162.625000, end 214.459000
    Metadata:
      title           : Ciudad
    Chapter #0.5: start 214.459000, end 360.000000
    Metadata:
      title           : Nuevo Amigo
    Chapter #0.6: start 360.000000, end 447.667000
    Metadata:
      title           : De Salida
    Chapter #0.7: start 447.667000, end 483.000000
    Metadata:
      title           : De Nuevo en la Choza
    Chapter #0.8: start 483.000000, end 670.000000
    Metadata:
      title           : Cueva
    Chapter #0.9: start 670.000000, end 755.000000
    Metadata:
      title           : Escapar
    Chapter #0.10: start 755.000000, end 908.000000
    Metadata:
      title           : Cr+¬ditos
    Stream #0.0(eng): Video: h264, yuv420p, 1920x872 [PAR 1:1 DAR 240:109], 24.39 fps, 24 tbr, 1k tbn, 48 tbc
    Metadata:
      title           : Sintel
    Stream #0.1(eng): Audio: mp3, 48000 Hz, 2 channels, s16, 192 kb/s
    Metadata:
      title           : MP3 Stereo
    Stream #0.2(eng): Audio: aac, 48000 Hz, 5.1, s16
    Metadata:
      title           : AAC Surround
    Stream #0.3(eng): Subtitle: 0x0000
    Metadata:
      title           : English
    Stream #0.4(ger): Subtitle: 0x0000
    Metadata:
      title           : German
    Stream #0.5(spa): Subtitle: 0x0000
    Metadata:
      title           : Spanish
    Stream #0.6(fre): Subtitle: 0x0000
    Metadata:
      title           : French
    Stream #0.7(dut): Subtitle: 0x0000
    Metadata:
      title           : Dutch
    Stream #0.8(por): Subtitle: 0x0000
    Metadata:
      title           : Portuguese
    Stream #0.9: Attachment: 0x0000
    Metadata:
      filename        : AlteHaasGroteskRegular.ttf
    Stream #0.10: Attachment: 0x0000
    Metadata:
      filename        : AlteHaasGroteskRegular.ttf
    Stream #0.11: Attachment: 0x0000
    Metadata:
      filename        : AlteHaasGroteskRegular.ttf
    Stream #0.12: Attachment: 0x0000
    Metadata:
      filename        : AlteHaasGroteskRegular.ttf
    Stream #0.13: Attachment: 0x0000
    Metadata:
      filename        : AlteHaasGroteskRegular.ttf
    Stream #0.14: Attachment: 0x0000
    Metadata:
      filename        : AlteHaasGroteskRegular.ttf
At least one output file must be specified


ffmpeg -i C:\Sample\Sintel_DivXPlusHD_2Titles_6500kbps.mkv -vcodec copy -acodec ac3 -ab 192k -vbsf h264_mp4toannexb -f mpegts C:\SampleTest_without.ts
Resulting:
C:\Serviio\lib>C:\Serviio\lib\ffmpeg.exe -i C:\Sample\Test_without.ts
Seems stream 0 codec frame rate differs from container frame rate: 48.00 (48/1)-> 1000.00 (1000/1)
Input #0, mpegts, from 'C:\Sample\Test_without.ts':
Duration: 00:15:08.87, start: 1.400000, bitrate: 7051 kb/s
Program 1 Service01
Metadata:
name : Service01
provider_name : FFmpeg
Stream #0.0[0x100]: Video: h264, yuv420p, 1920x872 [PAR 1:1 DAR 240:109], 24 fps, 1k tbr, 90k tbn, 48 tbc
Stream #0.1[0x101](eng): Audio: ac3, 48000 Hz, 5.1, s16, 192 kb/s




ffmpeg -i C:\Sample\Sintel_DivXPlusHD_2Titles_6500kbps.mkv -vcodec copy -acodec ac3 -ab 192k -vbsf h264_mp4toannexb -muxrate 10000k -f mpegts C:\Sample\Test.ts
Resulting:

C:\Serviio\lib>C:\Serviio\lib\ffmpeg.exe -i C:\Sample\Test_with.ts
Seems stream 0 codec frame rate differs from container frame rate: 48.00 (48/1)-> 1000.00 (1000/1)
Input #0, mpegts, from 'C:\Sample\Test_with.ts':
Duration: 00:15:08.87, start: 1.400000, bitrate: 10590 kb/s
Program 1 Service01
Metadata:
name : Service01
provider_name : FFmpeg
Stream #0.0[0x100]: Video: h264, yuv420p, 1920x872 [PAR 1:1 DAR 240:109], 24 fps, 1k tbr, 90k tbn, 48 tbc
Stream #0.1[0x101](eng): Audio: ac3, 48000 Hz, 5.1, s16, 192 kb/s


The bitrate is forced not "clipped"

with lower bitrate 4000k than original:
ffmpeg -i C:\Sample\Sintel_DivXPlusHD_2Titles_6500kbps.mkv -vcodec copy -acodec ac3 -ab 192k -vbsf h264_mp4toannexb -muxrate 4000k -f mpegts C:\Sample\Test.ts

C:\Serviio\lib>C:\Serviio\lib\ffmpeg.exe -i C:\Sample\Test.ts
Seems stream 0 codec frame rate differs from container frame rate: 48.00 (48/1)-> 1000.00 (1000/1)
Input #0, mpegts, from 'C:\Sample\Test.ts':
Duration: 00:15:08.87, start: 1.400000, bitrate: 6806 kb/s
Program 1 Service01
Metadata:
name : Service01
provider_name : FFmpeg
Stream #0.0[0x100]: Video: h264, yuv420p, 1920x872 [PAR 1:1 DAR 240:109], 24 fps, 1k tbr, 90k tbn, 48 tbc
Stream #0.1[0x101](eng): Audio: ac3, 48000 Hz, 5.1, s16, 192 kb/s


The result is strange for lower bitrate
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Wed Nov 17, 2010 9:45 am

Re: HD Video Quality setting

Hi Illico ... can you upload these files to zip or shall I do it (then I would download a trailer from the internet somewhere)?
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Wed Nov 17, 2010 9:48 am

Re: HD Video Quality setting

You can found the Sintel movie here:
http://www.divx.com/en/electronics/solu ... s-hd/video
Direct link

So you and zip could also test this...
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

tombert

User avatar

DLNA master

Posts: 217

Joined: Wed Oct 13, 2010 8:01 pm

Post Wed Nov 17, 2010 9:52 am

Re: HD Video Quality setting

Ok - I'll do ...
thx for the movie link.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Nov 17, 2010 9:55 am

Re: HD Video Quality setting

tombert wrote:You mean I should upload three files? original, lower and higher?
PS: created an account in bitbucket - now I'am able to upload files ...

Nope, I don't need the files, just output from the ffmpeg commands run on your machine.
Next

Return to Feature requests

Who is online

Users browsing this forum: Google [Bot] and 35 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.