Kodi Community Forum
Screen flashes black for a fraction of a second on interlaced MPEG2 Files - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Windows (https://forum.kodi.tv/forumdisplay.php?fid=59)
+---- Thread: Screen flashes black for a fraction of a second on interlaced MPEG2 Files (/showthread.php?tid=378635)



Screen flashes black for a fraction of a second on interlaced MPEG2 Files - Rizon - 2024-08-28

I’ve been watching my Star Trek Voyager DVD rips lately and have noticed an intermittent issue.  Occasionally, the screen will flash to a black/blank screen for a fraction of a second and then continue playback as though nothing happened.

The video file I am using is an MKV, generated directly from a DVD rip in MakeMKV, it has not been remuxed or processed in any way.  I know Star Trek Voyager/Deep Space Nine do some funky things with frame rates on the DVDs so not sure if it is related to that.  DVD rips for other shows that I have watched recently do not seem to do this, which makes me feel like the Star Trek frame rate thing is related.

This occurs no more than one time per episode, usually towards the beginning (within the first few minutes) of playback, and not in every episode.  Generally, no dropped/skipped frames are recorded when this occurs.  It's just kind of a minor annoyance but mainly just curious if there is a fix for it.

I’ve tried this on my laptop (Dell Latitude 7520 w/ i7-1185G7) & my media PC (Intel NUC13ANHi7).  Both have integrated Intel graphics.  I have included details for both devices below.

I have included a debug log for playback of a file that exhibits the issue on my laptop (stopping playback & exiting Kodi shortly after the issue occurs).  I believe the issue is the following: CRenderManager initially starts the playback detecting a 29.97 frame rate (at 2024-08-28 13:19:33.789 in debug log) and plays at that frame rate.  After a while (2024-08-28 13:20:57.377), it decides the frame rate is 59.94 and switches to that.  When the switch occurs is when the screen is blank for a fraction of a second.  It then keeps that frame rate for the remainder of the file.

Laptop Info:
Kodi version: 21.1 (also occurred on 21.)
Windows 11 Pro 23H2
Intel Core i7-1185G7 / 16GB
Intel Graphics Driver: 31.0.101.5333
Audio: Realtek 6.0.9597.1 using laptop speakers

Media PC info:
Kodi Version: 21.1 (also occurred on 21.0)
Windows 11 Pro 23H2
Intel Core i7-1360p / 16GB
Intel Graphics Driver: 32.0.101.5768
Audio via Samsung TV over HDMI (uses Intel driver, I believe)

Debug log: https://paste.kodi.tv/okitodabop.kodi
MediaInfo: https://paste.kodi.tv/uwakapefad


RE: Screen flashes black for a fraction of a second on interlaced MPEG2 Files - PatK - 2024-08-29

(2024-08-28, 19:54)Rizon Wrote: Occasionally, the screen will flash to a black/blank screen
Which suggests sometimes it doesn't and just plays fine, this is one of those very hard to track down issues (is it repeatable at the same time/place with the same file?) Is behaviour immediate, or a few minutes into the video?
(2024-08-28, 19:54)Rizon Wrote: rips for other shows that I have watched recently do not seem to do this, which makes me feel like the Star Trek frame rate thing is related.
I hate to joke.. (I couldn't resist) but sounds more of the twilight zone.
(2024-08-28, 19:54)Rizon Wrote: usually towards the beginning (within the first few minutes) of playback, and not in every episode.
Once the player is working, the Kodi interface sits back for the ride. One wonders if you used an external player like VLC if there would be the same issues? Kodi can call external players External players (wiki) again repeatability is key to discovery. I didn't recall see this issue in the threads, so it's not likely there is a fix for something that is experienced by one post.
(2024-08-28, 19:54)Rizon Wrote: have integrated Intel graphics.
With shared memory.. The log has quit a few "not supported by driver" tries. The media seems to be V_MPEG2, wondering if this is a commonality? Suggest: system/player/videos refresh off, sync off, render = software (at least for a test), is it possible the flat panel is dropping handshake? To go further we would recommend a Portable mode (wiki) installation plain default.


RE: Screen flashes black for a fraction of a second on interlaced MPEG2 Files - crawfish - 2024-08-29

(2024-08-28, 19:54)Rizon Wrote: I believe the issue is the following: CRenderManager initially starts the playback detecting a 29.97 frame rate (at 2024-08-28 13:19:33.789 in debug log) and plays at that frame rate.  After a while (2024-08-28 13:20:57.377), it decides the frame rate is 59.94 and switches to that.  When the switch occurs is when the screen is blank for a fraction of a second.  It then keeps that frame rate for the remainder of the file.

I don't have an answer for you, but imagine this happening multiple times per second at many points during a program, and you'd have what we called the 29/59 bug in Windows Media Center, which affected a lot of cable and broadcast TV. Microsoft said the frame rate changes reset the video pipeline, and depending on how the card/TV responded to it, you could get anything from flickering video to stuttering to multi-second blackouts. Cable boxes were not affected by it, of course, and interestingly, neither were Media Center extenders, at least not the Linksys one I had for a little while but returned for numerous other problems it had.


RE: Screen flashes black for a fraction of a second on interlaced MPEG2 Files - CrystalP - 2024-08-29

(2024-08-28, 19:54)Rizon Wrote: I believe the issue is the following: CRenderManager initially starts the playback detecting a 29.97 frame rate (at 2024-08-28 13:19:33.789 in debug log) and plays at that frame rate.  After a while (2024-08-28 13:20:57.377), it decides the frame rate is 59.94 and switches to that.  When the switch occurs is when the screen is blank for a fraction of a second.  It then keeps that frame rate for the remainder of the file.

Your guess is correct. This is probably telecine but the flagging of the stream seems strange (progressive instead of interlaced) and mediainfo doesn't show the same thing as the ffmpeg probing. Kodi eventually detects the interlacing but not the telecine.
I'm not sure if anything can be done without breaking other cases but I could take a look if you can provide a short sample.


RE: Screen flashes black for a fraction of a second on interlaced MPEG2 Files - Rizon - 2024-08-29

Thanks for the replies!  Here are the answers to the questions.
(2024-08-29, 03:45)PatK Wrote:
(2024-08-28, 19:54)Rizon Wrote: Occasionally, the screen will flash to a black/blank screen
Which suggests sometimes it doesn't and just plays fine, this is one of those very hard to track down issues (is it repeatable at the same time/place with the same file?) Is behaviour immediate, or a few minutes into the video?
It is always in the same time/place in the files/episodes that are affected, but not every episode is affected.  It usually occurs within the first few minutes if it is going to occur in a file.  In the file I logged, it occurs at approximately 1:23 into the video.  I think the longest into an episode I've seen it occur was around 4-5 minutes.
(2024-08-29, 03:45)PatK Wrote:
(2024-08-28, 19:54)Rizon Wrote: usually towards the beginning (within the first few minutes) of playback, and not in every episode.
Once the player is working, the Kodi interface sits back for the ride. One wonders if you used an external player like VLC if there would be the same issues? Kodi can call external players External players (wiki) again repeatability is key to discovery. I doubt recall see this issue in the threads, so it's not likely there is a fix for something that is experienced by one post.
It does not occur in VLC, at least with VLC's default settings.
(2024-08-29, 03:45)PatK Wrote:
(2024-08-28, 19:54)Rizon Wrote: have integrated Intel graphics.
With shared memory.. The log has quit a few "not supported by driver" tries. The media seems to be V_MPEG2, wondering if this is a commonality? Suggest: system/player/videos refresh off, sync off, render = software (at least for a test), is it possible the flat panel is dropping handshake? To go further we would recommend a Portable mode (wiki) installation plain default.
I have only noticed it on my Star Trek Voyager DVD rips (all MPEG2) so far.  DVD rips for other movies/shows (also MPEG2) that I have watched with Kodi seem fine on my systems.  I tried a Portable Mode install of 21.1 and the issue occurs there as well with the Refresh Rate Adjust off, Sync to Display off, and Software render mode.
 
Quote:Your guess is correct. This is probably telecine but the flagging of the stream seems strange (progressive instead of interlaced) and mediainfo doesn't show the same thing as the ffmpeg probing. Kodi eventually detects the interlacing but not the telecine.
I'm not sure if anything can be done without breaking other cases but I could take a look if you can provide a short sample.
I have seen people talking about the DVD's for Star Trek Voyager being telecined, so that may be it (probably explains the frame rate funkiness I mentioned too).  I have cut down the file to the first ~2 minutes with AVIdemux and uploaded to my Google Drive.  The issue occurs on my systems at ~1:23 into the file (shortly after we see the girl in the forest).  If there's a better way to upload the sample, let me know.  Definitely understand not wanting to break other cases, mainly just posted to see if there was a quick fix.  It's just a minor annoyance to me on an otherwise great program!

Here is the link to it on my Google Drive if you want to take a look: https://drive.google.com/file/d/18AQMzw8mhW4foeUcLTUQ4xYOSW-8abaS/view?usp=sharing


RE: Screen flashes black for a fraction of a second on interlaced MPEG2 Files - CrystalP - 2024-08-30

Thanks, it looks like something called soft telecine. In the best case players can show the original progressive frames at 24fps. Maybe Kodi's support was broken at some point. I'll see if I can find something, but I'm not really familiar with that code or mpeg-2/dvd handling.


RE: Screen flashes black for a fraction of a second on interlaced MPEG2 Files - PatK - 2024-08-30

As a side note: I downloaded your sample, I saw the gliche at the exact point you mentioned, some bit pixel chaff over the body on the ground for a few frames, then a complete black frame, and usually it plays on but in one instance Kodi exited at that exact point (I tried this a number of times to confirm). My conclusion is the file encode is at fault, (consider I have totally different equipment win10/64 NVIDIA).


RE: Screen flashes black for a fraction of a second on interlaced MPEG2 Files - Rizon - 2024-08-30

Thanks for the info! I found this page looking for info on soft telecine - it looks like it (at least partly) may be MakeMKV not handling telecine flags from the DVD properly.  Looking at my Star Trek Voyager rips in MediaInfo, a lot of them have varying frame rate numbers (usually in the 24.00-24.99fps range) and some show progressive scan type while some do not.  Maybe it just depends on how much 23.976fps vs 29.97fps (or hard vs soft telecined) content is in the source as to how the resulting file is tagged or interpreted.

So maybe just a case of MakeMKV not handling the telecine flags properly leading to the file being tagged/interpreted oddly and not all players handling the resulting file gracefully, so maybe just something I have to live with.  Once the 59.94 frame rate is detected and changed the video plays perfectly to my eyes (well, at least as perfect as DVD video from the 90's can!) so certainly not a huge deal if I have to deal with a black frame towards the beginning of some episodes.