OpenELEC / OpenELEC.tv

OpenELEC - The living room PC for everyone
http://openelec.tv
1.61k stars 883 forks source link

Choppy 1080p MPEG2 video since 6.0.0 #4943

Open adv111 opened 8 years ago

adv111 commented 8 years ago

I've been using OpenELEC on an Intel NUC (DCCP847DYE) since version 3. Version 3, 4, and 5 all work great.

Starting with version 6.0.0, and continuing with the beta versions of 7 (i.e., 6.95.xx), I'm unable to play MPEG2 1080i video at 1080p without seeing a ton of choppiness, especially when watching video that includes motion. If I reduce the resolution to 1080i, it gets much better, but it doesn't really go away until I reduce the resolution to 720p. At 720p, motion becomes very fluid.

Again, with 5.0.8, motion was completely fluid even at 1080p, but starting with 6.0.0 and up to the latest April 2016 beta release, motion is very jerky and choppy unless I reduce the resolution to 720p.

My logs show nothing unusual when these issues occur. When I bring up the data overlay (bunch of text lines and numbers in the top left), I notice that the newer versions of OpenELEC (which have the problems) show many dropped and skipped frames, where the older version will show 0 or 1 when playing the same file.

I've also noticed one other difference. On Line W, on the older versions of OpenELEC, it'll show the actual fps, but on the newer versions, the FPS line is missing, i.e. on 5.0.8:

W(fps:59.94, CPU0: ...)

On the newer versions:

W(CPU0: . . .)

I've seen a number of complaints in the forums about this same issue, but with no response from the devs. See the following links:

http://openelec.tv/forum/116-vaapi-intel/77875-video-stutter-5-95-3-x86-64

http://openelec.tv/forum/116-vaapi-intel/81336-poor-motion-quality-with-newer-releases-of-openele

http://openelec.tv/forum/116-vaapi-intel/79224-asrock-beebox-n3000-vc-1-visual-artifacts

fritsch commented 8 years ago

No debuglog no issue.

Make sure Deinterlace is set to Auto (never to On) and use VAAPI-BOB as deinterlacing method for all other methods this ancient NUC is too slow.

2016-05-06 1:23 GMT+02:00 adv111 notifications@github.com:

I've been using OpenELEC on an Intel NUC (DCCP847DYE) since version 3. Version 3, 4, and 5 all work great.

Starting with version 6.0.0, and continuing with the beta versions of 7 (i.e., 6.95.xx), I'm unable to play MPEG2 1080i video at 1080p without seeing a ton of choppiness. If I reduce the resolution to 1080i, it gets much better, but it doesn't really go away until I reduce the resolution to 720p.

My logs show nothing unusual when these issues occur.

I've seen a number of complaints in the forums about this same issue, but with no response from the devs. See the following links:

http://openelec.tv/forum/116-vaapi-intel/77875-video-stutter-5-95-3-x86-64

http://openelec.tv/forum/116-vaapi-intel/81336-poor-motion-quality-with-newer-releases-of-openele

http://openelec.tv/forum/116-vaapi-intel/79224-asrock-beebox-n3000-vc-1-visual-artifacts

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/OpenELEC/OpenELEC.tv/issues/4943

               Key-ID:     0x1A995A9B
               keyserver: pgp.mit.edu

Fingerprint: 4606 DA19 EC2E 9A0B 0157 C81B DA07 CF63 1A99 5A9B

adv111 commented 8 years ago

Thank you for taking the time to respond. I'm going to get you a debug log both for 5.0.8 and for the latest beta as soon as I can.

I do have deinterlace and method set to auto on both systems. Similar issues when running on an i3.

Changing to VAAPI Bob breaks video altogether. Screen goes black.

fritsch commented 8 years ago

5.0.8 is irrelevant. Cause at this time the 847 was not able to deinterlace anything. If your i3 also goes blank - you have a big problem ...

It would be best to test nightly builds - upcoming OE will ship v16, which is not developed anymore.

PS: I run an i3 myself - without a single issue. So for now the problem is not common.

2016-05-06 7:50 GMT+02:00 adv111 notifications@github.com:

Thank you for taking the time to respond. I'm going to get you a debug log both for 5.0.8 and for the latest beta as soon as I can.

I do have deinterlace and method set to auto on both systems. Similar issues when running on an i3.

Changing to VAAPI Bob breaks video altogether. Screen goes black.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/OpenELEC/OpenELEC.tv/issues/4943#issuecomment-217353195

               Key-ID:     0x1A995A9B
               keyserver: pgp.mit.edu

Fingerprint: 4606 DA19 EC2E 9A0B 0157 C81B DA07 CF63 1A99 5A9B

adv111 commented 8 years ago

Sorry, I didn't quite understand your response, so I need to ask for some clarification.

  1. Why is 5.0.8 irrelevant?? Isn't the fact that it worked, and 6.0.0 and up didn't important somehow?
  2. What do you mean "at this time 847 was not able to deinterlace anything"??
  3. My i3 doesn't go blank. Only the Celeron and only when I select VAAPI Bob I haven't tested the i3..
  4. Do you run an i3 NUC? Same graphic chipset as the NUC?
fritsch commented 8 years ago

1.) 5.0.8 - does not help, cause it did not have the capabilities to deinterlace. So as you now have problems with Deinterlacing ... it's quite obvious why 5.0.8 was fine 2.) No VPP driver support for 847 - since Version 6 we ship VPP capabilities. It's quite obvious that the slowest of the slow have performance issues with post processing - isn't it? Turn deinterlace to "Off" and you have what you had before 3.) okay 4.) No Zotac CI520 a very slow i3 with reduce gpu speed.

2016-05-06 8:12 GMT+02:00 adv111 notifications@github.com:

Sorry, I didn't quite understand your response, so I need to ask for some clarification.

  1. Why is 5.0.8 irrelevant?? Isn't the fact that it worked, and 6.0.0 and up didn't important somehow?
  2. What do you mean "at this time 847 was not able to deinterlace anything"??
  3. My i3 doesn't go blank. Only the Celeron and only when I select VAAPI Bob I haven't tested the i3..
  4. Do you run an i3 NUC? Sam graphic chipset?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/OpenELEC/OpenELEC.tv/issues/4943#issuecomment-217355645

               Key-ID:     0x1A995A9B
               keyserver: pgp.mit.edu

Fingerprint: 4606 DA19 EC2E 9A0B 0157 C81B DA07 CF63 1A99 5A9B

adv111 commented 8 years ago

Thank you again for responding, but I'm afraid you're mistaken on several key points.

5.0.8 definitely had the ability to deinterlace. In fact, every version I've ever used (starting at 3.xx) had the ability to deinterlace. Most of the content that i watch is interlaced OTA HDTV in North America. I'd notice if deinterlacing wasn't working, and I've tested every version with deinterlacing enabled and disabled and with different deinterlacing methods.

Also turning off deinterlacing in 6.xx definitely does NOT resolve the problem. In fact, the problem doesn't really change at all when you turn off deinterlacing. The choppiness and frame loss continues almost the same.

I've personally tested with an i3 NUC and had the same problems. And other users are reporting the same isues with other i3 based NUCs.

It seems that there may be an issue with something that was changed when you jumped from 5.0.8 to 6.x. that is impacting the Intel video chipsets used in the NUCs.

fritsch commented 8 years ago

You seem to know better than me (who is writing the VAAPI code) - so I wish you good luck solving your issue. And thanks again for your debuglog.

fritsch commented 8 years ago

Ah - I just verified it. OE 5.0.8 shipped Helix which in deed already had VPP: https://github.com/xbmc/xbmc/commits/Helix/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp

So basically you are saying: VAAPI-BOB worked in 5.0.8 but VAAPI-BOB does not work in 6.0.8?

I cannot help you without a debuglog that shows the issue. Post a debuglog with this sample: http://solidrun.maltegrosse.de/~fritsch/1080i50_h264.ts

One with VAAPI-BOB and one with just "BOB" which will use the OpenGL renderer.

adv111 commented 8 years ago

Hi Peter,

