• 1
  • 6
  • 7
  • 8(current)
  • 9
  • 10
  • 21
Solved XVID/MPEG-4/MPEG-2 files in SD quality play in slow motion
(2018-11-26, 18:20)Martijn Wrote: We either fix it, try to auto detect or do nothing at all.
I hate these (and similar) settings and they should never been added.

If one box works and the other doesn't you should go complain to the manufacturer (as they release junk) of the device and not ask us to add stupid settings.
 I don't understand your aggressive attitude towards this.

The issue with performance has nothing to do with the fact that the manufacturers deliver garbage, but weak end devices simply do not have the performance required to play the streams in question smoothly without activated hardware acceleration.

Furthermore, the two proposed settings are not new, but are already available in Kodi and only need to be activated again for Android.

It would be nice if you would reconsider, as I think these problems will affect many of your loyal Kodi fans as soon as you release Kodi 18 final.
Reply
(2018-11-27, 11:34)Mochilote Wrote: Without entering into controversies of what should be done or what can be done, the conclusions that I draw from the error of reproduction of mpeg2 by hardware are the following ones:
  1. It seems to be a particular problem with my device (Sunvell T95Z Plus/Amlogic S912 Octa-Core) and my firmware (stock 7.1.1 or 7.1.2). But it is not the first time that happens, since changes were made in the past, so there could be a lot of people affected with this problem, who knows.
  2. It is not a specific Kodi problem, since I have verified that the VLC application has the same problem.
  3. The problem occurs with all the fulldvd I've tried.
  4. Testing with files, some work well and others do not. For example, samples 12, 13, and 14 all work perfectly. So the hardware mpeg2 decoder really works well in some cases.

I have the following doubts:
  1. Can an Issue be created in the Bug Tracker with the error of reproduction of mpeg2 by hardware with samples, logs, etc. or not? (I could do it myself). It is not clear if it is a general problem or limited to few people, really. I have prepared a couple of samples, one that works well and one that does not and their debug logs in case you can find something out.
  2. If I manually disable hardware acceleration, the videos play fine, but there are 'frames skipped' frequently. The device is even able to software decode 720p files (mpeg2 and h264) perfectly so I do not understand why it has problems with MPEG2 SD content (PAL / NTSC), maybe some problem with deinterlacing. Can an Issue be created in the Bug Tracker with this problem? (I could do it myself).

Thanks in advance for your answers. 
I have also written to the technical support of the manufacturer of my device, but the truth is that I do not think they answer me.
Reply
(2018-11-27, 15:53)Mochilote Wrote: If I manually disable hardware acceleration, the videos play fine, but there are 'frames skipped' frequently. The device is even able to software decode 720p files (mpeg2 and h264) perfectly so I do not understand why it has problems with MPEG2 SD content (PAL / NTSC), maybe some problem with deinterlacing. Can an Issue be created in the Bug Tracker with this problem? (I could do it myself)
I really answered myself. The default deinterlace settings for software decoding is "Deinterlace" and it use YADIF=1:1:1, with this i get some dropped frames and a lot of skipped frames. If I change that setting to "Deinterlace Half" (YADIF=0:1:1) or Disabled, it works perfect with every file or fulldvd I've tried, so I've set by default for all the "Deinterlace Half" and now MPEG2 software decoding on my device is perfect with 0 dropped/skipped and perfectly fluid reproduction.

A bug with YADIF=1:1:1 or is my device simply not fast enough? (although it has a lot of free cpu).
Reply
No - your device is not fast enough for yadif.

I had a PR open once to change it to YADIF=0:1:1 for Android, but it was not accepted.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
(2018-11-26, 14:02)rainman74 Wrote: Before you go into every single playback problem, couldn't you take these parameters with you into the Leia build? I understood that these are available anyway, but not yet in the Android build. I think this would be important for the users at least for the final v18.

Settings > Player > Video > Accelerate MPEG2
Settings > Player > Video > Accelerate MPEG4

Never = disable hardware decoding for MPEG2 or MPEG4
Just FYI regarding these 2 options, I can see them in SPMC and seems they are hidden in KODI. I have a dvd rip I believe it's MPEG4 encoding.  I have to enable the 2 options to play it smoothly in SPMC on my Sony bravia TV. But in KODI, I can play it smoothly. So I was thinking the 2 options are enabled default in KODI. Or they are not?
Reply
(2018-11-27, 21:26)fritsch Wrote: No - your device is not fast enough for yadif.

I had a PR open once to change it to YADIF=0:1:1 for Android, but it was not accepted.
 I do not know the complexity and timing of decoding and deinterlacing in Kodi, the only thing I can say is that when the YADIF=1:1:1 method is discarding frames there is a lot of CPU idle in most of the 8 cores.

If the most common processors in the android boxes are Amlogic s905 and s912 and can not deinterlace well with that option, of course I agree with you that it should not be the default option for Android. I guess most people will run smoothly with hardware acceleration and that's why it will be considered a minor problem.

It would be great if you finally decided to enable the advanced options Settings> Player> Video> Accelerate MPEG2 / 4 on Android and / or change to "Deinterlace Half" by default, so that anyone with similar problems has it easier to make it work, but the important thing is that I can manually change it and that I have a way to make everything work perfectly.

My manufacturer has not answered to me, as expected, so for now I will be working in this way.

Thank you all for the answers.
Reply
I've tested mpeg2 CPU Software decoding and Software deinterlacing in Krypton and Leia.
Android Kodi Leia with 576i content - performance has actually gone backwards vs Kodi Krypton and it's definately worse vs SPMC. (Kodi Jarvis)

There is lots of stuttering. So even having an extra Kodi Leia Software decode option will not help for mpeg2 deinterlacing.
And this in on a S912 device that can CPU Software decode 1080p Bluray H264 Rips without an issue using Kodi Leia.

Reply
(2018-11-29, 01:51)wrxtasy Wrote: There is lots of stuttering. So even having an extra Kodi Leia Software decode option will not help for mpeg2 deinterlacing.
And this in on a S912 device that can CPU Software decode 1080p Bluray H264 Rips without an issue using Kodi Leia.
 As I mentioned a couple of days ago, the problem is in the software deinterlacer configured by default, Deinterlace (YADIF=1:1:1). If you change it to Half Deinterlace (YADIF=0:1:1) it works perfectly on the same s912 processor (I imagine that although the device / firmware is different the software performance should be the same).
Reply
Having a similar thing here with 640x480 25fps videos. The video is played in a form of slow-motion (constant identical stuttering), while the audio sounds okay. This is on a Core2duo machine with G965 graphics on Ubuntu 16.04 that didn't have this problem with Kodi 17 as far as I can remember.

Image
Reply
I've been following this thread with interest, as I shifted to using Kodi on my Fire TV Gen 2 [non-stick] device from an older Windows Media PC, and I am seeing the same framerate/playback issues with interlaced MPEG2 files (or DVD VOBs/ISOs)
My understanding of YADIF is that the first digit you are talking about changing is the "mode" value, and this has the following effect
Mode 0 : single frame rate, temporal and spatial interlacing check
Mode 1 : double frame rate, temporal and spatial interlacing check
From this, I believe that Mode 1 setting will take a 25fps interlaced MPEG2 stream and generate a 50fps progressive video stream, while the Mode 2 setting will generate a 25fps progressive video stream (from the same source). Is this correct?

So when I set the software interlacing to "Deinterlace", it uses Mode 1 and causes the the framerate "doubling", and when I select "Deinterlace (Half)" [translation difference from "Mid" I assume!], it uses Mode 0 and maintains the same framerate.

My Fire TV is using Leia RC1, while my Media PC is using Krypton 17.6.

On my Fire TV, using software "Deinterlace" [full], I can see dropped packets in the stats and the output is stuttering and not smooth. "Deinterlace (Half)" stops the dropped packets, and improves the video, but not "silky" smooth (as hardware decode is). Turning off Deinterlace makes the video smoother, but obviously has the interlacing artifacts. CPU doesn't appear to be maxing out any cores, but that is not a full accurate measurement.

On my Media PC, I see similar issues: "Deinterlace" [full] causes dropped packets and stuttering video, with the other options being much better. The CPU in my Media PC is old, but still a quad-core Q9550 2.8GHz (with 4GB RAM), and the CPU figures look very low in Kodi. [UPDATE: this issue went away when I upgrade to 64bit Leia 18 RC1 on the Media PC]

So is the framerate doubling from the deinterlacer causing issues further down the Kodi pipeline?

