-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GLX backend causes screen capture to become choppy #129
Comments
Sorry, I have no idea what would cause it. Both ffmpeg and gstreamer-0.10 work correctly and I got a steady FPS of 30. ffmpeg uses Probably it's a driver-dependent issue? I personally use GTX 670 + x11-drivers/nvidia-drivers-325.08. GLX backend is much more sensitive to driver issues. Only the video is choppy but not the screen, right? What is the FPS ffmpeg displays? Are you running any other CPU/GPU-intensive applications? Is there anything abnormal about CPU/GPU usage that you could see? Is there anything special about your setup (e.g. multiple monitor, remote X)? Does disabling all features (with, for example, What are you trying to capture? A video player, OpenGL application, or just daily apps? Does those performance-related options ( Does other OpenGL-based compositors (Compiz, Mutter, Kwin, etc.) exhibit the same thing? And, is there any specific reasons that you can't use X Render backend? |
I was on nvidia-319.32-4 but I just updated to nvidia-325.08-1. The video card is a GTX 650. I also updated to the latest compton git as I noticed I had mine a little out of date. I'm still getting the issue though. I've noticed that it's kind of difficult to see with normal desktop motion and easier with moving video. One of the ways I've been testing is livestreaming over the internet. While the stream is live I'll stop and start compton while testing different settings. In regards to CPU usage, I don't get any more than usual and also get the issue when using weaker x264 settings to reduce cpu usage (increasing CRF/quantizer and setting the preset to faster settings). The reason I don't like using the XRender backend is because it sometimes gets tearing during video playback. I have a script I use two toggle compton on and off and start either with Xrender or GLX but it's troublesome. It's possible the video tearing issue I mentioned is gone now though as I haven't tested since these latest updates. Here is my current configuration.
|
Sorry, I got carried away and missed some of your questions. I'm running on a single monitor, not remote. Video is going out over hdmi. There is one thing unusual, my video is normal set to 720p but I use I tried Right now I'm just testing with different things, I normally stream games from windows but have been trying to get a viable streaming solution working on linux. I'm writing a small streaming app and testing for a community of streamers. Up until now we've done all our streaming through the command line or scripts but it's fairly limited and complicated for new streamers. In the past I used to use compiz but it's since died and has no support. There's also a major problem with glib3 that is unlikely to be fixed so it's been dropped from archlinux's official repositories. Thing is I switched video cards some time shortly before compiz stopped working and I'm not sure if I streamed in compiz with this videocard. I have tried Kwin when I had compiz installed since it was easy to switch with fusion-icon. I haven't tried since then because I assumed I had to install and configure the rest of KDE. I'll look into testing with Kwin and Mutter now. |
I just tested with --edit the Kwin capture is smooth but there's tearing while capturing video players. |
Firstly, I'm truly sorry for the late reply. My brain has a bug that I forget one thing if I don't do it immediately. I got something in recordmydesktop's source code: It tries to detect compositors and when found, forces full screen recording with some sort of double buffering and turns off X SHM. ffmpeg doesn't do that (at least not in ffmpeg-1.2.1). You could comment out
I tried the same here (except with DVI output) and nothing wrong when I record a video with ffmpeg-1.2.1.
Oh, it's normal as those functions are Mesa only.
compiz-0.8.8 is still working correctly on Gentoo, actually feels better than 0.9.8.
There's no report that mutter causes any issues with screen capturing that I could find. That gives me an idea: Have you tried playing with all those VSync options in compton and nvidia-settings? Try turn both off firstly. By the way, |
Don't worry about it, I tend to do the same thing. I tried using recordmydesktop and got pretty much the same exact behavior. I also tried calling it with I used recordmydesktop to capture a couple minutes of sample video in case it might spark some ideas. The first half is a scene from the open source Buck Bunny video using Compton with the GLX backend. The second half is the same scene using the XRender backend. To change between them I wrote a script that kills Compton if it's running and starts it if it's not. When given the http://www.filedropper.com/comptonbuckbunny Regarding Compiz, the version I have is 0.8.8-5. It segfaults when I try to run it with fusion-icon unless I do I have tried |
I tried disabling TripleBuffer in the Xorg.conf but it made no difference. I tested with and without both |
And, as you may have already noticed,
I don't think ffmpeg x11grab cares about X Damage. Couldn't find any references in source code.
Unfortunately I failed to download the file. Filedropper doesn't look like the best file sharing service around and I'm somehow always getting incomplete file with checksum failure.
compiz-0.8.8 is in Portage tree, thus definitely is deemed usable by Gentoo developers. I got compiz-0.9.8 working but it isn't quite as well. I do not use fusion-icon but run compiz in
Which is weird. I don't understand why mplayer2 would use X Damage for, nor have I found any references to it in source code of mplayer-1.1.1. As stated above, ffmpeg doesn't seemingly use it, either (although recordmydesktop does, sometimes). I don't see what relationship "Allow Flipping" and "DamageEvents" have: one about rendering buffer while another about damage notification. By the way, at least theoretically disabling "Allow flipping" has negative effects on OpenGL performance. |
Right, I forgot to mention this. I can only get the
All of this last round of testing including the testing with nVidia options was done using recordmydesktop.
I uploaded the file to youtube here.
I haven't tried throwing it into my .xinitrc but typing just
It's possible that my mplayer2 is having that behavior since I've enabled VDPAU codecs in my config (as well as smplayer2) and forgot to try disabling them, though I think VLC uses GPU acceleration of some sort as well.
Yea I have no idea why this would have that effect. The only reason I bothered to check it was that I had previously read that XDamage seems to cause reduced performance with gstreamer, but it should only be an issue gstreamer's ximagesrc implementation. When I use gstreamer with X Damage on I do get a choppy screen capture if the area I'm trying to capture is too large (like the whole screen). I don't get the same issue when using ffmpeg to capture the whole screen. Anyway, I was reading through the xorg/appendix section of the nVidia driver configuration and the option so I figured I may as well try it on the off-chance it had an effect.
Yea, I'd rather not use it for that reason. It mentions that in the documentation as well. |
Huh, apparently I've successfully forgotten this again... :-S
Looked briefly at recordmydesktop-0.3.8.1's source code and seemingly X Damage is being used to determine changed regions -- but not in full-shots mode.
Oh, this one works. I didn't found the issue very visible, though, presumably because of my bad eyesight.
Pretty much that's the typical tone of an "experienced" user. :-) I sometimes speak in that way, as well.
VDPAU or VAAPI does not necessarily work too well with composition or screen recording. The not-accelerated x11 may be a safe fallback. VLC >= 2.1, I heard, has gotten VDPAU support, while older versions only could use VDPAU through VAAPI on VLC. |
Sorry, I haven't replied in a while I've been preoccupied with my normal life. I did try getting compiz working though. I tried some different packages as well as the bazaar 0.9 version but I had problems with each. I think mainly though the problems are either related to using xfce4 with it or just using it with archlinux in generla (some of the packages listed as dependencies aren't available anymore in any form except cached versions). The 0.8 packages I can kind of get working but with video capture I get long pauses over a second long every second or so, it's really bad. The 0.9 packages weren't giving me any window decorations and in some instances made my desktop unresponsive altogether (I didn't manage to test video capture with them). I'm currently kind of out of basic ideas and in general I guess telling streamers to disable composting to stream isn't as unusual considering in Windows 7 and Windows Vista users need to disable Aero in order to capture the desktop at an FPS larger than 25 fps. I forgot to add that kwin seems to work (made sure it's using the opengl backend and not xrender), so I'll experiment with that some more. |
I would doubt if there are some other factors here, considering there are many users recording a composited desktop and seemingly only you encountered the issue.
I guess with my limited knowledge and the size of kwin it isn't too easy for me to figure out the exact reason, though. |
Using compton with ffmpeg's x11grab input or gstreamer's ximagesrc element while using the GLX backend causes video capture to become very choppy as if the FPS was really low. This does not happen with the Xrender backend which is unusual given that Xrender otherwise gives lower performance.
Here is an example ffmpeg command. Note that ffmpeg is compiled with --enable-x11grab for screen capture. The "-r 25" parameter tells ffmpeg to try and output at 25 fps, this may seem like a low number but the capture with GLX looks like it's somewhere much lower than this.
Here are example gstreamer0.10 and gstreamer1.0 commands. Both of these will output to the desktop so you can see it in real time.
I am using xfce4 on Archlinux. I use more complex versions of these commands for live streaming to rtmp servers. I'm also using gstreamer's libraries directly in a small QT/C++ app for the same purposes.
The text was updated successfully, but these errors were encountered: