Aspect and Crop issues on ALL SONY and potentially other devices possibly finally solved????
Posted: Mon Apr 03, 2017 7:11 am
FIRST.... WARNING follow any of this wrong and you may have to reinstall UMS, this tinkering is not for new users or those that have any doubt what they are doing when following the directions. Failing to read carefully will result in failure
So a little history first some devices have never displayed the Aspect ratio of a movie correctly or as a work around would slightly crop the sides of the picture (mainly due to DLNA on some devices not obeying resolution rules) or they would horribly stretch the image.
For those not sure what im on about here is a basic example (Ive taken these images for example purposes from a user named Illico on the serviio forums, if staff here or the user himself do not want them used ill be happy to replace them when i have time, staff can remove this bit of the post if they deem fit but his work is a very good example FULL 100% CREDIT TO ILLICO).
NOTE:
Sony-BraviaEX.conf users ive done the work for you see the attached and bottom of the post
This is how an image from a video should look...

If your device has problems it will typically do one of 2 things and display the image either stretched like this (ignore the red lines/border on the image for now im coming to them and concentrate on how the image is stretched... the balls on the fireplace look more oval and the girl suddenly has a fatter, wider head)

This could be solved on many TVs to a degree including Sonys by basically zooming the image (this is what FFMeg basically does on problem devices to a degree and what happens if you use the zoom/aspect controls on your TV) The result is the pictures aspect looks fine but remember those red lines/border above, well thats what it crops off from the image) so the image then looks like this....