Thanks for following up on this, especially since I was telling you something that you believed was incorrect.

I will probably get a debug log up later today, and if not today, on Saturday.

Just to clarify:

  1. My primary complaint is very choppy 1080p video when watching MPEG2 OTA HDTV that was recorded using Windows Media Center. On 5.0.8, it worked fine. On 6.xx and up, I have to reduce the resolution to 720p to eliminate the choppiness. When I watch, I tend to have deinterlace set to AUTO and deinterlace method set to AUTO.
  2. At your request I tried turning off deinterlace and found that the problem persisted. Of course, I also saw artifacts from the fact that the video wasn't being deinterlaced, but those were completely separate.
  3. At your request, I tried setting the Deinterlace Method to VAAPI Bob. On 5.0.8, it works just fine. On 6.xx and up, the video immediately froze while the audio continued working just fine. If I attempted to play the video again, I just saw a black screen while I heard the audio. If I set the Deinterlace Method to Bob (without the VAAPI at the beginning), the video played but continued to have the choppiness. If I turned deinterlace OFF, the choppiness continued, but I also saw artifacts resulting from not having the video deinterlaced.

Again, I'll attempt to get you debug logs later today.

And again, thank you very much for your time and assistance. I really enjoy using OpenELEC and am grateful both for the product and for the time that you devote to it.

fritsch commented 8 years ago

What I don't get is, that you write sooo much text, while a simple debuglog would directly show the issue, especially with that known sample ...

adv111 commented 8 years ago

Log attached. kodi.log.txt

adv111 commented 8 years ago

I know that you said that 5.0.8 is irrelevant, but I noticed that when I make a debug log for 5.0.8, when playing OTA HDTV MPEG 2 recordings, it shows 60 fps. But, when I make a debug log for 6.0.3 playing the same files, it shows that its playing at 29 fps.

fritsch commented 8 years ago

There is lot more broken than just VAAPI. Please reproduce with a nightly build (kodi v17) and file a bug against kodi on trac.kodi.tv and also supply a sample. The Closed Captions decoder seems to go nuts - which was not implemented in kodi v14.

Nightly builds can be found in the sticky thread in the linux forum. From a dev point of view version 16 of kodi is not developed anymore.

adv111 commented 8 years ago

Hi Peter,

Thanks again for looking at this for me.

I'm not finding a Linux sub-forum in the OpenELEC forums. Can you give me more information about how I'm going to find a nightly build of OpenELEC so that I can do as you've suggested?

islipfd19 commented 8 years ago

The latest nightlies can be found here:

adv111 commented 8 years ago

Thanks again. I take it that you view this as entirely a Kodi problem and not an OpenELEC issue at all?

adv111 commented 8 years ago

Hi Peter,

I opened up a ticket with Kodi, but I don't think that this is a Kodi problem.

I installed Kodi for Windows on an i5 machine with intel HD 5500 graphics and everything works great. I then installed the latest OpenELEC beta on that very same machine and had all sorts of video quality issues.

That makes me think that this is an OS/Video Driver issue, rather than a Kodi issue.

Is there anything else that I can supply you to help get to the bottom of this?

fritsch commented 8 years ago

Please don't reproduce with "latest beta" as this is v16 based, which did not get the EGL rewrite for intel and puts double the pressure on the hardware. We won't solve any v16 bugs anymore as v17 development has started.

And windows != linux obviously :-) I hope you filed the bug with a milhouse nightly build. Also link to the trac record here.

adv111 commented 8 years ago

I finally got a chance to test the nightlies that you linked to. Same problem. Lots of random choppiness when playing Mpeg2 videos, especially when the video pans (shows a moving scene from one side to the other).

Debug log is attached. In this log, I replay a single scene three or four times (starting at 2:50) and experience choppiness in various spots (but not the same spots) almost every time.

I hope you fix this before this releases. Otherwise, this will be the third major version of OpenELEC that won't play MPEG2 files properly.

kodi.log.txt

fritsch commented 8 years ago

Don't confuse mpeg-2 with what you are playing. Your issue has nothing to do with mpeg-2 but with a broken subtitle stream your wtv files have embedded.