Interestingly: hardware decoding on my Media PC (DXVA on NVIDIA GT610) is clearly deinterlaced, whereas hardware decoding on my Fire TV (Surface) is not deinterlacing the video stream. This is checked by pausing the video and examining the interlacing artifacts onscreen.
Reply
(2018-11-29, 10:43)Lewpy Wrote: From this, I believe that Mode 1 setting will take a 25fps interlaced MPEG2 stream and generate a 50fps progressive video stream, while the Mode 2 setting will generate a 25fps progressive video stream (from the same source). Is this correct?

So when I set the software interlacing to "Deinterlace", it uses Mode 1 and causes the the framerate "doubling", and when I select "Deinterlace (Half)" [translation difference from "Mid" I assume!], it uses Mode 0 and maintains the same framerate.
Correct.
 
Quote:So is the framerate doubling from the deinterlacer causing issues further down the Kodi pipeline?
Well, drawing a frame every 40ms (50fps) or every 20ms (25fps) makes huge difference timing-wise, especially on slower hardware, even if CPU cores are not maxed out.
Reply
(2018-11-29, 10:43)Lewpy Wrote: "Deinterlace (Half)" [translation difference from "Mid" I assume!]
Sorry for this, I have the language of the program in Spanish and I assumed that the translation was 'Mid' but obviously it is 'Half'  Blush

I have changed 'Mid' to 'Half' in all previous messages, to avoid confusion.
Reply
(2018-11-29, 10:49)CiNcH Wrote:
(2018-11-29, 10:43)Lewpy Wrote: From this, I believe that Mode 1 setting will take a 25fps interlaced MPEG2 stream and generate a 50fps progressive video stream, while the Mode 2 setting will generate a 25fps progressive video stream (from the same source). Is this correct?

So when I set the software interlacing to "Deinterlace", it uses Mode 1 and causes the the framerate "doubling", and when I select "Deinterlace (Half)" [translation difference from "Mid" I assume!], it uses Mode 0 and maintains the same framerate.
Correct. 

Thanks for the confirmation Smile
(2018-11-29, 10:49)CiNcH Wrote:
Quote:So is the framerate doubling from the deinterlacer causing issues further down the Kodi pipeline?
Well, drawing a frame every 40ms (50fps) or every 20ms (25fps) makes huge difference timing-wise, especially on slower hardware, even if CPU cores are not maxed out.  

Yeah, I do get that, but I think something else is going on … I just did some crude stopwatch measuring on my Media PC of the rate of frame drops and skips while playing an MPEG2 25i stream with "Deinterlace" [full] enabled, and the combined rate of dropped and skipped frames is 25fps … the exact same extra frames created by the deinterlacer doubling the framerate.
So my thoughts are that the framerate is being doubled in the deinterlacer to 50fps, but the sections of the video pipeline "downstream" are still expecting 25fps, so are dropping/skipping the extra frames that they are receiving.
It's all conjecture, and I'd need to take a look at the Kodi code again, but it will probably take me weeks to get to the point where I understand a small part of what is going on in there Blush
Reply
Only a short objection, on low powered devices even XVID/MPEG-4 visual videos that are not interlaced but progressive jerk. But they can be played smoothly with hardware acceleration on the same device, so the suggested parameters make sense in my opinion. I also don't know why Kodi 18 uses software for such videos, this was not the case in Kodi 17.

A test video you could find here: https://forum.kodi.tv/showthread.php?tid=337440
Reply
To keep things on-forum, I just tested the MPEG2 interfaced file with my Fire TV and plugged a USB keyboard in (so I could do CTRL-SHIFT-O!).
Interestingly on Android it shows nearly all SKIPs rather than about 2:1 ratio of DROPS:SKIPS on the PC. And it SKIPs on all 3 interlace settings: Full, Half, or None. Just the rate of SKIPs varies between the settings. But it does not seem to correlate exactly to the framerate increase, unlike the PC.
I will look to update my PC from Krypton to Leia, so its more comparable.
Another fact I forgot to mention earlier is I am using 64bit Kodi Android, as my Fire TV is 64 bit (kodi-18.0-Leia_rc1-arm64-v8a).
Reply
  • 1
  • 6
  • 7
  • 8(current)
  • 9
  • 10
  • 21

Logout Mark Read Team Forum Stats Members Help
XVID/MPEG-4/MPEG-2 files in SD quality play in slow motion1