Kodi Community Forum
Linux HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Tips, tricks, and step by step guides (https://forum.kodi.tv/forumdisplay.php?fid=110)
+--- Thread: Linux HOW-TO achieve perfect playback at 23.97 or 59.94 Hz with NVIDIA GPU hardware (/showthread.php?tid=70068)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36


Interlaced playback - Rachel - 2010-11-23

I have some videos that I've been unable to detelecine satisfactorily (more below on that for the interested). I now want to give up and just play the interlaced source material in an interlaced screen mode to the TV and let the TV do its thing with it. Smile It plays interlaced source material (HD and SD) off air all the time and occasionally from blurays, so I know that works.

Having an nVidia ION system (Acer Revo) and having set up my xorg.conf according to the instructions on post 1 of the thread, I see it includes what seem to be the appropriate modes (excerpted from xorg.conf):

Code:
Section "Screen"
        Identifier      "screen"
        Device          "nvidia"
        SubSection      "Display"
                Modes "1920x1080_50" "1920x1080_50i" "1920x1080_60_0" "1920x1080_60i" "1920x1080_24"
        EndSubSection
EndSection

#  --- Modes in ModePool for Panasonic-TV (DFP-1) ---
...
#  "1920x1080_60i"      : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 5)
#  "1920x1080_50i"      : 1920 x 1080 @ 50 Hz Interlace (CEA-861B Format 20)
...
#  --- End of ModePool for Panasonic-TV (DFP-1): ---

Specifically, 1920x1080_50i and 1920x1080_60i, which I've now added to my Modes line.

However, when I play an interlaced source that should match one of these, I don't think XBMC is selecting the right mode, but it sticking to progressive-scan modes. This I'm assuming because I'm still seeing jerky movement and combing artefacts.

So the first thing is, how can I actually confirm in real time what screen mode is in use during playback? It's not in the codec information (O), at least not in any obvious way, and it escapes me where it might be.

And the second thing is, assuming it's not already doing so (and just not working very well), how do I make XBMC switch to one of these interlaced modes when the source is interlaced?

I do of course have "Adjust display refresh rate to match video" selected in settings->Video->Playback. But there's nothing there to distinguish between progressive and interlaced modes. Neither is there in Settings->System->Video output, where it just lists "Fullscreen #1" 1920x1080 and "Windowed", which doesn't work because it's running standalone; and for refresh rates just 60, 50 and 24Hz. And of course I'm not using any deinterlace method in OSD video settings.

---

The problem:

The BBC makes programmes for transmission in 1080i @ 50Hz. For *transmission* over Freesat or Freeview these are encoded (at a controversially low bitrate) in h.264)

But the bluray releases are usually mastered using VC1-interlaced. ffmpeg can't read these, so xbmc can't play the raw rips directly, nor can HandBrake transcode them. So I use RipBot264 under Windows (which uses DirectShow via AviSynth to decode the original) to transcode to a good quality h.264 rip that xbmc can play.

*Some* of these blurays retain the 50Hz (25fps interlaced) of the original programme. These rip beautifully to a 1080p 25fps h.264 video that xbmc plays perfectly. No problem there. Now I have some avisynth understanding I may apply a nice decomb to some of them and re-rip, but that's it.

Others are telecined to 29.97fps interlaced, presumably for the US market even though these are region-coded for britain and europe, and these are the problem files. After ripping normally, they exhibit an intolerable juddering on certain kinds of motion, especially sideways pans. It's actually headache-inducing.

I have tried for an unreasonable amount of time with avisynth plugins to find a way to detelecine these satisfactorily back to a good 25fps video. Nothing worked well and I'm giving up. (I could go on at great length about my tribulations there - they don't even use the same telecine pattern on different discs and even those I can detelecine right end up with sound drifting slowly out of sync.)

I found a way to make RipBot264 transcode the vc1-interlaced source to a h.264 interlaced output (by adding --tff to the x264 options string) and it's these files I want xbmc to be able to play having selected an interlaced screen mode so the TV gets it in interlaced form.

As an aside, having got an interlaced source that handbrake *could* read, I gave it to that to see if it could detelecine it nicely. In fact, using handbrake's High Profile preset, which enables detelecine and decomb by default with default options, but not changing frame rate, gave me the most watchable versions yet. Still not right, but less bad than anything else I've tried. I think its decomb is smoothing it out to an extent.

I didn't want that to be the solution anyway, as double-encoding sucks. Smile


- tripkip - 2010-11-23

Do we still need to do this with RC1?


- Rachel - 2010-11-23

Rachel Wrote:I have some videos that I've been unable to detelecine satisfactorily (more below on that for the interested). I now want to give up and just play the interlaced source material in an interlaced screen mode to the TV and let the TV do its thing with it. Smile It plays interlaced source material (HD and SD) off air all the time and occasionally from blurays, so I know that works.

(etc)

I remembered I live in Britain and don't have any 60p material I need to keep a mode for - at least not until I start ripping US TV series from bluray...

So I just took out the progressive mode and gave xrandr only the 60i mode to select. Now when playing the test material the TV does report it's gone into 1080i mode. So that works.

However, of my three test clips, ripped using RipBot264 using the --tff x264 option to preserve interlacing from the original (also confirmed to be TFF), one plays perfectly now. The other two show jerky motion and doubled-up frames. Not visible combing artifacts; I'm not sure if there's a name for what I'm seeing but I'm guessing it's some kind of alignment problem.

I'm pretty sure everything's TFF all down the line, at least as far as mediainfo can tell (although it also reports the final files' scan type as "MBAFF" - the only difference in mediainfo output between the one that works and one that doesn't is the bitrate.)

An interesting factor is that on the two problematic clips the behaviour isn't consistent from one attempt to play to the next; and they seem to start OK but get worse as they go on. Which makes me wonder if a: it's some timing issue, and b: even the one that seemed to work may just not be failing *yet* within the 2-minute clip length.

Has anyone seen this sort of thing and found a solution? :-)


- Rachel - 2010-11-23

Rachel Wrote:An interesting factor is that on the two problematic clips the behaviour isn't consistent from one attempt to play to the next; and they seem to start OK but get worse as they go on. Which makes me wonder if a: it's some timing issue, and b: even the one that seemed to work may just not be failing *yet* within the 2-minute clip length.

b: turned out to be the case: Having re-transcoded the entire programme it starts to exhibit the same issue after about four minutes.

It does look kinda like a timing issue, that it sort of gradually slips out of sync maybe causing interlaced fields to be shown in the wrong order or just with an off-timing that the human eye picks up.

Then wait a few more minutes and the effect goes away again... and comes back again. Which again might indicate a cyclical timing error or strobe error of some kind. I'm not sure it's regular though.

One thing I've long wondered about, that I've noticed for ages but have tolerated but now am wondering if it's a more significant problem for interlaced content: When I show the codec information (O) the fps figure is not perfectly steady at the expected frame-rate. So for instance watching this video, I see fps wobble between 29.97, 29.94, 30.00, 30.19, 30.24 and so forth, for a video with, ostensibly, a frame rate of 29.97 exactly. This doesn't seem to coincide with any other particular warning signs like CPU going through the roof or vast numbers of missed frames. Is this indicative of variable frame rates in the movie, or just unavoidable variability in the playback technology? (Or is it avoidable? Smile )

(It doesn't only look wrong when the fps is not shown as 29.97; it doesn't only look right when it is. But maybe it is introducing some timing error nonetheless?)

Is this something I should have been paying more attention to? Should I be expecting it to be rock-steady at the expected frame rate?


- Rachel - 2010-11-25

Rachel Wrote:It does look kinda like a timing issue, that it sort of gradually slips out of sync maybe causing interlaced fields to be shown in the wrong order or just with an off-timing that the human eye picks up.

Looks even more like it now. Discovered my (Samsung) bluray player could play MKV movies off USB disk, though it's fussy about the devices it'll take. Once I'd defeated its fussiness a USB stick with the same test files on it as above played basically perfectly; I had a couple of stutters on busy sections which I think were the result of the USB stick I used being too slow, a theory supported by the fact it couldn't play the actual vc1-interlaced bluray raw rip at full speed, though it *was* playing it, so more trials with faster devices to follow, but apart from that the actual playback of the interlaced material that XBMC seemed to have some field synchronisation issue with, was perfect.

As it's the same TV, what I think is: the TV is OK and the actual files to be played are OK, so the problem must XBMC and/or the (nvidia ION) hardware it's being played on.

At least at the moment I *do* have a playing solution; just not through XBMC; and typically the Samsung's DLNA implementation won't play the same files through that that it's happy with through USB.


- spozen - 2010-11-27

So since I'm too lazy to read through the whole thread... Does the script work on 10.10 Maverick?


- spozen - 2010-11-27

Ok, so I've run the script and it only added 60Hz and 30Hz to XBMC.... What about 23.97?

My EDID information:

