Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Solved 4:3 HEVC Videos Are Stretched to 16:9 in Kodi 20.1 on Fire TV
#1
I've found that 4:3 videos (specifically 1440x1080) are stretched to 16:9 by Kodi 20.1 for Android, when video Video settings > View mode is Normal.
Kodi 20.1 for Windows and Kodi 19.4 for Android do not exhibit this issue.
Changing video Video settings > View mode to Stretch 4:3 alleviates the issue but it's inconvenient to do this for every 4:3 video and it cannot be set as the default as doing so would negatively affect the viewing experience when watching 16:9 videos.
Is this a known issue? Is there a solution?

Thanks in advance.
Reply
#2
Under Settings > Player > Videos > Playback is a setting Display 4:3 videos as where you can choose Normal.
𝕓'𝕤𝕜𝕖𝕥𝕥𝕚
KODI v20 'Nexus' with SKIN Arctic Horizon
NAS Synology DiskStation DS212j with PVR TVheadend
HTPC Intel NUC5i5RYH with OS Windows 10
Reply
#3
(2023-05-22, 05:23)b'sketti Wrote: Under Settings > Player > Videos > Playback is a setting Display 4:3 videos as where you can choose Normal.

Thanks for the response. However, I checked this setting and it is already set to Normal.
Reply
#4
Does rotating through the zoom options have Kodi activate/find the correct aspect ratio?
Reply
#5
(2023-05-22, 08:12)Klojum Wrote: Does rotating through the zoom options have Kodi activate/find the correct aspect ratio?
If I understand your meaning:
Cycling through Video settings > View mode does not cause Kodi to find the correct aspect ratio, upon returning to Normal.
Reply
#6
Upon further inspection, I've discovered that not all 4:3 (1440x1080) videos exhibit this issue.
However, I can't find any difference between "good" and "bad" videos other than that the problematic videos were created with newer versions of ffmpeg and mkvmerge.
Since these problematic videos are properly displayed by Kodi for Windows and Plex for Android, I'm thinking this is a problem specific to the Android (Fire TV) player utilized by Kodi. Though I haven't a clue what it is about these videos that it doesn't like.

MediaInfo for a 4:3 video that is stretched to 16:9: 
https://paste.kodi.tv/aluvesukuk

MediaInfo for a 4:3 video that is respected: 
https://paste.kodi.tv/hugovazexo

Debug log from Kodi for Android, playing both of these videos:
https://paste.kodi.tv/ayibiyedew.kodi

Maybe someone can spot something that I missed.
Reply
#7
you arent able to spot the difference because you are using a more generic info tool, mediainfo

when dealing with these sorts of things it is far better to use ffmpeg

luckily, the ffmpeg output for your files is included in your log

compare lines 320 and 468

note the file which is displaying as 4:3 has it's sar and dar set correctly - SAR 1:1 DAR 4:3

the one that is being stretched has no such information present, so kodi gets to decide what to do


the resolution of your video 1440x1080 uses rectangular pixels so mathematically it can actually achieve both 16:9 and 4:3 difference being 1.33... vs 1.77...

i found a better explanation of that here - http://www.frankschrader.us/pixel-aspect...format-169


and example commandline for ffmpeg to set the dar and sar - http://underpop.online.fr/f/ffmpeg/help/...sar.htm.gz


its just because the file isnt coded properly
Reply
#8
(2023-05-24, 07:13)jepsizofye Wrote: you arent able to spot the difference because you are using a more generic info tool, mediainfo

when dealing with these sorts of things it is far better to use ffmpeg

luckily, the ffmpeg output for your files is included in your log

compare lines 320 and 468

note the file which is displaying as 4:3 has it's sar and dar set correctly - SAR 1:1 DAR 4:3

the one that is being stretched has no such information present, so kodi gets to decide what to do


the resolution of your video 1440x1080 uses rectangular pixels so mathematically it can actually achieve both 16:9 and 4:3 difference being 1.33... vs 1.77...

i found a better explanation of that here - http://www.frankschrader.us/pixel-aspect...format-169


and example commandline for ffmpeg to set the dar and sar - http://underpop.online.fr/f/ffmpeg/help/...sar.htm.gz


its just because the file isnt coded properly
Thank you very much for uncovering the issue and providing those links.
ffmpeg must have changed its behavior semi-recently as I haven't explicitly specified SAR and DAR in the past.

I suppose I can't fault Kodi for the inconsistent behavior, in the absence of proper coding.
Though it's interesting that other players preserve the aspect ratio implied by the resolution while Kodi for Android defaults to stretching.
Reply
#9
i would agree its interesting but then thats probably why the metdata was introduced in the first place, in order to tell players what it should be instead of letting it decide for itself and making a wrong decision
Reply
#10
Upon further investigation, I've discovered that this is an HEVC-specific issue as an H264 without DAR is not stretched.
As well, this is a Fire TV-specific issue as my Shield does not exhibit the same problem.
Reply
#11
Hoping it might be helpful to others - as I was referred to this thread and couldn't make sense of any of it ;)

Here's the code to batch edit the 4:3 files so that Kodi will play nice with them - 

code:
for i in *.mp4; do ffmpeg -i "$i" -aspect 480:360 -c copy "${i%}.mp4"; done

You sadly do end up with the double .mp4 extension - but that's easily enough dealt with using some nifty program with a handy GUI outside scary coder terminal world ;)
Reply
#12
code:
mkdir newfiles
for i in *.mp4; do ffmpeg -i "$i" -aspect 480:360 -c copy "newfiles/${i%}"; done
mv newfiles/*.mp4 .


no extra extensions to remove
Reply
#13
Thank you - on this aspect ratio, is that indicating pixels - or would this work just as well? 

code:
mkdir newfiles
for i in *.mp4; do ffmpeg -i "$i" -aspect 4:3 -c copy "newfiles/${i%}"; done
mv newfiles/*.mp4 .

And please ignore my idiocy - I'm just a kid in a sandbox - fascinated as to how the gurus are all so easily building their amazing castles - and I'm just all covered in mud ;)
Reply

Logout Mark Read Team Forum Stats Members Help
4:3 HEVC Videos Are Stretched to 16:9 in Kodi 20.1 on Fire TV0