From 23a236b4b2c551376b90c31d9a6cf72025da368c Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 21 Jul 2022 17:12:09 +0200 Subject: [PATCH 1/1] Support --record-x264-video with AV1 HTTP output. --- nageru/flags.cpp | 4 +++- nageru/video_encoder.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nageru/flags.cpp b/nageru/flags.cpp index 2bd0eec..1878038 100644 --- a/nageru/flags.cpp +++ b/nageru/flags.cpp @@ -460,7 +460,6 @@ void parse_flags(Program program, int argc, char * const argv[]) break; case OPTION_RECORD_X264_VIDEO: global_flags.x264_video_to_disk = true; - global_flags.x264_video_to_http = true; break; case OPTION_SEPARATE_X264_DISK_ENCODE: global_flags.x264_video_to_disk = true; @@ -706,6 +705,9 @@ void parse_flags(Program program, int argc, char * const argv[]) global_flags.x264_video_to_http = true; } } + if (global_flags.x264_video_to_disk && !global_flags.uncompressed_video_to_http && !global_flags.av1_video_to_http) { + global_flags.x264_video_to_http = true; // Quick Sync to HTTP but x264 to disk doesn't make sense. + } if (global_flags.min_num_cards <= 0) { fprintf(stderr, "ERROR: --num-cards must be at least 1\n"); exit(1); diff --git a/nageru/video_encoder.cpp b/nageru/video_encoder.cpp index 3342cfb..31c6b4d 100644 --- a/nageru/video_encoder.cpp +++ b/nageru/video_encoder.cpp @@ -224,7 +224,7 @@ void VideoEncoder::open_output_stream() avctx->flags = AVFMT_FLAG_CUSTOM_IO; string video_extradata; - if (global_flags.x264_video_to_http || global_flags.x264_video_to_disk) { + if (global_flags.x264_video_to_http) { video_extradata = x264_encoder->get_global_headers(); #ifdef HAVE_AV1 } else if (global_flags.av1_video_to_http) { -- 2.39.5