[Solved] BraviaEX: Fixed subtitles on black bands

Discuss media renderers like Xbox 360, TVs, smartphones, etc.
Post Reply
master-nevi
Posts: 2
Joined: Sun Oct 05, 2014 10:17 am

[Solved] BraviaEX: Fixed subtitles on black bands

Post by master-nevi » Sun Oct 05, 2014 10:56 am

Short story:
Fixed subtitles on black bands not being cleared (causing subtitles to be overlapped) by reordering the video filter options for Mencoder in the BraviaEX.conf so that the expand filter is applied last. This solution was based on a similar issue and fix from this thread: http://lists.mplayerhq.hu/pipermail/mpl ... 68259.html

From:

Code: Select all

CustomMencoderOptions =-vf softskip,expand=::::1:16/9:2,scale=1283:720 -lavcopts aspect=16/9
To:

Code: Select all

CustomMencoderOptions =-vf softskip,scale=1283:720,expand=::::1:16/9:2 -lavcopts aspect=16/9
In case everybody agrees on the fix, here's the commit with the change that just needs to be pulled from my fork.
https://github.com/master-nevi/Universa ... 942b55190f

Long story:
When using the Mencoder engine on a video with subtitles, the subtitles appeared to continuously overlap each other. I never saw this when running on the PS3 Media Server (which I just switched from) and I then noticed the different in the BraviaEX.conf files. The Mencoder options were the biggest difference so I had a good starting point to start my Google searching.

Side note: I'm a long time PS3 MS user/fan who just recently discovered this UMS fork and am so happy to see this project active again. Cheers!

Paradox
Posts: 144
Joined: Tue Dec 17, 2013 5:50 am

Re: [Solved] BraviaEX: Fixed subtitles on black bands

Post by Paradox » Sun Nov 30, 2014 3:04 am

This which it looks like has been applied in 4.2.1 and 4.2.2 potentially breaks aspect ratio being displayed correctly on EX4xx series bravias when using Mencoder.

On my Bravia KDL-40EX403 you must EXPLICITLY state the expand/pad area FIRST. otherwise all 16:9 content will end up squashed with black bars (IE everything ends up looking fat and in a format close to 2.35:1) The bravias renderer basically just ignores the pad/expand area if its last and just uses the scale function which messes various aspect ratios completely up on its own.

IT works OK on PS3 Media Server cos that can still use Chocoboys old PMSEncoder when needed which has not been a part of UMS for well over a year.

Changes also made to DLNAPN in the code (im guessing this was some type of attempt by someone to remotely send files from something like a mobile device to a Bravia TV) has also broken things if you use the "Enable the cache" option within the program when using specific EX sony TVs. As the changes will not be seen to any new files added (cos they aint cached immediately)Changes for DLNAPN IF NEEDED (which they were not as EX model Bravias are not supposed to support remote sending of VIDEO files ONLY PICTURE and MUSIC) should had been appllied within the .conf file using the following options
DLNALocalizationRequired=False
and
# Change DLNA PN arguments, separated by |.
# Example: OldDlnaPn=NewDlnaPn|OldDlnaPn2=NewDlnaPn2
# Default: ""
DLNAProfileChanges =

With appropriate changes.

And also if necessary
# MimeTypesChanges: A list of mimetype transformations, separated by |.
# Example: MimeTypesChanges = old/mime1=new/mime1|old/mime2=new/mime2
# Default: ""
MimeTypesChanges =

With new MIME changes.


4.2.1 and 4.2.2 is now completely broken for Sony TVs unless you manually re-tweak the conf file. It also due to the changes means files take longer to transcode and start playing as it has to go through the god knows how many lines of code each time you start a file looking for the DLNA profile changes.

Oh and the worse, most simple almost criminal overlooked thing.......
The following lines are now by default also missing from the BraviaEX.conf file...
MaxVideoWidth = 1920
MaxVideoHeight = 1080
H264Level41Limited = true

Which if you have any MP4 files with a level greater than 4.1 they again take longer to load and transcode to MPEG as mediainfo has to do its thing and realise the file is higher than 4.1 level.


Its solved one issue (subtitles) and created another half a dozen and was IMO a stupid thing to approve and implement.

Tweaks to this program IMO need to be looked at way more carefully, changes are being made and implemented way too soon without proper testing there has been god only knows how many versions and changes for better or worse this year, keeping track of which version works for VERY specific devices has became a complete nightmare and leads to nothing but issues where things that worked for a user with a device in one version suddenly fail in the new.

I dont understand the ryme or reason for just blindly implementing change without testing, no other DLNA app does.

User avatar
SubJunk
Lead Developer
Posts: 3236
Joined: Sun May 27, 2012 4:12 pm

Re: [Solved] BraviaEX: Fixed subtitles on black bands

Post by SubJunk » Mon Dec 01, 2014 11:54 am

Please feel free to submit patches to us, Paradox. I explained those 3 lines in the release thread - removing them hasn't changed anything, we just made those values the defaults.

Paradox
Posts: 144
Joined: Tue Dec 17, 2013 5:50 am

Re: [Solved] BraviaEX: Fixed subtitles on black bands

