View Full Version : Configuring refresh rates
anderskkan
2009-04-26, 02:11
Can I in any way setup preferred refresh rates for given frame rates (using the auto change function).
I would like to have:
23.976Hz for 23.976fps
24.0Hz for 24.0fps
59.94Hz for 29.97fps (and 59.94fps)
50Hz for 25fps and 50fps
When I read the xbmc.log I can see that 24Hz, 50Hz and 60Hz are the only ones used.
Under XP, Vista and Windows 7 I can use 23,24,25,29,50,59,60 (23.976, 24, 25, 29.97, 50, 59.94, 60.
Any way to configure this using XBMC on Ubuntu?
Using a Nvidia 8600GTS and a display that supports all refresh rates mentioned above (akso in EDID)
anderskkan
2009-04-26, 06:07
I found the answer myself:
http://www.avenard.org/media/Patches_%26_Add-Ons/Entries/2009/2/16_Match_refresh_rate_with_input_framerate_to_redu ce_judder_and_nVidia_xrandr_support.html
Is there any chance this could be done with XBMC also?
It's great to have automatic refresh rate changing. But todays solution don't let you use the "correct" refresh rate
As set by using this technique:
http://www.avenard.org/media/Patches_%26_Add-Ons/Entries/2008/9/5_xorg.conf_and_specific_refresh_rates.html
http://xbmc.org/forum/showthread.php?t=46091
it's possible to match what xrandr reports when using nvidia and DynamicTwinView by modifying xbmc-xrandr.c. As mentioned in your link (http://www.avenard.org/media/Patches_%26_Add-Ons/Entries/2009/2/16_Match_refresh_rate_with_input_framerate_to_redu ce_judder_and_nVidia_xrandr_support.html) the order of the modelines matter so with my xorg.conf:
Section "Monitor"
Identifier "PLASMA"
VendorName "Panasonic"
ModelName "PZ80"
HorizSync 15.0 - 68.0
VertRefresh 23.0 - 61.0
# Väldigt nära 23.976
Modeline "1920x1080@23" 74.23 1920 2560 2604 2752 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 23.976Hz (EIA/CEA-861B)
#ModeLine "1920x1080@23" 74.175 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 24Hz (EIA/CEA-861B)
ModeLine "1920x1080@24" 74.250 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 50Hz (EIA/CEA-861B)
ModeLine "1920x1080@50" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 59.94Hz (EIA/CEA-861B)
ModeLine "1920x1080@59" 148.350 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 60Hz (EIA/CEA-861B)
ModeLine "1920x1080@60" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 24hz (From EDID, CEA Format 32
#ModeLine "1920x1080@24" 74.16 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
EndSection
Section "Device"
Identifier "NVIDIA"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 8500 GT"
Option "NoLogo" "True"
Option "ModeValidation" "NoVesaModes, NoEdidModes, NoXServerModes, NoPredefinedModes"
Option "ExactModeTimingsDVI" "True"
Option "UseEvents" "True"
Option "Coolbits" "1"
Option "AddARGBVisuals" "True"
Option "AddARGBGLXVisuals" "True"
Option "DamageEvents" "True"
Option "TripleBuffer" "True"
#Option "DynamicTwinView" "False"
Option "DisableGLXRootClipping" "True"
EndSection
Section "Screen"
Identifier "Screen0"
Device "NVIDIA"
Monitor "PLASMA"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080@50" "1920x1080@60" "1920x1080@59" "1920x1080@24" "1920x1080@23"
EndSubSection
EndSection
I've done the following changes to xbmc-xrandr.c:
> svn diff xbmc-xrandr.c
Index: xbmc-xrandr.c
================================================== =================
--- xbmc-xrandr.c (revision 19672)
+++ xbmc-xrandr.c (working copy)
@@ -373,6 +373,24 @@
((float) mode_info->hTotal * (float) mode_info->vTotal));
else
rate = 0;
+
+ if (rate == 51)
+ {
+ rate = 60;
+ }
+ else if (rate == 52)
+ {
+ rate = 59.94;
+ }
+ else if (rate == 53)
+ {
+ rate = 24.00;
+ }
+ else if (rate == 54)
+ {
+ rate = 23.976;
+ }
+
return rate;
}
Do I have to do this before compiling XBMC? If so, how can I do it when I'm installing XBMC via PPA? Would be so great to have exactelly 23.976 =)
EDIT: By the way the xorg.conf from http://www.avenard.org/media/Patches_%26_Add-Ons/Entries/2008/9/5_xorg.conf_and_specific_refresh_rates.html doesn't work for me...
anderskkan
2009-04-26, 15:37
it's possible to match what xrandr reports when using nvidia and DynamicTwinView by modifying xbmc-xrandr.c. As mentioned in your link (http://www.avenard.org/media/Patches_%26_Add-Ons/Entries/2009/2/16_Match_refresh_rate_with_input_framerate_to_redu ce_judder_and_nVidia_xrandr_support.html) the order of the modelines matter so with my xorg.conf:
I've done the following changes to xbmc-xrandr.c:
Thanks for this tips. It does work for giving me a "correct" list for changing refresh rate inside XBMC. But it does not help me with having the correct refresh rate automatically set based on the frame rate. It does not choose the correct refresh rate.
anderskkan
2009-04-26, 19:25
Intel Core2 Duo 3GHz
2GB RAM
NVIDIA GeForce 8600 GTS
v185.19
Auzentech X-Meridian 7.1
CMI8788 ALSA v1.0.19
-------------------------------------------------------
System:
Ubuntu 8.04 "Hardy Heron"
2.6.24-23
i686
XBMC-beta1
r19716
manual
In my quest for perfect playback with XBMC I found that the frame rate detection (read out) is not correct for many of my movies. This results in that the automatic refresh rate function will choose the wrong refresh rate.
VC-1
23.976fps 23.976fps OK Blu-ray
23.976fps 29.97fps FAIL HD DVD Pulldown flag?
MPEG-2
23.976fps 24fps FAIL Blu-ray
29.97fps 29.97fps OK Blu-ray
H264/AVC
23.976fps 24fps FAIL Blu-ray
23.976fps 24fps FAIL HD DVD
23.976fps 23.976fps OK *x264 encode from Blu-ray source
23.976fps 47.92fps FAIL (bird scene from Planet Earth)
24fps 24fps OK Blu-ray
29.97fps 59.94fps FAIL Blu-ray
All the above have untouched video remuxed into MKVs (*or encoded with x264).
Using ffdshow with ffmpeg codecs under Winows ALL frame rates are detected (read) 100% correct.
So something must be wrong with the way XBMC reads the frame rate.
Maybe this should have it's own thread as the original question for this thread already has been answered? (thanks whop)
anderskkan
2009-04-26, 20:50
To validate the table I wrote above I have during the day gone through a whole disk (1TB, about 45 moives) with my ripped and remuxed Blu-rays and HD DVDs.
XBMC detects the wrong frame rate for more than 80%.
It's easy to test and confirm by reading the log.
Pressing "O" for OSD Codec information shows the correct refresh rate though.
Don't know if it is really the same issue, but I have opened a trac ticket for this :
http://xbmc.org/trac/ticket/6015
I put a sample vid in the ticket, but I have many other files with the same problem.
Also, I Havent't been able to correct the problem with avidemux.
I have only seen the problem with some 25fps movies.
I Have never seen the problem with 23,976/24 fps movies.
I run XBMC on winXP.
Any progress here, this is a major show stopper for me, anyone?
I have only one example where xbmc fps differs for ffmpeg output.
Is killa sampla 23.976, 24 or 25 fps?
ffmpeg -i /data/movies/killa.sampla.x264.mkv
Stream #0.0: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR
16:9], 23.98 tb(r)
midentify.sh /data/movies/killa.sampla.x264.mkv
15:08 < bogey> ID_VIDEO_FPS=23.976
XBMC detects it 24fps in GUI, when you check it with "o", but changes refreshrate to 50Hz?
Log shows that the fps is detected as 47.92? Seems that xbmc version of ffmpeg gets the information differently..
Here's the part of that in log
17:12:49 T:1283160400 M:2398531584 INFO: ffmpeg: Stream #0.0: Video: h264, yuv420p, 1920x1080, PAR 1:1 DAR 16:9, 47.92 tbr, 1k tbn, 47.95 tbc
17:12:49 T:1283160400 M:2398531584 NOTICE: CDVDPlayerVideo::OpenStream - fpsrate: 575 fpsscale: 12
17:12:50 T:1299945808 M:2217013248 NOTICE: fps: 47.916668, pwidth: 1920, pheight: 1080, dwidth: 1920, dheight: 1080
17:12:50 T:1299945808 M:2217013248 DEBUG: OutputPicture - change configuration. 1920x1080. framerate: 47.92
17:12:50 T:1299945808 M:2217013248 NOTICE: Display resolution ADJUST : default: 1920x1080 @ 50.00Hz (13)
Here's output of some other ffmpeg (git-52a6d0e)
Seems stream 0 codec frame rate differs from container frame rate: 23.98 (24000/1001) -> 47.92 (575/12)
Stream #0.0: Video: h264, yuv420p, 1920x1080, PAR 1:1 DAR 16:9, 47.92 tbr, 1k tbn, 23.98 tbc
Killa sampla is so badly reencoded / muxed, so I think that could not be used as sample :D
Could someone upload some sample clips where xbmc detects fps incorrect?