Note how the aspect is correct (fireplace balls are round and the girls head no longer fat/wide) The problem of course is you have now lost a fair percentage of the image on the left and right hand sides... NOTE how some of the fireplace mantle at the top is now out of frame.
For non fussy users this has never really been a massive issue, some may have never even noticed, but it would drive me absolutely nuts, for older movies where opening/ending credits would span the whole screen you would lose half a letter or more on the sides, movies reliant on close up shots or focusing on a fixed image you would also miss what was fully going on, you get the idea.
On some devices you could solve it easily by using Mencoder in UniversalMediaServer instead of FFMpeg (or vice versa) for the transcoding (works a treat on my Sony Bravia KDL40EX403 which uses the SonyEX.conf renderer). BUT ive always wanted to get UMS to work perfectly with Mencoder and FFMpeg.
The solution
1. FIND out which renderer conf file your device uses, this will be displayed either on the main status screen when you open UMS or listed within the logs on the logs tab, perhaps even both.
2. Find and rename that renderer "conf" file in the renderers folder your device uses and rename it from xxxx.conf to xxxx.conf.bak (where xxxx is the device renderers name)
3. Open that file you have renamed into a text editor like notepad++ and remove/delete any entries including anything after the "=" sign that have...
^^^ If you do not remove those the rest of this will not work.
4 Now INSERT the following commands, (leave them if already in there) do this in the same general area as you removed any commands from, do not insert them at the very top (thats renderer info) or at the very bottom of the file (Thats for info about file/media types)
in addition to those you then need these that do most of the magic...
5 Save this file with the same name as the file you opened only without the .bak on the end of it (see it ends in .conf), if needed copy it into your renderers folder. Doing things this way mean you will have a backup file of the original (IE the original you renamed to have .bak on the end) If this tweaking then makes things worse you can delete the new conf and rename the bak file back to what it was. This saves having to reinstall if things dont work. OR it will if you have read this far and followed.
6 IMPORTANT.... Play back a file and ensure zoom/aspect picture settings on your sony are set to +1 or FULL Pixel.... To do this...........
Start playing a file
Press the options button on your remote
Go to the top and picture options
Select screen
Adjust until it reads +1 or Full Pixel (depending on model it will show one or the other, some sonys may have both options, in that case select Full Pixel)
OTHER devices you will have to find the option on your TV, it will either generally be be under screen settings, aspect or similar.
Further notes
If you only have stretched/crop issues with FFMpeg just try the OverrideFFmpegVideoFilter = line if you have issues with just Mencoder enter just the CustomMencoderOptions = line, if you have had problems when using both FFMpeg and Mencoder try them both. Some device it may still not work perfectly for, but for SONY devices this should solve the issue 100% once and for all.
For anyone using a device that makes use of the Sony-BraviaEX.conf file attached is a copy of my Sony-BraviaEX.conf which now gives 100% as far as ive been able to test anyways over the past couple of days correct Aspect ratio and NO cropping and works for using both Mencoder and FFMpeg.......... I have NOT tested with subtitles, i do not use the subtitle feature in UMS so if that does not work and you really need subs you will have to experiment further.... Im happy with things as is and a picture displayed PERFECTLY! It took a hell of a lot of FFMpeg experimenting to finally get rid of crop issues.
Sony users feedback especially appreciated. Especially those that use the Sony-BraviaEX.conf renderer.
Enjoy
So a little history first some devices have never displayed the Aspect ratio of a movie correctly or as a work around would slightly crop the sides of the picture (mainly due to DLNA on some devices not obeying resolution rules) or they would horribly stretch the image.
For those not sure what im on about here is a basic example (Ive taken these images for example purposes from a user named Illico on the serviio forums, if staff here or the user himself do not want them used ill be happy to replace them when i have time, staff can remove this bit of the post if they deem fit but his work is a very good example FULL 100% CREDIT TO ILLICO).
NOTE:
Sony-BraviaEX.conf users ive done the work for you see the attached and bottom of the post
This is how an image from a video should look...
If your device has problems it will typically do one of 2 things and display the image either stretched like this (ignore the red lines/border on the image for now im coming to them and concentrate on how the image is stretched... the balls on the fireplace look more oval and the girl suddenly has a fatter, wider head)
This could be solved on many TVs to a degree including Sonys by basically zooming the image (this is what FFMeg basically does on problem devices to a degree and what happens if you use the zoom/aspect controls on your TV) The result is the pictures aspect looks fine but remember those red lines/border above, well thats what it crops off from the image) so the image then looks like this....
Note how the aspect is correct (fireplace balls are round and the girls head no longer fat/wide) The problem of course is you have now lost a fair percentage of the image on the left and right hand sides... NOTE how some of the fireplace mantle at the top is now out of frame.
For non fussy users this has never really been a massive issue, some may have never even noticed, but it would drive me absolutely nuts, for older movies where opening/ending credits would span the whole screen you would lose half a letter or more on the sides, movies reliant on close up shots or focusing on a fixed image you would also miss what was fully going on, you get the idea.
On some devices you could solve it easily by using Mencoder in UniversalMediaServer instead of FFMpeg (or vice versa) for the transcoding (works a treat on my Sony Bravia KDL40EX403 which uses the SonyEX.conf renderer). BUT ive always wanted to get UMS to work perfectly with Mencoder and FFMpeg.
The solution
1. FIND out which renderer conf file your device uses, this will be displayed either on the main status screen when you open UMS or listed within the logs on the logs tab, perhaps even both.
2. Find and rename that renderer "conf" file in the renderers folder your device uses and rename it from xxxx.conf to xxxx.conf.bak (where xxxx is the device renderers name)
3. Open that file you have renamed into a text editor like notepad++ and remove/delete any entries including anything after the "=" sign that have...
Code: Select all
KeepAspectRatio =
KeepAspectRatioTranscoding =
OverrideFFmpegVideoFilter =
CustomMencoderOptions =
4 Now INSERT the following commands, (leave them if already in there) do this in the same general area as you removed any commands from, do not insert them at the very top (thats renderer info) or at the very bottom of the file (Thats for info about file/media types)
Code: Select all
AccurateDLNAOrgPN = true
MuxNonMod4Resolution = true
DLNALocalizationRequired = true
Code: Select all
OverrideFFmpegVideoFilter = pad=max(iw*1.01\\,ih*1.01*(16/9)):ow/(16/9):(ow-iw)/2:(oh-ih)/2, setdar=4/3
CustomMencoderOptions = -vf softskip,expand=::::1:16/9:2,scale=1283:720 -lavcopts aspect=16/9
6 IMPORTANT.... Play back a file and ensure zoom/aspect picture settings on your sony are set to +1 or FULL Pixel.... To do this...........
Start playing a file
Press the options button on your remote
Go to the top and picture options
Select screen
Adjust until it reads +1 or Full Pixel (depending on model it will show one or the other, some sonys may have both options, in that case select Full Pixel)
OTHER devices you will have to find the option on your TV, it will either generally be be under screen settings, aspect or similar.
Further notes
If you only have stretched/crop issues with FFMpeg just try the OverrideFFmpegVideoFilter = line if you have issues with just Mencoder enter just the CustomMencoderOptions = line, if you have had problems when using both FFMpeg and Mencoder try them both. Some device it may still not work perfectly for, but for SONY devices this should solve the issue 100% once and for all.
For anyone using a device that makes use of the Sony-BraviaEX.conf file attached is a copy of my Sony-BraviaEX.conf which now gives 100% as far as ive been able to test anyways over the past couple of days correct Aspect ratio and NO cropping and works for using both Mencoder and FFMpeg.......... I have NOT tested with subtitles, i do not use the subtitle feature in UMS so if that does not work and you really need subs you will have to experiment further.... Im happy with things as is and a picture displayed PERFECTLY! It took a hell of a lot of FFMpeg experimenting to finally get rid of crop issues.
Sony users feedback especially appreciated. Especially those that use the Sony-BraviaEX.conf renderer.
Enjoy