21:24:29 T:140293328320256 INFO: ffmpeg[7F9895FFB700]: Stream

0:3[0x8ba]: Subtitle: eia_608

See, standard mpeg-2 file works perfectly: http://solidrun.maltegrosse.de/~fritsch/1080i59.94_mpeg2.ts

2016-05-28 23:35 GMT+02:00 adv111 notifications@github.com:

I finally got a chance to test the nightlies that you linked to. Same problem. Lots of random choppiness when playing Mpeg2 videos, especially when the video pans (shows a moving scene from one side to the other).

Debug log is attached. In this version, I replay a single scene three or four times (starting at 2:50) and experience choppiness in various spots (but not the same spots) almost every time.

I hope you fix this before this releases. Otherwise, this will be the third major version of OpenELEC that won't play MPEG2 files properly.

kodi.log.txt https://github.com/OpenELEC/OpenELEC.tv/files/288021/kodi.log.txt

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OpenELEC/OpenELEC.tv/issues/4943#issuecomment-222330737, or mute the thread https://github.com/notifications/unsubscribe/ABCfHfpYCB4yXx6tw7qKHbufcFvhkDMEks5qGLUagaJpZM4IYeVD .

               Key-ID:     0x1A995A9B
               keyserver: pgp.mit.edu

Fingerprint: 4606 DA19 EC2E 9A0B 0157 C81B DA07 CF63 1A99 5A9B

fritsch commented 8 years ago

I will workaround in kodi for now. But I need a sample that shows the issue.

adv111 commented 8 years ago

Hi Peter,

The files that I'm trying to play are TV shows that were recorded with Windows Media Center. They are .wtv format files. They play just fine in Kodi for Windows and played just fine with OpenELEC 3.2.4 through 5.0.8.

I understand that you're probably seeing log related issues with the "subtitles," but these files don't have subtitles. They probably do have closed captions encoded, but Kodi has never been able to play them.

I'm happy to supply a sample. As you can imagine, the files are rather large. I can try to get a 30 minute TV show uploaded to my OwnCloud or Dropbox, or I can just do a short recording of 30 seconds or so. Does it matter to you which I provide?

fritsch commented 8 years ago

Just cut out a 50 MB piece of the recording.

dd if=filename of=filename2 bs=1M count=50

And upload it somewhere. Also provide a log with windows kodi succesfully playing them.

adv111 commented 8 years ago

Hi Peter,

Thank you again for your help with this. I've emailed you a link that you can use to download a sample .wtv file and the Windows Kodi log (remember that it plays fine on Kodi for Windows but you asked for a log). I sent it to your xbmc.com address.

The sample file is 100mb so that you can get the entire intro, which has several scenes that experience the issue in OpenELEC versions after 5.0.8.

fritsch commented 8 years ago

Already downloaded. The windows log shows the very same error with the subs. So fixing the subtitle decoding is not wrong per se. I'd like to have an OpenELEC log with Deinterlace = Off and Prefer VAAPI Render Method = On with a v17 version (Milhouse build), please.

As I must admit - the sample does not play on my setup at all.

07:42:47 T:140288244832000 ERROR: CVideoPlayerAudio::DecodeFrame - Decode Error. Skipping audio packet (-1094995529)

Edit: I forwarded the sample to our chief VideoPlayer architect. Let's see what he thinks about it.

fritsch commented 8 years ago

Lol. It plays - i found another bug while testing. When having advancedssetings.xml with force buffer of a file size > video size -> it does not start to play.

So all fine in that regard. Here is a logfile from my system: http://sprunge.us/gbSg perfectly fine with VAAPI. I will provide another log with the suggested CC subtitle fix.

With my subtitle fix from above: http://sprunge.us/fSZH all the subtitle decoding errors are gone. Now curious on your log with the named settings. For now it's something special to your system as I cannot reproduce at all.

adv111 commented 8 years ago

When you play it, watch the video carefully. At least on my unit, the video jumps around and frames are dropped massively.

Are the dropped frames reflected in my logs? Are they not reflected in your logs?

fritsch commented 8 years ago

