From df7122fe076fe24bd468644e7129a3b5d61aace8 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 17 Apr 2023 00:36:36 -0700 Subject: [PATCH] Disable ENCODER_COPY --- main.go | 2 +- stream.go | 23 +++++++++-------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/main.go b/main.go index 6a70bec7..ddfe717f 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( ) const ( - VERSION = "0.1.0" + VERSION = "0.1.1" ) type Handler struct { diff --git a/stream.go b/stream.go index a8339016..f303443a 100644 --- a/stream.go +++ b/stream.go @@ -364,20 +364,15 @@ func (s *Stream) transcodeArgs(startAt float64) []string { // encoder selection CV := ENCODER_X264 - if s.m.probe.CodecName == CODEC_H264 && s.quality == QUALITY_MAX { - // Use original stream - CV = ENCODER_COPY - } else { - // Check whether hwaccel should be used - if s.c.VAAPI { - CV = ENCODER_VAAPI - extra := "-hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi" - args = append(args, strings.Split(extra, " ")...) - } else if s.c.NVENC { - CV = ENCODER_NVENC - extra := "-hwaccel cuda" - args = append(args, strings.Split(extra, " ")...) - } + // Check whether hwaccel should be used + if s.c.VAAPI { + CV = ENCODER_VAAPI + extra := "-hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi" + args = append(args, strings.Split(extra, " ")...) + } else if s.c.NVENC { + CV = ENCODER_NVENC + extra := "-hwaccel cuda" + args = append(args, strings.Split(extra, " ")...) } // Input specs