Web Streams, Aspect Ratio, PMSencoder and Bravia

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
Paradox
Posts: 151
Joined: Tue Dec 17, 2013 5:50 am

Web Streams, Aspect Ratio, PMSencoder and Bravia

Post by Paradox »

So first off the problem in short. Web Streams do not seem to obey additional settings made for certain devices to render video aspect ratio correctly be it if making the setting changes in UMS itself or in your render.conf files.

I have a Sony Bravia KDL40-EX403 which by now most reading will know like a few other devices requires custom parameters to render videos correctly on screen, to do this in my "braviaex.conf" file i use the command line...
CustomMencoderOptions = -vf softskip,expand=::::1:16/9:2,scale=1283:720 -lavcopts aspect=16/9
This renders video stored LOCALLY perfectly of all resolutions for me when using mencoder (with the exception of external subtitle file overlap bug which im not bothered about, i rarely use subs or just hard code into an avi file or similar if i do need them). 2.35:1 videos display perfect, 16:9 perfect even 4:3.

However if i attempt to play back web streams (tried mencoderweb, ffmpegweb and even VLC Web engines) the aspect ratio is always incorrect. I have played with various values both in my bravia.conf and within "Expert Settings: Codec Specific" in UMS it self but no matter what resolution is set the webstreams display incorrectly.

As an example i have this set in my web.conf file
They encode all their streams in h264 and .mp4 container with a resolution of 1280x720. So just a standard 16:9 720p Aspect. However when played back through UMS on my bravia they all end up being displayed with black bars top and bottom (presented on the scream as if it is 2.40 aspect or thereabouts). The image is vertically squashed (IE everyone looks fat or a circle will end up looking like an oval shape).

This same issue also happens if i try to use ffmpeg for locally stored files (so it looks like ffmpeg does not obey changes either). They work 100% fine if using mencoder or tsmuxer though.

In earlier releases of UMS (Ive tried versions 2.65 upto 3.0.0a1) this was not a problem as using PMSEncoder engine for webstreams in conjunction with the above bravia.conf mod worked 100% fine and they would display the Aspect ratio correct for web streams. However it seems from reading these forums all versions since around 3.0.0 PMSencoder no longer works in. though weirdly i did find in my reading of this forum a "UMS-Serenus-10.exe" build which suggests it is based on 3.0.0 file which PMSencoder strangly does work in, the 3.0.0 version on sourceforge though (IE here http://sourceforge.net/projects/unimedi ... e/download) does not function with PMSencoder.

I really like the newer versions of UMS. 3.10 and onward is amazing due to the improvements made to render the directory tree faster on Sony Bravia TVs, older versions you would have to wait for it to load file and folder icons an iceage lol.

However the downside is obviously the loss to watch webstreams as whatever code is used does not seem to obey setting changes made in UMS.conf or bravia.conf.

So the question is there any way to fix this or any fix in the works??? I really do not want to have to go back to a version between 2.65 and 3.0.0b1 due to the directory display taking so long to render on Bravia TVs. Is there maybe anyway perhaps with some tips if needed i could build myself an earlier version but implement the code which came in 3.10 see i can have fast directory browsing and correct webstream aspect. I suspect (though may be entirely wrong) it is only minor changes made to the code to speed up directory browsing could someone maybe point to what on github and point to how i could take that and build it into an older revision see i could have the best of both worlds. I am a pretty efficient user and with a few pointers think i could manage this.

Anyways go easy on me, its my first post, sorry if it is a bit long, i would had included logs but am not at my machine right now, it probably in this case would not matter as i am pretty certain they do not report anything strange when trying to play a webstream as there is nothing strange so to speak apart from sony in the equation.

Any tips to force webstreams to play with correct aspect and also to get ffmpeg to play local content with correct aspect would be much appreciated.
Paradox
Posts: 151
Joined: Tue Dec 17, 2013 5:50 am

Re: Web Streams, Aspect Ratio, PMSencoder and Bravia

Post by Paradox »

Update attached log file. I believe the problem may be related to Mencoderweb setting this line and specifically the bit in bold....
DEBUG 2013-12-17 02:59:58.218 [mencoder.exe-1] Starting "C:\Program Files\Universal Media Server\win32\mencoder.exe" http://videos.revision3.com/revision3/w ... 0.h264.mp4 -msglevel all=2 -quiet -prefer-ipv4 -cache 16384 -oac lavc -of lavf -lavfopts format=dvd -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=4096:threads=4:acodec=ac3:abitrate=128 -vf harddup -ofps 25 -o \\.\pipe\mencoder1387249198218
DEBUG 2013-12-17 02:59:58.265 [mencoder.exe-1] Reading pipe: \\.\pipe\mencoder1387249198218
Seems to (im guessing) trys to resize the stream to DVD res which causes a conflict with my bravia TV
Anyway to change these options either in UMS.conf or via renderer files when starting playback of a webstream???
Or better yet any chance of a build or if its even possible to configure/build things see it does not try to alter resolution of the file it is passing but keeps the standard resolution of the file (in this case its a 1280x720 resolution stream).

Even better (in my case at least) would be if it is even possible to use tsmuxer or similar transcoder to STRAIGHT pass the file with no altering.

Anyways logs attached hope someone can advise...
Attachments
ums_dbg.zip
(17.96 KiB) Downloaded 438 times
rnb5500
Posts: 17
Joined: Mon Nov 04, 2013 2:04 pm

Re: Web Streams, Aspect Ratio, PMSencoder and Bravia

Post by rnb5500 »

I could easily be wrong but I don't think the format=dvd setting affects the aspect ratio. I believe its more for transcoding mpeg2 to dvd compliance; bitrate, GOP, etc. Lavcopts is used for setting aspect, I think.

Also its specific to Mencoder and wouldn't explain the same behavior in all 3 Web engines.
Paradox
Posts: 151
Joined: Tue Dec 17, 2013 5:50 am

Re: Web Streams, Aspect Ratio, PMSencoder and Bravia

Post by Paradox »

Good point rnb5500 about the problem affecting all 3 web engines. Though it would be interesting to see what happens if that format=dvd line was removed, looking at http://www.mplayerhq.hu/DOCS/HTML/en/me ... d-dvd.html it would appear if using the fomat=dvd command the rest of the settings are pretty much to a degree redundant (unless you had a stream with some really weird audio and video settings) and not needed. It would be nice if you could even alter the "mpeg2video:vbitrate=4096" line as again looking at that web site it indicates dvd can go up to 9800 which for some people with slow internet connections for webstreams would not be do-able but for people such as myself with a connection 8 times faster than that would give a nice quality improvement.

Regardless it seems Mencoder when using it for web streams does not obey custom settings you have placed in ums.conf or a renderer.conf file. It does for local files.
FFmpeg you have little control over from what i know (at least i do not know how to set custom options for that, and even then i suspect they would still be ignored for web streams).
Mplayer for some reason in Version 3.30 of UMS does not even show up in my list of web transcoding engines.

There must be a script of some description packed in UMS.jar which forces this behaviour for webstreams and sets the command lines for Mencoder and the other engines. Something since around UMS 2.65 for web streaming in the code has seriously changed and not for the better :( which is a shame because in all other regards it has got better with every release.
Post Reply