Nothing dropped - see the log yourself. Even the OSD is perfectly fine. I don't have your massive ffmpeg errors.

adv111 commented 8 years ago

I'm not able to make much sense of my log, partly because there are no linefeeds in it.

What would be causing my "massive ffmpeg errors"??

fritsch commented 8 years ago

As I said before, try with the setting I suggested and post another debuglog. If you have a setting in bios for GPU Memory, set that from Auto to 128M.

wtv1

wtv2

Try it on your windows computer by booting OpenELEC live from an USB stick (again not v15 and not v16, cause we don't develop those anymore).

The drops: 3 are from video start as it's not cleanly cut at an iframe.

adv111 commented 8 years ago

It's past midnight here now. Tomorrow, I'll try again with the nightly build both on my Windows machine and on my Intel NUC and will post debug logs.

adv111 commented 8 years ago

And by "my windows machine," I mean the machine that I normally run windows on, but I'll boot from my USB stick with OpenELEC on it instead..

I should add that I normally play these files in whole (many gb) via a network drive. So, if you're not seeing anything, it could be the file size or a network issue that's causing the problems.

adv111 commented 8 years ago

Debug log watching the 100mb file locally with deinterlacing OFF and prefer VAAPI enabled (which was the default) is attached. Still experienced quite a few noticeable frame drops.

Please let me know what you find. kodi.log.txt

fritsch commented 8 years ago

08:04:21 T:140056597763840 DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:7.718079, adjusted:7.718079 08:04:21 T:140056529258240 WARNING: Decode - avcodec_decode_subtitle didn't consume the full packet 08:04:21 T:140056512472832 WARNING: Previous line repeats 6 times. 08:04:21 T:140056512472832 DEBUG: CVideoPlayerVideo::CalcDropRequirement

  • dropped in decoder, lateframes: 1, Bufferlevel: 3, dropped: 2

-> Wait until LibreELEC / OpenELEC picks the subtitle fix and then retry. As said I sadly cannot reproduce. Let's see what your windows computer will do with a recent OpenELEC / LibreElec. I will push the subtitle fix to kodi's master now. So give the "nightly builds" some days time until they catch up.

2016-05-31 10:07 GMT+02:00 adv111 notifications@github.com:

Debug log watching the 100mb file locally with deinterlacing OFF and prefer VAAPI enabled (which was the default) is attached. Still experienced quite a few noticeable frame drops.

Please let me know what you find. kodi.log.txt https://github.com/OpenELEC/OpenELEC.tv/files/290587/kodi.log.txt

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OpenELEC/OpenELEC.tv/issues/4943#issuecomment-222619767, or mute the thread https://github.com/notifications/unsubscribe/ABCfHXh-ojVW_81VDKzvD66XqUPvyV0Uks5qG-xZgaJpZM4IYeVD .

               Key-ID:     0x1A995A9B
               keyserver: pgp.mit.edu

Fingerprint: 4606 DA19 EC2E 9A0B 0157 C81B DA07 CF63 1A99 5A9B

adv111 commented 8 years ago

Do you think that it's likely that my Intel NUC is choking on the subtitle bug and that's what's causing the video to stutter?

In other words, if I had a faster machine, the subtitle bug would still log errors but would not affect the video?

And once the subtitle bug is fixed, the video problems may resolve?

I'll post a debug log from my faster machine (Core i5) later today.

fritsch commented 8 years ago

Yes, that's possible. I pushed the fix to kodi's master. So make sure you test a very recent nightly OpenELEC build with today's code - then we know.

adv111 commented 8 years ago

Okay, here's a log playing the same file on my Core i5 machine (normally my Windows machine), but I booted into OpenELEC using a USB drive. I still observed some stuttering on the video playback and there were a few dropped frames, but they didn't always coincide with the stuttering that I observed when playing back the video. Please let me know what you see/think. kodi.old.log.txt

adv111 commented 8 years ago

Also, should I just watch that link you posted earlier for nightlies, or is there another place I should go to find the very latest build of OpenELEC with the subtitle bug fixes you talked about?

fritsch commented 8 years ago

Sorry no idea - I am kodi upstream dev, here it is integrated: http://forum.kodi.tv/showthread.php?tid=269815&pid=2348968#pid2348968 - other OpenELEC nightlies might exist.

adv111 commented 8 years ago

I'm not really sure how to use that. If you happen to run across a new image that I can test, please let me know.

Thanks!

CvH commented 8 years ago

@adv111 create an backup, put .tar in update folder, reboot tar from here (first post of this linked thread)

adv111 commented 8 years ago

I updated, and am still having the very same problem. Debug log is attached.
kodi.log.160604.txt

fritsch commented 8 years ago

19:06:14 111.205910 T:139759535220480 DEBUG: CVideoPlayerVideo::CalcDropRequirement - dropped in decoder, lateframes: 1, Bufferlevel: 3, dropped: 2 19:06:15 111.483864 T:139759500162816 DEBUG: Previous line repeats 1 times. 19:06:15 111.483910 T:139759500162816 DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:17.195473, adjusted:17.195473 19:06:15 111.771568 T:139759535220480 DEBUG: CVideoPlayerVideo::CalcDropRequirement - dropped in decoder, lateframes: 2, Bufferlevel: 3, dropped: 2 19:06:15 111.937309 T:139759535220480 DEBUG: CVideoPlayerVideo::CalcDropRequirement - dropped in decoder, lateframes: 3, Bufferlevel: 3, dropped: 2 19:06:16 112.533852 T:139759500162816 DEBUG: Previous line repeats 3 times. 19:06:16 112.533905 T:139759500162816 DEBUG: CDVDClock::ErrorAdjust - CVideoPlayerAudio::OutputPacket - error:-454.114540, adjusted:-454.114540 19:06:16 112.536743 T:139759535220480 DEBUG: CVideoPlayerVideo::CalcDropRequirement - dropped in decoder, lateframes: 4, Bufferlevel: 3, dropped: 2 19:06:16 112.837334 T:139759535220480 DEBUG: Previous line repeats 1 times. 19:06:16 112.837387 T:139759535220480 DEBUG: CVideoPlayerVideo::CalcDropRequirement - dropped in decoder, lateframes: 5, Bufferlevel: 3, dropped: 2 19:06:16 113.335098 T:139759535220480 DEBUG: Previous line repeats 4 times.

From the log it's clear. Your system is not performant enough to playback those files. As it was able to play them with an ancient OpenELEC edition, it's a performance regression. Go to trac.kodi.tv and file a bug report with old version running the very same file succesfully as this new version. A debuglog of both is needed.

adv111 commented 8 years ago

Hi Peter,

I'm seeing the same issues with a relatively new (<1 year) Toshiba Laptop using a Core i5 (Mobile), though with fewer dropped frames. That same Toshiba can play the files just fine when running Windows 10 with Kodi. That state of affairs makes me think that the issue is OpenELEC and drivers, rather than a Kodi issue. BUT- I'm not a programmer and admit that I have almost no idea what I'm doing here.... :)

I'll generate debug log with the older version in the next hour and open a ticket at trac.kodi.tv.

Which version should I open the ticket on? 17.0?? Which component?

I'll provide a link here once I do so.

fritsch commented 8 years ago

Only latest master -> v17. All other versions are not developed anymore.

adv111 commented 8 years ago

Here's the log on the older build, with the same machine. It appears to run with no trouble.

(REMOVED because it wasn't comparable. See below for comparable log).

adv111 commented 8 years ago

Ticket opened..

http://trac.kodi.tv/ticket/16755

Any thoughts on that log running without trouble?

fritsch commented 8 years ago

This log is not comparable as VAAPI NV12 was in use. Make fully sure you use the very same settings, in that case: Deinterlace (which you most likely had on AUTO) this time, which will user RenderBob by default + see copy.

adv111 commented 8 years ago

Okay, I'll do a new log on the old system with deinterlace OFF, and I'll post it here and to the kodi ticket..

adv111 commented 8 years ago

Okay. New log on old. slower system that does not drop frames with Deinterlace OFF is attached.

Thank you for your patience with me. kodi.log.160404.OLD.txt