GpuScreenRecorder: added video source option
This commit is contained in:
parent
88447fbcef
commit
5c6657e3af
7 changed files with 37 additions and 17 deletions
|
|
@ -165,6 +165,7 @@ Singleton {
|
|||
property string colorRange: "limited"
|
||||
property bool showCursor: true
|
||||
property string audioSource: "default_output"
|
||||
property string videoSource: "portal"
|
||||
}
|
||||
|
||||
// wallpaper
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
currentKey: Settings.data.audio.visualizerType
|
||||
onSelected: function (key) {
|
||||
onSelected: key => {
|
||||
Settings.data.audio.visualizerType = key
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
currentKey: Settings.data.bar.position
|
||||
onSelected: function (key) {
|
||||
onSelected: key => {
|
||||
Settings.data.bar.position = key
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,10 +92,30 @@ ColumnLayout {
|
|||
Layout.bottomMargin: Style.marginS * scaling
|
||||
}
|
||||
|
||||
// Source
|
||||
NComboBox {
|
||||
label: "Video Source"
|
||||
description: "We recommend using portal, if you get artifacts try screen."
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
key: "portal"
|
||||
name: "Portal"
|
||||
}
|
||||
ListElement {
|
||||
key: "screen"
|
||||
name: "Screen"
|
||||
}
|
||||
}
|
||||
currentKey: Settings.data.screenRecorder.videoSource
|
||||
onSelected: key => {
|
||||
Settings.data.screenRecorder.videoSource = key
|
||||
}
|
||||
}
|
||||
|
||||
// Frame Rate
|
||||
NComboBox {
|
||||
label: "Frame Rate"
|
||||
description: "Target frame rate for screen recordings (default: 60)."
|
||||
description: "Target frame rate for screen recordings. (default: 60)"
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
key: "30"
|
||||
|
|
@ -115,7 +135,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
currentKey: Settings.data.screenRecorder.frameRate
|
||||
onSelected: function (key) {
|
||||
onSelected: key => {
|
||||
Settings.data.screenRecorder.frameRate = key
|
||||
}
|
||||
}
|
||||
|
|
@ -143,7 +163,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
currentKey: Settings.data.screenRecorder.quality
|
||||
onSelected: function (key) {
|
||||
onSelected: key => {
|
||||
Settings.data.screenRecorder.quality = key
|
||||
}
|
||||
}
|
||||
|
|
@ -175,7 +195,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
currentKey: Settings.data.screenRecorder.videoCodec
|
||||
onSelected: function (key) {
|
||||
onSelected: key => {
|
||||
Settings.data.screenRecorder.videoCodec = key
|
||||
}
|
||||
}
|
||||
|
|
@ -195,7 +215,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
currentKey: Settings.data.screenRecorder.colorRange
|
||||
onSelected: function (key) {
|
||||
onSelected: key => {
|
||||
Settings.data.screenRecorder.colorRange = key
|
||||
}
|
||||
}
|
||||
|
|
@ -239,7 +259,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
currentKey: Settings.data.screenRecorder.audioSource
|
||||
onSelected: function (key) {
|
||||
onSelected: key => {
|
||||
Settings.data.screenRecorder.audioSource = key
|
||||
}
|
||||
}
|
||||
|
|
@ -259,7 +279,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
currentKey: Settings.data.screenRecorder.audioCodec
|
||||
onSelected: function (key) {
|
||||
onSelected: key => {
|
||||
Settings.data.screenRecorder.audioCodec = key
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
currentKey: Settings.data.wallpaper.swww.resizeMethod
|
||||
onSelected: function (key) {
|
||||
onSelected: key => {
|
||||
Settings.data.wallpaper.swww.resizeMethod = key
|
||||
}
|
||||
}
|
||||
|
|
@ -256,7 +256,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
currentKey: Settings.data.wallpaper.swww.transitionType
|
||||
onSelected: function (key) {
|
||||
onSelected: key => {
|
||||
Settings.data.wallpaper.swww.transitionType = key
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,13 +30,12 @@ Singleton {
|
|||
videoDir += "/"
|
||||
}
|
||||
outputPath = videoDir + filename
|
||||
var command = "gpu-screen-recorder -w portal" + " -f " + settings.frameRate + " -ac " + settings.audioCodec
|
||||
+ " -k " + settings.videoCodec + " -a " + settings.audioSource + " -q " + settings.quality
|
||||
+ " -cursor " + (settings.showCursor ? "yes" : "no") + " -cr " + settings.colorRange + " -o " + outputPath
|
||||
var command = `gpu-screen-recorder -w ${settings.videoSource} -f ${settings.frameRate} -ac ${settings.audioCodec} -k ${settings.videoCodec} -a ${settings.audioSource} -q ${settings.quality} -cursor ${settings.showCursor ? "yes" : "no"} -cr ${settings.colorRange} -o ${outputPath}`
|
||||
|
||||
//Logger.log("ScreenRecorder", command)
|
||||
Quickshell.execDetached(["sh", "-c", command])
|
||||
Logger.log("ScreenRecorder", "Started recording")
|
||||
//Logger.log("ScreenRecorder", command)
|
||||
}
|
||||
|
||||
// Stop recording using Quickshell.execDetached
|
||||
|
|
@ -45,7 +44,7 @@ Singleton {
|
|||
return
|
||||
}
|
||||
|
||||
Quickshell.execDetached(["sh", "-c", "pkill -SIGINT -f 'gpu-screen-recorder.*portal'"])
|
||||
Quickshell.execDetached(["sh", "-c", "pkill -SIGINT -f 'gpu-screen-recorder'"])
|
||||
Logger.log("ScreenRecorder", "Finished recording:", outputPath)
|
||||
|
||||
// Just in case, force kill after 3 seconds
|
||||
|
|
@ -59,7 +58,7 @@ Singleton {
|
|||
running: false
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
Quickshell.execDetached(["sh", "-c", "pkill -9 -f 'gpu-screen-recorder.*portal' 2>/dev/null || true"])
|
||||
Quickshell.execDetached(["sh", "-c", "pkill -9 -f 'gpu-screen-recorder' 2>/dev/null || true"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ RowLayout {
|
|||
root.hovering = false
|
||||
root.exited()
|
||||
}
|
||||
onWheel: function (wheel) {
|
||||
onWheel: wheel => {
|
||||
if (wheel.angleDelta.y > 0 && spinBox.value < spinBox.to) {
|
||||
spinBox.increase()
|
||||
} else if (wheel.angleDelta.y < 0 && spinBox.value > spinBox.from) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue