Smoothvideo branch - Printable Version
+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Announcements, Info, and General Discussion (/forumdisplay.php?fid=85)
+--- Forum: Kodi General Discussion (/forumdisplay.php?fid=6)
+--- Thread: Smoothvideo branch (/showthread.php?tid=46091)
Smoothvideo branch - bobo1on1 - 2009-02-26 18:59
Please go to the new thread: http://forum.xbmc.org/showthread.php?p=336538
What is it for?
Lots of people experience jerkiness when playing video on a computer, this has to do with the way video frames are presented, smoothvideo tries to fix this by syncing the video to the refreshrate of the monitor.
Where can I find it?
The svn is at https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/smoothvideo/.
To build it you need libsamplerate, which is also in the Ubuntu repositories (IMPORTANT: don't forget the dev package). For windows it's already included in the branch.
How does it work?
Usually video is referenced to the system clock, but with a little magic a clock can be made with information from the videocard, this makes sure every frame is presented right after a vblank. Also because the clock can now be controlled, the speed can be changed a little to fit the refreshrate better.
What about audio?
Audio has to stay in sync, this can either be done by resampling, skipping/duplicating packets, or adjusting the clock if it gets out of sync too far.
Resampling has the advantage that the speed of the video can be changed considerably, so 24 fps can be sped up to 25 fps to play at PAL speed.
The disadvantage of resampling is that it doesn't work with passthrough, and there is a slight loss of audio quality.
Skipping/duplicating audiopackets has no loss of audio quality, but the speed of the video can only be changed a little to avoid doing a skip/duplication too often, most of the time it's inaudible, but it can produce a very audible click.
Adjusting the clock has the best audioquality, but some extra video jitter can occur, also the speed of the video can't change much, as the audio will sync the clock more often the more the speed of the video is changed.
How do I turn it on?
It's on by default, under Settings->System->Audio hardware you can set the sync type and the maximum speed adjust percentage when Resample is selected.
Not all videocards support the proper calls, you should check the debug log for lines like:
"CVideoReferenceClock: [...] falling back to QueryPerformanceCounter"
If you have a line like that, the videocard can't be used as a clock and the systemclock is used instead.
Does it work with Adjust refresh rate?
Yes, it should work fine, except if you use vdpau.
Vdpau without adjust refreshrate works ok.
When going from pause to play, a Goa`uld can show up for one second, but the valiant resampler will quickly chase it away.
Video jerks can occur every few minutes or so, this is probably caused by the system doing other important things.
NTSC dvd's don't play well with a 24 hertz refreshrate, this is because of broken timestamps, they play fine at 60 hertz.
Please don't message me about smoothvideo, it takes time away from development, I check this thread almost daily so the best place to ask questions is here.
- alanwww1 - 2009-02-26 20:48
Cangrats to you Bobo1on1 !
It's a great feature a lot of us been waiting for. We'll be here for testing in every way or anything you say.
It is already making a huge difference to me.
Thanks for the work.
- theophile - 2009-02-26 21:35
So I shouldn't bother if I rely on AC3 passthrough?
- ashlar - 2009-02-26 22:20
theophile Wrote:So I shouldn't bother if I rely on AC3 passthrough?It depends on how close you are to the needed refresh rate. A dropped packet now and then is inaudible.
You could not use it to speed up from 24fps to 25fps or slow down 25fps to 24fps.
- PolliSoft - 2009-02-27 01:56
I merged the latest smoothvideo revision into the linuxPort branch to have the smoothVideo tested with the latest fixes. I'm sorry to say I get build errors when using buildsetup.bat (the error I get is that samplerate.h cannot be found), so there is no installer. However, when buildiing the .exe file in VS2008, it works!
So, here is a .rar file containing all the files that the installer normally creates.
I talked to bobo1on1 earlier and he will not be able to provide any support for this since it is not even in the linuxport branch. Try it out, but be aware that there might be some bugs.
- bobo1on1 - 2009-02-27 02:11
Actually I'm committing a merge with linuxport 18128 right now, and WiSo fixed the build on windows.
- EMK0 - 2009-02-27 02:19
i don't understand is this meant to fix things like long pan scenes in videos where the pictures looks jerky?
- bobo1on1 - 2009-02-27 02:45
Yes (good question), it is that and that alone that I'm trying to fix.
- Zeron - 2009-02-27 04:59
Am I correct in assuming that this will work with the VDPAU decoding once they are merged?
- PolliSoft - 2009-02-27 09:47
Got the installer build to work, so here comes an update, still windows build:
- eriksmith200 - 2009-02-27 10:37
My TV only does 60Hz, so for all 24fps or 25fps videos this probably won't help me? (difference between 60Hz and 48, 50 or 72 Hz is too large)
- ultrabrutal - 2009-02-27 11:22
erik, you misunderstand what this tries to do.
waiting for vsync mens that next frame is drawn from the top of the screen and not half way (example) down which looks very weird when picture is moving fast.
it has nothing to do with converting between frame rates (24 to 60 for example)
- dpassent - 2009-02-27 12:05
sorry but IMHO it has EVERYTHING to do with the conversion of fps WHEN NEEDED (syncing 24fps to 50Hz or 25fps to 24Hz). Ideally it should work like this:
1. XBMC recognizes the fps of the movie
2. Tries to switch refreshrate to closest to this fps (24,48,72Hz for 23.98fps, 50, 100Hz for 25fps etc)
3. smoothvideo then syncs the movie to the refreshrate (so 23.98 is speeded up a little tiny bit to 24fps to get perfect sync) - thus resamplig is needed with PCM or frame dropping is needed for ac3/dts pass-thru.
That's how the reclock DS filter works. And that's how I understand smoothvideo branch is working (or should work)
- ashlar - 2009-02-27 12:11
ultrabrutal, sorry but... this has a lot to do with converting between frame rates. It's not exclusively about converting frame rates but it deals with that as well.
At 60Hz I'm not sure about the real benefits of using reclock-like capabilities. You can try to make the 3:2 cadence (used to play back 24fps stuff) very regular, but I don't know if that is actually worth something. 3:2 it's already juddery enough that I doubt the micro imperfections Reclock can cure matter a lot.
You also mention the "waiting for vsync" stuff, but Reclock it's definitely not only about vsync.
In order of importance (1 and 2 are inverted for lots of people ), I would say Reclock can:
1) Provide silk smooth playback when you have direct multiple refresh rate (24Hz, 48Hz, 72Hz etc. for 24fps material; 25Hz, 50Hz, 75Hz, etc. for 25fps material; and so on and so forth).
2) Provide PAL speed down functionality, bringing artificially accelerated 24fps material back to its original framerate. Provide PAL speedup for people who have 50Hz enabled monitors and prefer a 4% acceleration of 24fps material (thus getting smooth playback) rather than playing it back with a 3:2 cadence at 60Hz.
3) Smooth out the inconsistencies of 3:2 cadence when playing back 24fps material at 60Hz.
Edit: One question: what kind of precision is the algorithm getting for the monitor/TV refresh rate? Windows Reclock goes to the third decimal position (like 24.004Hz).
- eriksmith200 - 2009-02-27 15:06
dpassent Wrote:sorry but IMHO it has EVERYTHING to do with the conversion of fps WHEN NEEDED (syncing 24fps to 50Hz or 25fps to 24Hz). Ideally it should work like this:
That's how I understand it as well.