[FFmpeg-devel] [WIP] XComposite window capture demuxer (Linux)

Lynne dev at lynne.ee
Tue May 19 22:52:29 EEST 2020


May 19, 2020, 19:02 by cus at passwd.hu:

>
>
> On Tue, 19 May 2020, Lynne wrote:
>
>> May 19, 2020, 09:23 by ema at fastwebnet.it:
>>
>>> Hi Marton,
>>>
>>> Thanks very much for the feedback; below answers to your points - let me know further feedback if any.
>>>
>>>> And sorry, I cannot say how useful this would be, maybe now is the time
>>>> for people to speak up if somebody is particularly against adding this
>>>> for any reason.
>>>>
>>>
>>> I haven't been able to capture video-games/3d apps running in full screen with x11grab, and when running in windowed mode the capture was sub optimal in terms of quality (lost frames/choppy/etc etc).
>>> Unless we have better solutions with ffmpeg/libav* (which I'm not aware of :) this xcompgrab would target such audience (smooth capture alas more CPU usage).
>>> But again, if there's already a better capture, then this has been an academic exercise :)
>>>
>>
>> There already is a zero-overhead capture on linux - kmsgrab. It works on AMD and Intel.
>>
>
> As Nicolas mentioned, kmsgrab practically requires root. Also, I tried it on Intel half a year ago on Ubuntu 18.04, and it simply does not work correctly. There were crashes, there were random failures with cryptic error messages, usually at the beginning of the capture, somtimes in the middle of it. And the captured frame was missing some of the drawn opengl primitives, it looked like kmsgrab grabbed the frame from the back buffer and not the front.
>
> So kmsgab on Intel is a no-no for me.
>

That's a driver issue, no fault of kmsgrab, and I can't even confirm seeing those bugs happen to anyone
using kmsgrab, either on intel or amd, so maybe your system state was somewhat broken?
Either way, there's still the issue of OpenGL state, OpenGL API usage signalling and finally, something
OP omitted: this capture system would only work on compositing X11 WMs. Not all WMs are compositing,
and Nvidia discouraged enabling compositors due to bugs years ago.
Our current capture system works with all X11 WMs.



More information about the ffmpeg-devel mailing list