From 54dd20e3032e453e67c7ccad3d92a63c2c14364e Mon Sep 17 00:00:00 2001 From: Wang Wenqing Date: Tue, 29 Oct 2024 16:06:01 +0800 Subject: [PATCH] [libs]remove extra_hw_frames on ffmpeg ffmpeg should auto create surfaces now Signed-off-by: Wang Wenqing --- lib/ffmpeg/qsv/transcoder.py | 3 +-- lib/ffmpeg/transcoderbase.py | 6 ++---- lib/ffmpeg/vaapi/transcoder.py | 2 -- test/ffmpeg-qsv/transcode/mpeg2.py | 2 -- test/ffmpeg-vaapi/transcode/mpeg2.py | 2 -- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/ffmpeg/qsv/transcoder.py b/lib/ffmpeg/qsv/transcoder.py index 93664641..58b38fb2 100644 --- a/lib/ffmpeg/qsv/transcoder.py +++ b/lib/ffmpeg/qsv/transcoder.py @@ -89,6 +89,5 @@ class TranscoderTest(BaseTranscoderTest): def before(self): super().before() self.hwaccel = "qsv" - self.ohwframes = 64 - self.ihwframes = 64 + self.hwframes = 64 self.hwdevice = f'qsv,child_device={get_media().render_device}' diff --git a/lib/ffmpeg/transcoderbase.py b/lib/ffmpeg/transcoderbase.py index f2fdeb13..527fa5fe 100644 --- a/lib/ffmpeg/transcoderbase.py +++ b/lib/ffmpeg/transcoderbase.py @@ -139,8 +139,6 @@ def gen_input_opts(self): opts += " -hwaccel_output_format {hwaccel}" if "hw" == self.mode: opts += " -hwaccel {hwaccel}" - if vars(self).get("ihwframes", None) is not None: - opts += " -extra_hw_frames {ihwframes}" opts += " -c:v {}".format(self.get_decoder(self.codec, self.mode)) opts += f" -i {filepath2os(self.source)}" @@ -174,8 +172,8 @@ def gen_output_opts(self): filters.extend(["hwdownload", f"format={iformat}"]) elif ("sw", "hw") == tmode: # SW to HW transcode filters.extend([f"format={iformat}", "hwupload"]) - if vars(self).get("ohwframes", None) is not None: - filters[-1] += "=extra_hw_frames={ohwframes}" + if vars(self).get("hwframes", None) is not None: + filters[-1] += "=extra_hw_frames={hwframes}" vppscale = self.get_vpp_scale( output.get("width", None), output.get("height", None), mode) diff --git a/lib/ffmpeg/vaapi/transcoder.py b/lib/ffmpeg/vaapi/transcoder.py index efccd973..82faf706 100644 --- a/lib/ffmpeg/vaapi/transcoder.py +++ b/lib/ffmpeg/vaapi/transcoder.py @@ -83,5 +83,3 @@ class TranscoderTest(BaseTranscoderTest): def before(self): super().before() self.hwaccel = "vaapi" - self.ohwframes = 64 - self.ihwframes = 64 diff --git a/test/ffmpeg-qsv/transcode/mpeg2.py b/test/ffmpeg-qsv/transcode/mpeg2.py index 54c40086..c5e77b2d 100644 --- a/test/ffmpeg-qsv/transcode/mpeg2.py +++ b/test/ffmpeg-qsv/transcode/mpeg2.py @@ -21,5 +21,3 @@ def test(self, case): ) self.transcode() - def before(self): - super().before() diff --git a/test/ffmpeg-vaapi/transcode/mpeg2.py b/test/ffmpeg-vaapi/transcode/mpeg2.py index 460230f9..cb5e6186 100644 --- a/test/ffmpeg-vaapi/transcode/mpeg2.py +++ b/test/ffmpeg-vaapi/transcode/mpeg2.py @@ -21,5 +21,3 @@ def test(self, case): ) self.transcode() - def before(self): - super().before()