Post by Paradox » Mon Dec 01, 2014 1:27 pm

SubJunk wrote:Please feel free to submit patches to us, Paradox. I explained those 3 lines in the release thread - removing them hasn't changed anything, we just made those values the defaults.
Yes apologies about the 3 lines of...
MaxVideoWidth = 1920
MaxVideoHeight = 1080
H264Level41Limited = true

Apologies, I did not see they were now defaults, my mistake there. The issues must be down to the DLNAPN changes and the rearranged CustomMencoderoptions. I do know you can not scale content on my bravia unless you specific state the padding/expand/area size first. The softskip option also has to be in a very specific position, im pretty sure this has been over before on UMS/PMS although it was a long time ago.

Sony devices are a pain i know. I think it would be best in future if any changes to them either come with a test version first or similar.

You are going to have the same issues with the Xbox One and Some new LG TVs now as neither of them just like Sony TVs obey the DLNA spec 100% either, which without proper testing is going to lead to all types of issues.

User avatar
SubJunk
Lead Developer
Posts: 3236
Joined: Sun May 27, 2012 4:12 pm

Re: [Solved] BraviaEX: Fixed subtitles on black bands

Post by SubJunk » Tue Dec 02, 2014 12:31 pm

Are you a Linux user? Can you test this version and let me know how it goes? http://www.spirton.com/uploads/UMS/UMS-29a85c2.tgz

Paradox
Posts: 144
Joined: Tue Dec 17, 2013 5:50 am

Re: [Solved] BraviaEX: Fixed subtitles on black bands

Post by Paradox » Tue Dec 02, 2014 2:08 pm

SubJunk wrote:Are you a Linux user? Can you test this version and let me know how it goes? http://www.spirton.com/uploads/UMS/UMS-29a85c2.tgz
No unfortunately not, currently (Main machine at home is also used for work so in a fashion im tied to the MS overlord and Windows) have considered it and getting myself a spare laptop though as building from source and changing code (even if it is just for personal use) to solve the annoying Bravia issues once and for all would be easier, i do not know why it is still a ongoing issue, its been fixed in serviio and plex long ago. I think half the issues not just Bravia related but other devices which pop up on the forums (remember all the Panasonic and now it seems to be LG and Xbox issues ;) ) is down to UMS and PMS just having far too many individually compiled files, which on its own can lead to easily missed things when code alterations happen and minor changes not behaving well with other code.

For now the solution for anyone that has bravia and Mencoder issues is to use either FFMPeg as the default trancoder or roll back versions. :(

PS That version above would probably work at least aspect ratio wise because for the "Sony-BraviaEX.conf" The option line is in the right order IE "softskip,expand=::::1:16/9:2,scale=1283:720"

In version 4.2.2 that has been changed to...
softskip,scale=1283:720,expand=::::1:16/9:2

You can NOT AFAIK scale on a Bravia 40EX403 series (probably all the EX series xxEX500 and below) until you specific the PAD/Expand area first. It will work fine IF the movie has some form of subs as they EXPAND the screen vertically, on files with no subs it means files have the squashed AR again. Its one of the things which has screwed up at least SOME bravia EX models in 4.2.1 and 4.2.2. There may/maynot be other stuff due to the DLNAPN changes.

As stated solves one issue but not the other. I personally do not think how things stand subs plus correct AR will ever be doable on ALL devices, Especially Bravias, some panasonics, Xbox one and other devices that do not 100% follow the DLNA spec.

User avatar
SubJunk
Lead Developer
Posts: 3236
Joined: Sun May 27, 2012 4:12 pm

Re: [Solved] BraviaEX: Fixed subtitles on black bands

Post by SubJunk » Tue Dec 02, 2014 4:46 pm

The issues on other renderers are pretty different, for example the Xbox One issues have been due to updates on the Xbox One itself, all we have done is made changes to keep up with that. Here's a Windows build to test http://www.spirton.com/uploads/UMS/UMS-939446f.exe

We can make some code to put the subtitles in the right position with MEncoder using the subpos parameter. FFmpeg has been the default (recommended) transcoding engine in UMS for a long time.

Paradox
Posts: 144
Joined: Tue Dec 17, 2013 5:50 am

Re: [Solved] BraviaEX: Fixed subtitles on black bands

Post by Paradox » Thu Dec 04, 2014 4:38 pm

SubJunk wrote:The issues on other renderers are pretty different, for example the Xbox One issues have been due to updates on the Xbox One itself, all we have done is made changes to keep up with that. Here's a Windows build to test http://www.spirton.com/uploads/UMS/UMS-939446f.exe

We can make some code to put the subtitles in the right position with MEncoder using the subpos parameter. FFmpeg has been the default (recommended) transcoding engine in UMS for a long time.
Surely it would make more sense to leave Mencoders custom command line alone or as it was...
(IE with the EXPAND command FIRST CustomMencoderOptions =-vf softskip,expand=::::1:16/9:2,scale=1283:720 -lavcopts aspect=16/9)

and for people that have external sub files for them to use the TRANSCODE folder and select the SUB language of the sub and play the file with FFMpeg.

Doing it that way you can have Mencoder or FFMpeg set as default renderer for any file without subs and use FFMpeg for files with subs. Altering things around basically renders Mencoder useless as the Aspect Ratio on a Sony even with subs will NEVER be 100% correct with the EXPAND code NOT set first.

HOWEVER
I suspect this long running issue with Sony stuff (which is getting a bit silly) is all to do with the DLNA profiles in the UMS code and the way Sony use custom DLNAPNs, thus does not obey the standard...

Serviio gets around the issue by renaming the PNs to more standard naming conventions, if you download serviio and look at their "Profiles.xml" file and scan through it for sony bravia references you will see what i mean.
YOU can find the profiles.xml file here without having to download and install the whole app...
https://github.com/augustf/serviio-profile

LOOK at the BRAVIA segments and NOTE the DLNAPN changes (or as they call them in their code 'MediaFormatProfiles') You will see Sony stuff needs significant altering.

THIS CAN NOT be done FULLY in UMS renderers the closest we have is....

Code: Select all

# Change DLNA PN arguments, separated by |.
# Example: OldDlnaPn=NewDlnaPn|OldDlnaPn2=NewDlnaPn2
# Default: ""
DLNAProfileChanges = 
Which will only let you rename a SINGLE PN to another SINGLE PN. Rather than a multitude.
If additions like that were added to the UMS DLNA code it would solve everything (sub issues, aspect issues, etc etc). For some reason it has never been done. Similar could also be done for prior problem Panasonic devices which had/have Aspect Ratio issues.

Im actually considering getting Christmas out of the way and building UMS from scratch myself with appropriate PNs see ALL sony devices finally work properly, i suspect its never going to be done in UMS or PMS otherwise, which is a shame cos its one of the best DLNA apps out there. I may even make it a custom version on GIT or similar if it does not violate any rules with regards to pinching the rest of the code (still have to look at that area). I just do not get enough time to myself nowadays or i would had done it by now and there is no way like you guys i could make it a serious project, regularly updated application, work, wife, kids are a big enough job lol.

Im gussing 4.2.3 is imminent ;) maybe you could beat me to it with some changes ;)

User avatar
SubJunk
Lead Developer
Posts: 3236
Joined: Sun May 27, 2012 4:12 pm

Re: [Solved] BraviaEX: Fixed subtitles on black bands

Post by SubJunk » Fri Dec 05, 2014 3:17 pm

In the version I attached, expand is before scale.

Why can't you use DLNAProfileChanges to rename multiple ones? It mentions two in the example and I'm not aware of any limit on the number.

Paradox
Posts: 144
Joined: Tue Dec 17, 2013 5:50 am

Re: [Solved] BraviaEX: Fixed subtitles on black bands

Post by Paradox » Sun Dec 07, 2014 4:02 pm

SubJunk wrote:In the version I attached, expand is before scale.

Why can't you use DLNAProfileChanges to rename multiple ones? It mentions two in the example and I'm not aware of any limit on the number.
In the earlier version you linked to i did acknowledge here...
viewtopic.php?f=5&t=2298#p13301
with the quote of "PS That version above would probably work at least aspect ratio wise because for the "Sony-BraviaEX.conf" The option line is in the right order IE "softskip,expand=::::1:16/9:2,scale=1283:720"
So yes switching it back would indeed likely work, in current 4.21 and 4.22 though that is not the case. By that i mean it should not had been altered in the first place.

With regards to DLNAPN changes it would be hard work, you can NOT change MULTIPLE PNs to a SINGLE PN with one command..... Or rather you can KINDA.... You would have to name every ORIGINAL PN and then tell it to change to a specific PN for every PN IE as an example to make more sense say i wnt to change MULTIPLE PNs to AVC_TS_HD_50_AC3 i would have to do something silly like this...

Code: Select all

DLNAProfileChanges = AVC_TS_MP_SD_AC3=AVC_TS_HD_50_AC3|AVC_TS_MP_SD_AC3_T=AVC_TS_HD_50_AC3|AVC_TS_MP_SD_AC3_ISO=AVC_TS_HD_50_AC3|AVC_TS_MP_HD_AC3=AVC_TS_HD_50_AC3|AVC_TS_MP_HD_AC3_T=AVC_TS_HD_50_AC3|AVC_TS_MP_HD_AC3_ISO=AVC_TS_HD_50_AC3
separating them by commas "," and then stating "=" and the PN you wish to change to does NOT appear to work. (code issue? Not implemented to work like that i dunno :cry:)

Before you know it the command line would be several screens wide and more important HARD TO KEEP TRACK of what has been done (unless you look carefully at that example your eyes at first sight think some of it is the same it is not they are all unique PNs changed to AVC_TS_HD_50_AC3).

You would end up with a stupidly long line of code in the renderer. The serviio way is much more elegant in that you can just list all the PNs that need changing and then just change it to a single PN in one single go if you wish.

EVEN BETTER and what i have planned, in the UMS's DLNA database/java/class file just put the right changes in place for SONY devices to use DEFAULT PNs in the first place, instead of the CUSTOM ones SONY use, im shocked it has not been done long ago.

Post Reply