Choppy Playback and Doubled Framerate

Continuing with the issues noted on SD content, the below file plays with significant choppiness (unwatchable) and at double the encoded framerate (59.94 vs 29.97). If I turn off de-interlacing, it plays at the correct framerate without the choppiness, albeit with the visible interlace lines. Makes no difference which de-interlace method is chosen. Thoughts?

MediaInfo:

General
Unique ID : 126070448607218420906039394641069664101 (0x5ED849035BC9ED970AE5C0F87B6AE765)
Complete name : Z:\TV Shows\XXXXXX\XXXXXXXX S01 E06.mkv
Format : Matroska
Format version : Version 2
File size : 767 MiB
Duration : 24 min 23 s
Overall bit rate mode : Variable
Overall bit rate : 4 394 kb/s
Frame rate : 29.970 FPS
Encoded date : 2015-11-18 02:32:21 UTC
Writing application : MakeMKV v1.9.7 win(x64-release)
Writing library : libmakemkv v1.9.7 (1.3.0/1.4.1) win(x64-release)

Video
ID : 1
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings : CustomMatrix / BVOP
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : Variable
Format settings, picture structure : Frame
Codec ID : V_MPEG2
Codec ID/Info : MPEG 1 or 2 Video
Duration : 24 min 23 s
Bit rate mode : Variable
Bit rate : 4 115 kb/s
Maximum bit rate : 9 800 kb/s
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Bottom Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.397
Time code of first frame : 01:00:00;00
Time code source : Group of pictures header
Stream size : 718 MiB (94%)
Writing library : DVDSP_MARKER_INFO 1.0 / 3 / 2143 6435429 8 Marker 1 / 41061 123306183 8 Marker 3 / 21591 64837773 8 Marker 2 /
Language : English
Default : No
Forced : No

Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Commercial name : Dolby Digital
Codec ID : A_AC3
Duration : 24 min 23 s
Bit rate mode : Constant
Bit rate : 192 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Stream size : 33.5 MiB (4%)
Title : Stereo
Language : English
Service kind : Complete Main
Default : Yes
Forced : No

Menu
00:00:00.000 : en:Chapter 01
00:01:11.504 : en:Chapter 02
00:12:00.419 : en:Chapter 03
00:22:50.068 : en:Chapter 04

It might not have been encoded well, as DVD should be OK.

You could mitigate this by setting the Hardware acceleration of MPEG2 content to HD and Up.

Hi Sam. HD and Up is already set for mpeg2. This rip was a straight rip from DVD to mkv. Not re-encoded. Likewise other DVD’s (completely different series) ripped straight to folder structure (VOB files) exhibit the same behavior—double frame rate and extreme choppiness when any deinterlace mode is active. By the way, the whitelist is not active. When I activate “Always” for hardware acceleration for mpeg, choppiness is much better but still playing at double the frame rate.

you can try to disable “Allow double refresh rates”

Why not? Whitelist all native supported resolutions of your TV/Monitor/Display and you will have less issues in the future :wink:

If deinterlacing is set to anything other than “off”, the video should be played at double frame-rate. That’s correct behaviour. (Choppy playback, obviously, is not!)

Was the TV show you’re watching shot progressively (e.g. on film) or natively interlaced (e.g. on an old-style TV camera in a studio), or a mixture of both? Unless it was shot in a progressive format, you probably do want to be deinterlacing and outputting at 59.94Hz.

It would probably be easier for the OSMC guys to help you if you post some debug-enabled logs so they can check your settings.

See here, under “Providing diagnostic logs”:

Hmm, would not have expected it to turn 30 “half” frames into 60 “full” frames. Isn’t it just duplicating frames at that point? Not sure I understand the purpose of that. Yes, the video is originally shot at 29.97 interlaced frames, the old NTSC standard for broadcast television in the U.S.

log with deinterlacing active: https://paste.osmc.tv/ijiloriwem
log with deinterlacing turned off: https://paste.osmc.tv/ibunajuhor

NTSC television is 60 fields (or “half frames”) per second. This is equivalent to 30 full frames per second, but only if the material was shot as 30fps progressive. Otherwise you have to deinterlace to 60fps.

Think I’m following. I guess I’m then questioning why it shows 30fps when it’s interlaced. Is it really showing 60 fields per second and reporting 30 frames per second?

Well, the Vero device can’t output interlaced fields: what it has to send to the TV is progressive frames. If the original material was captured as 30fps progressive and is simply being stored on the disc as interlaced (i.e. each even field was captured at the same moment in time as the previous odd field) that can be output as (say) 1080p/29.97Hz; but if it was captured as 60 fields per second (i.e. each even field was captured 1/60th of a second later than the previous odd field) then that has to be output as (say) 1080p/59.94Hz.

