rgb is default (#35467)

* rgb is default

* change dummy default
This commit is contained in:
Harald Schäfer
2025-06-04 23:40:41 -07:00
committed by GitHub
parent 0d7b157965
commit a8639d3feb
2 changed files with 5 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ class DummyFrameReader(BaseFrameReader):
self.frame_count = frame_count
self.frame_type = FrameType.raw
def get(self, idx, count=1, pix_fmt="yuv420p"):
def get(self, idx, count=1, pix_fmt="rgb24"):
if pix_fmt == "rgb24":
shape = (self.h, self.w, 3)
elif pix_fmt == "nv12" or pix_fmt == "yuv420p":

View File

@@ -209,7 +209,7 @@ class BaseFrameReader:
def close(self):
pass
def get(self, num, count=1, pix_fmt="yuv420p"):
def get(self, num, count=1, pix_fmt="rgb24"):
raise NotImplementedError
@@ -497,7 +497,7 @@ class GOPFrameReader(BaseFrameReader):
return self.frame_cache[(num, pix_fmt)]
def get(self, num, count=1, pix_fmt="yuv420p"):
def get(self, num, count=1, pix_fmt="rgb24"):
assert self.frame_count is not None
if num + count > self.frame_count:
@@ -523,12 +523,12 @@ class StreamFrameReader(StreamGOPReader, GOPFrameReader):
GOPFrameReader.__init__(self, readahead, readbehind)
def GOPFrameIterator(gop_reader, pix_fmt):
def GOPFrameIterator(gop_reader, pix_fmt='rgb24'):
dec = VideoStreamDecompressor(gop_reader.fn, gop_reader.vid_fmt, gop_reader.w, gop_reader.h, pix_fmt)
yield from dec.read()
def FrameIterator(fn, pix_fmt, **kwargs):
def FrameIterator(fn, pix_fmt='rgb24', **kwargs):
fr = FrameReader(fn, **kwargs)
if isinstance(fr, GOPReader):
yield from GOPFrameIterator(fr, pix_fmt)