diff --git a/cpu_decode.py b/cpu_decode.py index 094b8e6..6ceee85 100644 --- a/cpu_decode.py +++ b/cpu_decode.py @@ -9,7 +9,8 @@ logger = logging.getLogger() class PyAVDecode: - def __init__(self, video_path, start_time=None, time_step=None) -> None: + def __init__(self, video_path, gpu_id=0, start_time=None, time_step=None) -> None: + # gpu_id is useless, consistent with the gpu decode self._container = av.open(video_path) self._stream = self._container.streams.video[0] self._start_time = start_time if start_time is not None else 0 diff --git a/video_decoder.py b/video_decoder.py index 4c0b57c..b8c5a7d 100644 --- a/video_decoder.py +++ b/video_decoder.py @@ -41,13 +41,13 @@ class VideoDecoder(PyOperator): yield from VPFDecode(video_path, self._gpu_id, self._start_time).decode() def _cpu_decode(self, video_path): - yield from PyAVDecode(video_path, self._start_time).decode() + yield from PyAVDecode(video_path, self._gpu_id, self._start_time).decode() def _gpu_time_step_decode(self, video_path, time_step): yield from VPFDecode(video_path, self._gpu_id, self._start_time, time_step).time_step_decode() def _cpu_time_step_decode(self, video_path, time_step): - yield from PyAVDecode(video_path, self._start_time, time_step).time_step_decode() + yield from PyAVDecode(video_path, self._gpu_id, self._start_time, time_step).time_step_decode() def decode(self, video_path: str): try: