mirror of
https://github.com/saily/vnc-recorder.git
synced 2025-04-27 18:25:13 +00:00
Make quality configurable
Signed-off-by: Daniel Widerin <daniel@widerin.net>
This commit is contained in:
parent
7b64627baa
commit
0ad37313d2
@ -32,6 +32,7 @@ library which made this wrapper possible.
|
||||
--port value VNC port (default: 5900) [$VR_VNC_PORT]
|
||||
--password value Password to connect to the VNC host (default: "secret") [$VR_VNC_PASSWORD]
|
||||
--framerate value Framerate to record (default: 30) [$VR_FRAMERATE]
|
||||
--crf value Constant Rate Factor (CRF) to record with (default: 35) [$VR_CRF]
|
||||
--outfile value Output file to record to. (default: "output.mp4") [$VR_OUTFILE]
|
||||
--help, -h show help
|
||||
--version, -v print the version
|
||||
|
@ -112,6 +112,7 @@ type X264ImageCustomEncoder struct {
|
||||
input io.WriteCloser
|
||||
closed bool
|
||||
Framerate int
|
||||
ConstantRateFactor int
|
||||
}
|
||||
|
||||
func (enc *X264ImageCustomEncoder) Init(videoFileName string) {
|
||||
@ -126,10 +127,9 @@ func (enc *X264ImageCustomEncoder) Init(videoFileName string) {
|
||||
"-y",
|
||||
"-i", "-",
|
||||
"-vcodec", "libx264",
|
||||
"-threads", "8",
|
||||
"-preset", "veryfast",
|
||||
"-g", "250",
|
||||
"-crf", "37",
|
||||
"-crf", strconv.Itoa(enc.ConstantRateFactor),
|
||||
videoFileName,
|
||||
)
|
||||
cmd.Stdout = os.Stdout
|
||||
|
7
main.go
7
main.go
@ -64,6 +64,12 @@ func main() {
|
||||
Usage: "Framerate to record",
|
||||
EnvVars: []string{"VR_FRAMERATE"},
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "crf",
|
||||
Value: 35,
|
||||
Usage: "Constant Rate Factor (CRF) to record with",
|
||||
EnvVars: []string{"VR_CRF"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "outfile",
|
||||
Value: "output.mp4",
|
||||
@ -143,6 +149,7 @@ func recorder(c *cli.Context) error {
|
||||
vcodec := &X264ImageCustomEncoder{
|
||||
FFMpegBinPath: ffmpeg_path,
|
||||
Framerate: c.Int("framerate"),
|
||||
ConstantRateFactor: c.Int("crf"),
|
||||
}
|
||||
|
||||
//goland:noinspection GoUnhandledErrorResult
|
||||
|
Loading…
Reference in New Issue
Block a user