Code:
# - Modes in ModePool for SHARP HDMI (DFP-0) ---
# vidia-auto-select" : 1920 x 1080 @  50.0 Hz
# 920x1080"          : 1920 x 1080 @  50.0 Hz
# 920x1080_50"       : 1920 x 1080 @  50.0 Hz
# 920x1080_60"       : 1920 x 1080 @  60.0 Hz
# 920x1080_60_0"     : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 16)
# 920x1080_30"       : 1920 x 1080 @ 29.97/30 Hz (CEA-861B Format 34)
# 920x1080_25"       : 1920 x 1080 @ 25 Hz (CEA-861B Format 33)
# 920x1080_60i"      : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 5)
# 920x1080_50i"      : 1920 x 1080 @ 50 Hz Interlace (CEA-861B Format 20)
# 600x1200"          : 1600 x 1200 @  60.0 Hz
# 600x1200_60"       : 1600 x 1200 @  60.0 Hz
# 400x1050"          : 1400 x 1050 @  60.0 Hz
# 400x1050_60"       : 1400 x 1050 @  60.0 Hz
# 360x768"           : 1360 x  768 @  59.8 Hz
# 360x768_60"        : 1360 x  768 @  59.8 Hz
# 280x1024"          : 1280 x 1024 @  60.0 Hz
# 280x1024_60"       : 1280 x 1024 @  60.0 Hz
# 280x720"           : 1280 x  720 @  60.0 Hz
# 280x720_60"        : 1280 x  720 @  60.0 Hz
# 280x720_60_0"      : 1280 x  720 @ 59.94/60 Hz (CEA-861B Format 4)
# 280x720_50"        : 1280 x  720 @  50.0 Hz
# 024x768"           : 1024 x  768 @  75.0 Hz
# 024x768_75"        : 1024 x  768 @  75.0 Hz
# 024x768_70"        : 1024 x  768 @  70.1 Hz
# 024x768_60"        : 1024 x  768 @  60.0 Hz
# 00x600"            :  800 x  600 @  75.0 Hz
# 00x600_75"         :  800 x  600 @  75.0 Hz
# 00x600_72"         :  800 x  600 @  72.2 Hz
# 00x600_60"         :  800 x  600 @  60.3 Hz
# 00x600_56"         :  800 x  600 @  56.2 Hz
# 20x576"            :  720 x  576 @ 50 Hz (CEA-861B Format 17)
# 20x576_50"         :  720 x  576 @ 50 Hz (CEA-861B Format 17)
# 20x576_50i"        : (1440)x 576 @ 50 Hz Interlace (CEA-861B Format 21)
# 20x480"            :  720 x  480 @ 59.94/60 Hz (CEA-861B Format 2)
# 20x480_60"         :  720 x  480 @ 59.94/60 Hz (CEA-861B Format 2)
# 20x480_60i"        : (1440)x 480 @ 59.94/60 Hz Interlace (CEA-861B Format 6)
# 40x480"            :  640 x  480 @  75.0 Hz
# 40x480_75"         :  640 x  480 @  75.0 Hz
# 40x480_73"         :  640 x  480 @  72.8 Hz
# 40x480_60"         :  640 x  480 @ 59.94/60 Hz Interlace (CEA-861B Format 1)
# - End of ModePool for SHARP HDMI (DFP-0): ---


My xorg.conf:

Code:
Section "Device"
        Identifier "nvidia"
        Driver  "nvidia"
        Option  "NoFlip"              "false"
        Option  "NoLogo"              "true"
        Option  "DynamicTwinView"     "false"
        Option  "FlatPanelProperties" "Scaling = Native"
        Option  "ModeValidation"      "NoVesaModes, NoXServerModes, NoVertRefreshCheck, NoHorizSyncCheck"
        Option  "UseDisplayDevice"    "DFP-1"
        Option  "ModeDebug"           "true"
        Option  "HWCursor"            "false"
EndSection

Section "Screen"
        Identifier      "screen"
        Device          "nvidia"
        SubSection      "Display"
                Modes "1920x1080_60_0" "1920x1080_24_0"
        EndSubSection
EndSection

Section "Extensions"
        Option  "Composite"           "false"
EndSection

# - Modes in ModePool for SHARP HDMI (DFP-0) ---
# vidia-auto-select" : 1920 x 1080 @  50.0 Hz
# 920x1080"          : 1920 x 1080 @  50.0 Hz
# 920x1080_50"       : 1920 x 1080 @  50.0 Hz
# 920x1080_60"       : 1920 x 1080 @  60.0 Hz
# 920x1080_60_0"     : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 16)
# 920x1080_30"       : 1920 x 1080 @ 29.97/30 Hz (CEA-861B Format 34)
# 920x1080_25"       : 1920 x 1080 @ 25 Hz (CEA-861B Format 33)
# 920x1080_60i"      : 1920 x 1080 @ 59.94/60 Hz (CEA-861B Format 5)
# 920x1080_50i"      : 1920 x 1080 @ 50 Hz Interlace (CEA-861B Format 20)
# 600x1200"          : 1600 x 1200 @  60.0 Hz
# 600x1200_60"       : 1600 x 1200 @  60.0 Hz
# 400x1050"          : 1400 x 1050 @  60.0 Hz
# 400x1050_60"       : 1400 x 1050 @  60.0 Hz
# 360x768"           : 1360 x  768 @  59.8 Hz
# 360x768_60"        : 1360 x  768 @  59.8 Hz
# 280x1024"          : 1280 x 1024 @  60.0 Hz
# 280x1024_60"       : 1280 x 1024 @  60.0 Hz
# 280x720"           : 1280 x  720 @  60.0 Hz
# 280x720_60"        : 1280 x  720 @  60.0 Hz
# 280x720_60_0"      : 1280 x  720 @ 59.94/60 Hz (CEA-861B Format 4)
# 280x720_50"        : 1280 x  720 @  50.0 Hz
# 024x768"           : 1024 x  768 @  75.0 Hz
# 024x768_75"        : 1024 x  768 @  75.0 Hz
# 024x768_70"        : 1024 x  768 @  70.1 Hz
# 024x768_60"        : 1024 x  768 @  60.0 Hz
# 00x600"            :  800 x  600 @  75.0 Hz
# 00x600_75"         :  800 x  600 @  75.0 Hz
# 00x600_72"         :  800 x  600 @  72.2 Hz
# 00x600_60"         :  800 x  600 @  60.3 Hz
# 00x600_56"         :  800 x  600 @  56.2 Hz
# 20x576"            :  720 x  576 @ 50 Hz (CEA-861B Format 17)
# 20x576_50"         :  720 x  576 @ 50 Hz (CEA-861B Format 17)
# 20x576_50i"        : (1440)x 576 @ 50 Hz Interlace (CEA-861B Format 21)
# 20x480"            :  720 x  480 @ 59.94/60 Hz (CEA-861B Format 2)
# 20x480_60"         :  720 x  480 @ 59.94/60 Hz (CEA-861B Format 2)
# 20x480_60i"        : (1440)x 480 @ 59.94/60 Hz Interlace (CEA-861B Format 6)
# 40x480"            :  640 x  480 @  75.0 Hz
# 40x480_75"         :  640 x  480 @  75.0 Hz
# 40x480_73"         :  640 x  480 @  72.8 Hz
# 40x480_60"         :  640 x  480 @ 59.94/60 Hz Interlace (CEA-861B Format 1)
# - End of ModePool for SHARP HDMI (DFP-0): ---



As you can see I added 24p manually, but no luck. I know 24p has been working on previous XBMC versions...


- Superorb - 2010-11-27

^^ According to your TV's EDID info, it does not support 23.97fps.


- spozen - 2010-11-28

Superorb Wrote:^^ According to your TV's EDID info, it does not support 23.97fps.

Yep, but as I understand the guide states a way of adding 23.97 using an alternative way... Isn't this what modelines are for?

I'm 100% sure my TV supports 24p. Because I was watching 24p with last XBMC release.


- Superorb - 2010-11-28

spozen Wrote:Yep, but as I understand the guide states a way of adding 23.97 using an alternative way... Isn't this what modelines are for?

I'm 100% sure my TV supports 24p. Because I was watching 24p with last XBMC release.
XBMC might have been reporting 24p, but was your TV reporting 24p?


- spozen - 2010-11-28

No idea, my TV only displays the current resolution not the refresh rate.

But I think I would have noticed if it run on another refresh rate than 24p. I've noticed that XBMC switches to 25Hz when I enable the "Adjust refresh rate...", and running 25Hz while watching 24p material is very noticeable.... trust me...


- spozen - 2010-11-28

Double post... please ignore..


- X3lectric - 2010-11-29

spozen Wrote:No idea, my TV only displays the current resolution not the refresh rate.

But I think I would have noticed if it run on another refresh rate than 24p. I've noticed that XBMC switches to 25Hz when I enable the "Adjust refresh rate...", and running 25Hz while watching 24p material is very noticeable.... trust me...

Maybe this will help you its four pages back on this thread

http://forum.xbmc.org/showpost.php?p=607230&postcount=226

Your welcome.


- Callek - 2010-11-30

I installed a new TV yesterday (LG 50PK350), and I noticed that 24p worked out of the box (removed the old xorg.conf and rebooted). Both XBMC and the TV reported 24p.

Is there any need to run the script anyway? I only did a quick test yesterday and 24p worked fine aswell as 25p. Why I'm asking is because the movies run in 23.97 and not 24fps...


- a_user - 2010-11-30

24p = 23.97fps