"Jumpy" playback of interleaved TV recordings on Vero4k

Reproduce with:

https://drive.google.com/drive/folders/13quMekwHppsqzTLWCNYyOPpZTOP8QJf-?usp=sharing
File: tv-sd-50fps-interleaved.ts

Unmodified TS from ASTRA satellite, (German TV), PAL/SD 50fps interleaved.
Plays fine on Vero4K when disabling acceleration.

With acceleration enabled, plays back fine ONLY when exact resolution (720x576@50) is in whitelist. When disabling this resolution (or using computer display not supporting it), playback is “jumpy”. Tested with 1280x720@50 in whitelist (e.g. when reproducing, verify resolution selected on display).

This happens on any such PAL SD recording (they are always broadcast as interleaved). Problem also not specific to TS, but happens with transcoded recording (ffmpeg, x264/x265).

Running latestest Vero4k software. But i don’t think this is a new problem.

Plays fine here at 720p50Hz. Can you show us some debugs logs?

Please retry after setting “accelerate MPEG2” in player preferences to “always”. Default is “HD and up”, Which means by default the SD clip is not accelerated (it uses MPEG2).

You can check by pressing the “i” button long, and it should show:
Video Decoder: am-mpeg2 (HW)

The problem is not specific to MPEG2 but to interlaced. When i convert to H264 with ffmpeg, the problem persist. I just wanted to show the problem with the original material from TV satellite to eliminate discussions about any specific conversion afterwards.

If it works fine for you with am-mpeg2 (HW) decoder, i’ll try to pull logs of course.

That’s what I checked. Acceleration on, plays at 720p and 1080p without issues. Am I missing something?

Thanks for reconfirming. I dug deeper on my side:

a) GUI resolution 1920x1080@50, whitelist 1920x1080@50, 3840x2160@25
Playing the interlaced clip, i see how my projector tries to change display mode, but when i see a picture again, the projector claims 1920x1080@50. But the picture is jumpy.

b) removing the 3840x2160@25 from whitelist fixes the issue. Adding any other whitelist resolutions does not cause any issue, but my projector does not have any other (lower than 4k resolution) @25 display mode, and i guess the problem is with @25 resolutions.

c) Disabling HW acceleration with 3840x2160@25 in the whitelist makes vero4k+ switch to 3840x2160@25 during playback, no jumpyness.

One theory is that there is some incorrect coding in the HW acceleration including changing of display resolution, e.g.: the HW may think it did switch to a framerate of 25Hz during playback but it actually did not.

When i do the same with 1920x1080@60 instead of 1920x1080, the display also seems to want to change resolution, but then shows it has stayed on 1920x1080@60 and playback is now slowed down…

Alas, i do not have another 4k display to see if this is specific to my projector or not, but if a display has 1920x1080@50 and 3840x2160@25 then it should be possible to either reproduce the above whitelist setup and see how it plays back.

There is a bit of GUI diagnostics missing. E.g.: It would be great if the "i"nfo display would also show the screen resolution that the vero4k+ thinks it is using. If that shows different from the one the display shows (as is my theory), that would help.

I don’t think i actually ever need 3840x2160@25, because for european TV UHD (25 fps), 3840x2160@50 should also work (i am not even aware of any UHD with 25 fps), so i think i can work around this issue by just not having 3840x2160@25 in the whitelist, but maybe its interesting for you folks to look what is wrong, in case the issue also affects other whitelist combinations that may be more relevant.

Another side issue i saw was that when HW acceleration is on the in-movie video settings show “Deinterlacing off” and is greyed out (not configurable). Luckily the HW is correctly deinterlacing the videos, but its kinda weird to see a wrong unconfigurable value. If the vero4k doesn’t even let OSMC know if its deinterlacing in HW, then maybe show greyed out “Deinterlacing auto” instead. Of course for diagnostic purposes i’d love to see in 'i’nfo onscreen display whether or not the video is interlaced, but maybe the HW doesn’t provide that info…

Thanks for the research. @angry.sardine reported something similar - if both 25Hz and 50Hz are whitelisted, 50i videos start off at 25Hz then switch to 50Hz with stuttering, but if only one of 25 or 50Hz are whitelisted things go better.

It doesn’t usually bother me as the TV I use mostly doesn’t have any 25Hz modes. :stuck_out_tongue:

As for deinterlace options with hardware, no-one has yet worked out how to expose those to users.

That was an issue affecting 1080i/50 material, not 576i stuff.

I’m able to reproduce te36’s issue (I think) on a PAL DVD remux. As he says, it needs the combination of hardware decoding and having 720p/50 whitelisted, but not whitelisting 576p/50.

Can you reproduce with his file though?

