Repository navigation
Record the screen on X11 - #9
Merged
Merged
Conversation
Clip a selection to one monitor with even dimensions, parse PulseAudio sources, and build an ffmpeg command that can pause by cutting segments. The grabber reads the X11 root and paints excluded windows back out.
X11 gets the red outline, countdown, and pause, mic, stop, and discard bar. Those windows are left out of the frames. Wayland reports that recording needs an X11 session. ffmpeg is required and is not bundled.
# Conflicts: # .github/workflows/build.yml # README.md # linux/App.cs # linux/Cli.cs # linux/ClipboardService.cs # linux/Diagnostics.cs # linux/OverlayWindow.cs # linux/SettingsWindow.cs # linux/SingleInstance.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Linux can record a region to an H.264 MP4 on X11. Choose Record video in the tray, or run
opensnip --record, then select a region the same way as a snip.FandArecord the monitor under the cursor.The recording stays on one monitor, with even dimensions. A red outline and a bar (pause, microphone, stop, discard) stay on screen. Those windows are painted out of the frames using the wallpaper pixmap and the windows underneath. Optional system audio and microphone use PulseAudio or PipeWire through
pactl. Pause cuts a new segment and joins the files at the end. The MP4 is saved under~/Videos/OpenSnipand, whenxcliporwl-copyis available, copied astext/uri-list.Settings gains a Recording page and a recordings folder.
PARITY.mdlists what still differs from Windows.Wayland recording is not implemented. The app says that recording needs an X11 session.
ffmpegis required and is not bundled.Win+Shift+Ris still not a built-in global shortcut.Windows behavior is unchanged.
Why
Screen recording was the largest Linux gap with no open pull request. The Windows flow is region selection, countdown, a control bar that never appears in the file, and an MP4 in Videos.
How it was tested
dotnet test tests/OpenSnip.Recording.Tests/OpenSnip.Recording.Tests.csproj -c Release— 19 passed. On this X11 display that includes a grab that paints out an overlapping window, a real ffmpeg recording of a red window, joining two segments, and a session that shows the control bar and writes an MP4 whose frame is red.dotnet build src/OpenSnip.csproj -c Release -p:EnableWindowsTargeting=true— succeeded.DISPLAYis unset, which is what CI does. They needffmpegonly when a display is present.