Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ffmpeg-qsv] add jpeg encode playback_seek test case #690

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,19 @@ def gen_jpeg_cqp_parameters(spec):
params = gen_jpeg_cqp_variants(spec)
return keys, params

def gen_jpeg_seek_variants(spec):
for case, params in spec.items():
variants = params.get("variants", dict()).get("seek", [])
for variant in variants:
yield [
case, variant.get("fps", 25), variant.get("seek", 1)
]

def gen_jpeg_seek_parameters(spec):
keys = ("case", "fps", "seek")
params = gen_jpeg_seek_variants(spec)
return keys, params

def gen_vp8_cqp_variants(spec):
for case, params in spec.items():
variants = params.get("variants", dict()).get("cqp", None)
Expand Down
15 changes: 15 additions & 0 deletions test/ffmpeg-qsv/encode/jpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,18 @@ def test_r2r(self, case, quality):
self.init(spec_r2r, case, quality)
vars(self).setdefault("r2r", 5)
self.encode()

class seek(JPEGEncoderTest):
def init(self, tspec, case, fps, seek):
vars(self).update(tspec[case].copy())
vars(self).update(
case = case,
rcmode = "cqp",
fps = fps,
seek = seek,
)

@slash.parametrize(*gen_jpeg_seek_parameters(spec))
def test(self, case, fps, seek):
self.init(spec, case, fps, seek)
self.encode()