zoomcns wrote: ↑Sat Dec 29, 2018 1:53 am
@Paradox thanks I have now tried those. Your first suggestion doesn't make a difference at all, the picture is still fully aligned to the top. The second line does something, but the video is still not centered, the bottom black bar is about 4 times as high as the top bar.
Yep you are right for files with
incorrect multiples of resolution it still may/will not work properly (as stated i think thats down to the revision of FFMPEG they now seem to be using and it not supporting fractionals of resolutions properly).
The first revision IE (OverrideFFmpegVideoFilter = pad=max(iw*1.00\\,ih*1.00*(16/9)):ow/(16/9):(ow-iw)/16:(oh-ih)/16, setdar=4/3) will still place things right at the top as it is trying to use the fraction (the 1.00 parts of the code) of the resolution still.
The other code IE (OverrideFFmpegVideoFilter = pad=max(iw\\,ih*16/9):max(ih\\,iw/16*9):(ow-iw)/4:(oh-ih)/4, setdar=4/3) for some files as you have noticed it makes things better (adds a black bar to the top but the black bar at the top of the screen is only around half the size of the black bar at the bottom of the screen.......... At least i guess that is basically what you also see

)
The reason for that is to do with the setdar and /4 parts of the code.
Im not sure how much you or others including devs reading may or may not understand resolutions, aspect ratios and the like but ill try to explain whats going on further....
Example for a 2.40:1 (aspect ratio) 720P movie the correct resolution for encoding that movie/file (when cropping black bars) would be 1280x536... If it is that resolution then the second line i originally gave should work (i use should because god only knows what other quirks latest UMS builds and latest FFMPEG builds have) IE...
Code: Select all
OverrideFFmpegVideoFilter = pad=max(iw\\,ih*16/9):max(ih\\,iw/16*9):(ow-iw)/4:(oh-ih)/4, setdar=4/3
Because both 1280 and 536 can be divided or / by a factor of 4 equally (thats what the (ow-iw)/4:(oh-ih)/4 bit of the code does... 1280 divide by 4 is 320 and 536 divided by 4 136, FFMPEG can if it wants process a 320:156 and is happy). Thats also how things should be done when encoding as your typical codec (IE xvid, H264 etc etc like resolutions that are muliples of 4, 8 or 16).
NOW this is where the problem now occurs..............
If your movie though is something like 1280x534 or 1280x535 which ordinarily when watching on your computer or a less fussy device will still by eye look right it will not work because the 534 or 535 (height) part of the resolution will not divide by 4. (534 divided by 4 equals an odd 133.5 and 535 is a bigger mess as that divided by 4 is 133.75) and when it comes to the 16*9 and setdar bits in the code it can not place the content dead centre.... or evenly. (IE ends up not knowing what to do with the odd 0.5 or 0.75........ IE a fraction of the resolution).
Previously if you had a resolution for a file/movie which was not quite right like say the above 1280x534 or 1280x535 example, FFMPEG would to all extents basically realise when taking the input resolution and when calculating the output for transcoding use the nearest multiple of 4 to make things correct..... Does not look like UMS or FFMPEG (maybe both) will do that now.
For now i do not think there is a fool proof way around things... Using this may help SOME MORE files depends on what files you have but will STILL WILL NOT solve it 100%..........
Code: Select all
OverrideFFmpegVideoFilter = pad=max(iw\\,ih*16/9):max(ih\\,iw/16*9):(ow-iw)/2:(oh-ih)/2, setdar=4/3
Using that for MP4, MKV (stuff encoded with H264 or H265) MAY solve the issue if both your height and width resolutions of the files are multiples of 2 (or can be divided or / by 2) IE it may work for the rogue example above of 1280x534 but it will likely still give issues for say a file with 1280x535 resolution.
It MAY also have issues or introduce other issues if the file is an AVI file, particularly divx and or xvid because depending on the revision of xvid or divx the file was encoded with some of them will only work with multiples of 4, 8 or 16 (IE they stick to common encoding principles, where as H264 H265 etc can use stupid singular multiples/fractions of 1 (IE the 535 example).
Short version............ 6.9x, 7.xx (and probably since around 6.80) versions of UMS for Sony Bravia EX models made around 2011 are completely borked if you want to use FFMPEG. Its change for change sake (updating code and components/programs used within UMS from what i can see), rather than any improvement which could had been made without screwing up other devices.
Its then left to people like me that understand a bit about whats going on with Sony and such like devices to then come up with a new bodge command line to wrangle into conf files rather than the issues being fixed at the core of the program itself
For now try the code of...
Code: Select all
OverrideFFmpegVideoFilter = pad=max(iw\\,ih*16/9):max(ih\\,iw/16*9):(ow-iw)/2:(oh-ih)/2, setdar=4/3
let me know if that makes things better of worse, you can also try experimenting by altering the /2 parts of the code.... IE replace the "? " in this with numbers....
OverrideFFmpegVideoFilter = pad=max(iw\\,ih*16/9):max(ih\\,iw/16*9):(ow-iw)/
?:(oh-ih)/
?, setdar=4/3
I do not think using a "1" will make any difference (i suspect FFMPEG will just then pass the resolution 1:1 and if its an odd figure like 535 still position the movie wrongly on the TV screen, ive not had time to try over the holiday period) Using a "2" is about the best i think you are likely to get, again i and you will need to/can test
