Compare commits

..

4 Commits
4.2.5 ... 4.2.6

Author SHA1 Message Date
dec05eba
74d30f16ad Set buffer size 2024-11-05 17:49:49 +01:00
dec05eba
030947e33a Default replay service to cbr for better file size (less ram usage) and 60 seconds 2024-11-05 10:25:48 +01:00
dec05eba
35390796cd usage 2024-11-05 09:31:32 +01:00
dec05eba
70b9e3d6ff Revert bitrate calculation 2024-11-05 09:23:39 +01:00
5 changed files with 11 additions and 10 deletions

View File

@@ -1,6 +1,5 @@
WINDOW=screen
CONTAINER=mp4
QUALITY=very_high
CODEC=h264
AUDIO_CODEC=opus
AUDIO_DEVICE=default_output

View File

@@ -5,14 +5,14 @@ Description=GPU Screen Recorder Service
EnvironmentFile=-%h/.config/gpu-screen-recorder.env
Environment=WINDOW=screen
Environment=CONTAINER=mp4
Environment=QUALITY=very_high
Environment=BITRATE_MODE=qp
Environment=QUALITY=50000
Environment=BITRATE_MODE=cbr
Environment=CODEC=auto
Environment=AUDIO_CODEC=opus
Environment=AUDIO_DEVICE=default_output
Environment=SECONDARY_AUDIO_DEVICE=
Environment=FRAMERATE=60
Environment=REPLAYDURATION=30
Environment=REPLAYDURATION=60
Environment=OUTPUTDIR=%h/Videos
Environment=MAKEFOLDERS=no
Environment=COLOR_RANGE=limited

View File

@@ -1,4 +1,4 @@
project('gpu-screen-recorder', ['c', 'cpp'], version : '4.2.5', default_options : ['warning_level=2'])
project('gpu-screen-recorder', ['c', 'cpp'], version : '4.2.6', default_options : ['warning_level=2'])
add_project_arguments('-Wshadow', language : ['c', 'cpp'])
if get_option('buildtype') == 'debug'

View File

@@ -1,7 +1,7 @@
[package]
name = "gpu-screen-recorder"
type = "executable"
version = "4.2.5"
version = "4.2.6"
platforms = ["posix"]
[config]

View File

@@ -537,7 +537,7 @@ static AVCodecContext *create_video_codec_context(AVPixelFormat pix_fmt,
codec_context->bit_rate = bitrate;
codec_context->rc_max_rate = codec_context->bit_rate;
//codec_context->rc_min_rate = codec_context->bit_rate;
//codec_context->rc_buffer_size = codec_context->bit_rate;//codec_context->bit_rate / 10;
codec_context->rc_buffer_size = codec_context->bit_rate;//codec_context->bit_rate / 10;
codec_context->rc_initial_buffer_occupancy = 0;//codec_context->bit_rate;//codec_context->bit_rate * 1000;
} else if(bitrate_mode == BitrateMode::VBR) {
const int quality = vbr_get_quality_parameter(codec_context, video_quality, hdr);
@@ -566,8 +566,10 @@ static AVCodecContext *create_video_codec_context(AVPixelFormat pix_fmt,
codec_context->rc_max_rate = codec_context->bit_rate;
//codec_context->rc_min_rate = codec_context->bit_rate;
//codec_context->rc_buffer_size = codec_context->bit_rate;//codec_context->bit_rate / 10;
codec_context->rc_buffer_size = codec_context->bit_rate;//codec_context->bit_rate / 10;
codec_context->rc_initial_buffer_occupancy = codec_context->bit_rate;//codec_context->bit_rate * 1000;
} else {
//codec_context->rc_buffer_size = 50000 * 1000;
}
//codec_context->profile = FF_PROFILE_H264_MAIN;
if (codec_context->codec_id == AV_CODEC_ID_MPEG1VIDEO)
@@ -1205,7 +1207,7 @@ static void usage_full() {
fprintf(stderr, " %s -w screen -f 60 -a default_output -c mkv -r 60 -o \"$HOME/Videos\"\n", program_name);
fprintf(stderr, " %s -w screen -f 60 -a default_output -c mkv -sc script.sh -r 60 -o \"$HOME/Videos\"\n", program_name);
fprintf(stderr, " %s -w portal -f 60 -a default_output -restore-portal-session yes -o \"$HOME/Videos/video.mp4\"\n", program_name);
fprintf(stderr, " %s -w screen -f 60 -a default_output -bm cbr -q 5000 -o \"$HOME/Videos/video.mp4\"\n", program_name);
fprintf(stderr, " %s -w screen -f 60 -a default_output -bm cbr -q 15000 -o \"$HOME/Videos/video.mp4\"\n", program_name);
//fprintf(stderr, " gpu-screen-recorder -w screen -f 60 -q ultra -pixfmt yuv444 -o video.mp4\n");
_exit(1);
}
@@ -3108,7 +3110,7 @@ int main(int argc, char **argv) {
usage();
}
video_bitrate *= 1000LL * 8LL;
video_bitrate *= 1000LL;
} else {
if(!quality_str)
quality_str = "very_high";