Bug 455357 - X11 screen-capture fails on displays other than :0.0
Summary: X11 screen-capture fails on displays other than :0.0
Status: REPORTED
Alias: None
Product: kdenlive
Classification: Applications
Component: Timeline & Editing (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords: X11-only
Depends on:
Blocks:
 
Reported: 2022-06-15 18:19 UTC by breakslabs
Modified: 2025-02-24 17:58 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description breakslabs 2022-06-15 18:19:20 UTC
SUMMARY

Cannot capture/record screen on X11 servers with DISPLAY != :0.0

STEPS TO REPRODUCE
1. Start an X server with a display other than :0.0
2. Run kdenlive
3. Attempt to record the X11 display (screen capture)

OBSERVED RESULT
ffmpeg subprocess fails immediately with a "cannot open display" error.

EXPECTED RESULT
kdenlive begins capturing

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian

The ffmpeg command line from the kdenlive log:
   Invalid button configuration: == STARTING X11 CAPTURE:  ("-f", "x11grab", "-s", "1280x720", "-r", "15", "-i", ":0.0+0.0", "-crf", "25", "-vcodec", "libx264", "-preset", "veryfast", "-threads", "0", "-i", ":1.0") 

As above, the -i option should specify both the X11 display (here :0.0) and the x/y offset (+0.0). The display ID appears to be hard-coded in the source for kdenlive. It would be better to either allow the user to manually configure the display value, query the X11 server for the current display value, or respect the value of the DISPLAY environment variable. Hard-coding the display prevents capture on, eg, DISPLAY=:1.0

The offending line of code appears to be line 269 of monitor/recmanager.cpp on the master branch.
Comment 1 breakslabs 2022-06-15 18:22:48 UTC
I just noticed that the command line log above also has a second -i flag "-i :1.0" at the end - that is not normal output, but rather form me attempting to override the hard-coded value. It was (unsurprisingly) ineffective.
Comment 2 TraceyC 2025-02-24 17:58:49 UTC
Adding the x11-only keyword