Video metadata and MediaInfo can sometimes get muddled between 30 frames per second and 60 fields per second. If the video file is specifying one when it should be specifying the other, that might be what’s the causing the problem.

Hopefully Sam will be able to take a look at your logs soon. You could maybe also try making a short (maybe 30-second) extract from the file; if that exhibits the same problem, uploading that will help too. You could perhaps use mkvtoolnix to make the sample and WeTransfer.com to upload it.

If it even fails with software decoding then it’s a bad rip. Because that means both hardware and software decoder (ffmpeg) can’t play it. Things might be tolerated better with ffmpeg 6 which will come with Kodi v21 but to me that sounds like a problem with the file

Sam

A couple of things:

  1. As I mentioned, the hardware decoder seems to be much better, so it’s not both software and hardware. Now your answer may simply be to just use hardware decoding. The problem with that, as the long history of advice on this board shows, is that hardware decoding doesn’t work very well on many SD files (hence your advice to switch it to HD and up). If I turn it on all the time, I’m just trading a problem with this file to a different set of files with slightly different parameters.

  2. Don’t believe it is a “bad rip”. Firstly, all of the files ripped straight from an interlaced SD DVD into an MKV container without re-encoding exhibit this behavior. Additionally, straight copies of the DVD (untouched VOB files) exhibit this behavior. While it’s possible makemkv has a longstanding unrecognized software flaw when making straight backups of DVD’s, I would have thought there would at least be more people noticing the symptoms.

  3. Is it possible that the VERO V doesn’t have the horsepower to software decode AND de-interlace mpeg 2 files? When the logger was active, I did notice a line on the screen something like KODI/OSMC CPU. With logging it was over 150%. Without logging I think it was closer to 60%. Not sure if that has any relevance or not.

  4. Perhaps a sanity check would be if someone could confirm they can play an untouched NTSC 29.97fps interlaced mpeg 2 file with hardware acceleration off and interlacing on without issue. Would love to get a piece of that file for comparison and troubleshooting.

  5. While I could certainly re-encode my files into h264 or h265 and “fix” the problem, that would come at a cost when we’re talking 100’s of files. Would be nice if it just played.

Definitely not an issue. MPEG2 is a very simple codec.

Understand. I think it would be good to get a sample. But you say you can rip a file straight from an interlaced SD DVD. How are you ripping this (specific command or program)?

I’m moving soon and plan to also back up my DVD collection so that I can store it in a lockup. I don’t want to transcode either…

To answer the backup question (I’m sure you know this) - it depends how you want to replay your backups.

  1. Backup to ISO - this will retain the disc pretty much 1:1 with menus, bonus materials etc. with the whole disc stored as a single file.
  2. Backup to Folder - the same functionality as above, but instead of storing the disc as an image, you have the files stored on the DVD retained in their folder structure. A bit less neat - but sometimes easier to handle.
  3. Backup each title on the DVD to an individual MKV file - losslessly retaining the video, audio and subtitles as originally encoded. This can cause issues with discs that have seamless branching where multiple versions are stored for replay with seamless branching. MakeMKV is a popular application for this processing.

I see I had a bit of a typo in my explanation. Just to clear it up—while I was logging the playback, there was text in the upper left of the screen. One of the data points was something like Kodi/OSMC CPU. With DEINTERLACING ON it was over 150% and with DEINTERLACING OFF it was closer to 60%. Not sure what that field is truly describing. Originally I said when LOGGING was on or off.

As far as programs, the straight conversion to an mkv container was using makemkv. You can see it in the mediainfo data. To make a 1 to 1 disc backup I’ve used makemkv (which produces an iso file that I then extract to folder structure) and DVD Decrypter which produces a straight folder structure copy. Regardless of method or software used, all files exhibit the same behavior on the Vero V.

Some additional detail. The problem exists when using full deinterlacing in software decoding in interlaced SD files. Frames are constantly skipped and dropped. CPU usage occasionally hits 100%. When using half deinterlacing or no deinterlacing, the problem resolves. I hear you Sam about the relatively simple codec, but could the problem be the horsepower needed for the deinterlacing? Or is there something else going on with the deinterlacing?

Again, if anyone has an actual clip of 29.97fps 480i content that plays correctly in software decoding with deinterlacing active, I’d love to hear about it.

Thanks all.

Ok, it appears this problem has gotten dropped.

Perhaps another question/request–is there a video clip library (various standard formats–SD, HD, 4K at different framerates and color gamuts) that the OSMC team uses to test the Vero devices when they are making changes to the software? Can this be shared?

This would be an easy way to eliminate the “it must be a bad encode” speculation as the source of a problem.

1 Like

Yes. Legally it cannot be shared.

Ok. Are any of the library clips that you test with NTSC 720X480i at 29.970fps encoded with mpeg2? If so, can you point me in the direction of where I might find such a “standard” clip?

1 Like

I am also experiencing choppy playback.
I did test various DVDs and files and noticed the following:
->playing back 4/3 pal videos leads to occasional frame skipping while skipping about 7 frames at a time (half deinterlacing and full deinterlacing)
->playing back any other format mpeg2 video leads to occasional frame skipping while skipping 1 frame at a time (using half deinterlacing) or to constant frame skipping (using full deinterlacing, after a few seconds over a thousand frames are skipped)

None of the tested videos skipped a frame using kodi on a linux machine.

Let me know if u need any logs.

1 Like

Let me start by saying I do appreciate the detailed responses from board members, particularly regarding interlacing that @angry.sardine has provided. Very helpful–thank you.

That said, I’m not sure if I’ve offended Sam, he’s busy with other things or something else but I really am just trying to solve a playback issue and I’m not getting any real support or input here. I’ve provided multiple logs and extensive descriptions of what I’m encountering and the steps I have tried to resolve it. I have also asked a handful of questions. I’ve received a few partial answers and other questions are just skipped or ignored. There doesn’t appear to be any interest in solving my issue and I don’t quite understand why. I have no problem trying to chase it down myself but it would be nice to at least get some feedback so I don’t go chasing dead-ends and waste more of my time.

As I see it, there are 3 reasonable possibilities (please feel free to chime in if you feel I left something out):

  1. All of the files (hundreds) are corrupted because of bad rips from DVD’s.

I don’t believe this to be the case because these files have been taken straight from the original DVD’s without re-encoding using multiple releases of multiple software packages and in various containers (.vob, .mkv, etc), all exhibiting the same symptoms. These files play fine on other players (Nvidia Shield, for example). However I do not have so much hubris that I would completely rule it out. I just personally rank it as a fairly low probability. It is also the one that is near impossible for me to test or troubleshoot without input from the OSMC team as I can think of no other way to get a “reference” file other than what I have already done. Sam has not responded if the OSMC team uses this particular file spec in there testing or not.

  1. There is a setting in KODI that is impeding the proper playback of this file type.

I have provided multiple logs and no feedback has been provided about the settings except to turn on HD & Up for Mpeg2 hardware acceleration. This setting was already active as such so I’m not sure the logs were actually looked at. Open to suggestions. To be clear, things I have tried is using hardware accelaration. This helped but introduced problems in other file types so my fear is I’m just trading one problem for another. Now perhaps hardware decoding for SD files isn’t introducing the issues it originally did under the Vero 4K. I will need to chase down those other files to test. Also changing de-interlacing to “half” (or off) also seems to help. I have no idea what the difference between full and half de-interlacing is or why one works and other does not. Possibility that whitelisting could be playing a role here too? Currently have it turned off (empty whitelist). Having it on created other problems with SD content.

  1. The Vero V cannot properly play 720X480i @29.97 mpeg2 with full de-interlacing in software decoding.

My suspicion is that this is really the issue. Found this post from @AC16161 in 2019: Software decoding of SD Mpeg2 very choppy - #10 by ac16161
Seems very similar to my problem. Looks like the “solution” was to re-encode every file to remove interlacing to make them more palatable for the Vero.

So my intent at this point, barring any other guidance, is to try to take the 3rd possibility off the table. It should be the easiest to eliminate as a possibility but has proven extremely difficult to do so on the board thus far. Of course, if it’s the actual answer, that would explain why it can’t be eliminated.

SO, THE HUGE ASK:

A) I would like to know if the OSMC file test library has a file of this specific type (Mpeg 2, 720X480i @29.97) that they use for testing AND which plays correctly with full-de-interlacing in software decoding. I’m not asking for the file, just if it is part of your test procedures and if it plays correctly. If the answer is “yes”, that is a critical point that would be useful for all to know. Mediainfo for said file would be extremely helpful as well, if available. If the answer is “no”. That’s ok too. It is what it is.

B) As a follow up to anyone else on this board who is so inclined, do any of you have this file type (or something close to it) playing correctly with full de-interlacing in software decoding? If it’s not working for you with those settings, that info is just as valuable. Any clips of working files you are willing to share would be extremely helpful!

Sorry for the bit of a rant but I’m growing a bit frustrated. Appreciate any and all help.

Thanks.

I’ll pick this up shortly. Not offended at all - very busy and the guys here covered most of it.