Certainly some interesting stuff happening with that file. Decoding in hardware with 576p de-whitelisted it does indeed seem to have the same problem as we were having with 1080i/50 stuff - it initially switches to 1080p/25, plays in slow motion for a few seconds, then switches to 720p/50 and plays jerkily. Weirdly, if you de-whitelist 1080p/25 and 2160p/25 it starts playing at 1080p/50 and then switches to 720p/50 (without jerkiness, but it’s still strange that it doesn’t just switch straight to the final resolution). And if you play it in software but with 576p de-whitelisted then you don’t get a picture at all for quite some time - you just get audio plus the Kodi UI.

Mind you, I do wonder why te36 decided not to whitelist 576p in the first place… that seems the obvious output resolution to use for a 576i video.

You mean decided not to whitelist? I wondered the same.

Er, yeah. I meant not to whitelist. :man_facepalming: Original corrected. :slightly_smiling_face:

Interesting to hear from angry.sardine what happen immediately after starting to play back my file. My projector takes eternities to give me a picture after resolution change, but i do hear some additional clicking from the projector after the initial change, and i was wondering about that. It would be matched by angry.sardine’s observation that there are two resolution changes.

I did start whitelisting 576p initially, but the OSD really looked grizzly on a large screen (100") and just 576p (or 480p). And ultimately i also wanted to report the observations made in the hope they would help fix bugs in the kodi/vero4k code.

Ultimately, the 576p is not really that interesting, because it would still require kodi/vero4k to de-interlace, and if it’s doing the de-interlacing, then it can (IMHO) also do the upscaling (up-scaling is comparably easy).

What would be more interesting for all the good old TV series on DVD would be 480i/576i, so that one could choose that resolution to let the display do the de-interlacing, but those resolutions are not offered in the whitelists, and i am not even sure if my projector does support them.

If a display does offer 576i/480i, does osmc/vero4k offer those explicitly in the whitelist ? i only saw 1080i as the only interlaced resolution in my whitelist.

We don’t offer interlaced resolutions other than 1080i. Anyway, we can’t pass through an interlaced stream without it touching the sides. At least, we haven’t found out how to do that.

The whitelist logic works like this: video starts and is recognised as 25Hz. Search for suitable 25Hz mode at all resolutions up to 4k. If no 25Hz modes available ends up at ‘Desktop’ resolution and 50Hz. Next Kodi is monitoring the frame timestamps and thinks it’s found a 50Hz stream - search for next highest resolution than 576p at exactly 50Hz ends up at 720p50, hence resolution change if desktop was 1080p. You should be able to select a whitelist that makes only one resolution change.

The ‘next highest’ step was added for users with 4k25Hz or 50Hz but no 25/50Hz modes at 1080.

The upscaling quality on the Vero 4K is really quite poor - the algorithm is a simple bilinear scaling rather than anything more sophisticated. Most TVs and projectors can do a better job of upscaling than the Vero does, meaning the picture quality will be better if you output 576p.

The Vero’s deinterlacing quality (when decoding in hardware) used to be very good, but got much worse with the switch to the 4.9 kernel in August 2021, and hasn’t improved since. You may get somewhat better results by setting hardware acceleration for MPEG2 to “HD and up” rather than “always”, so you’re decoding 576i in software.

I’d like to see native interlaced output too, but am not holding my breath. (This isn’t a panacea, anyway - the display has to use a certain amount of educated guesswork when deinterlacing, while the player has access to all of the video file’s metadata, which can include useful hints).

The November release (I think) included a change to work around this issue with 1080i/50 material, by forcing 1080p/50 output even if 1080p/25 is whitelisted. That has some side effects under certain conditions, but is probably an improvement more often than not. It might make sense to do the same thing for upscaled 576i/50 material…?

Quite. But what I didn’t notice until recently is how it can go from 1080p50 to 720p50 if both are whitelisted because that’s what the algo finds for 25 and 50Hz respectively.

Trying to parse/understand:

a) This is specifically for vero4k, but not kodi or osmc in general ?!
b) “touching sides” mean you can not compensate for display overscan by scaling the video down ?

If i understood b) correctly, i think thats fine. I have not come across a display for at least a decade where i could not turn off overscan.

Any example of such metadata ? I am curious, because i do x264 encode those (MPEG2) SD Tv recordings, and 50% of the TV material is actually 25p (made for TV movies, like the video clip i provided). But i can not see any metadata telling that these 50i fields are actually from progressive. Obviously, i want to weave the 50i fields together before x264 encoding, whereas for real interlaced material, i want to encode it as interlaced.

I do remember that there was an anamorphic flag in those TS streams, but ffmpeg TS/meg2 decoder never supported it correctly, and it went away when the TV stations all changed their production lines to HD, so maybe only still relevant for DVD.

Kodi devs focus on PC hardware (Windows/linux) in which the output tends to be the native resolution of the display and the GPU takes care of everything. I don’t know enough about how RPis work.

What I mean by touching the sides is, vero expects to deinterlace everything that’s interlaced. So if you choose 1080i output, it will then re-interlace it. We don’t know enough about the AML proprietary micro-code to ensure each video field/frame is passed through as-is.