-
-
Notifications
You must be signed in to change notification settings - Fork 345
Description
Hi!
I'm currently trying to switch to v3's read and write functionality for videos. For the most part everything works smoothly, I just have a few understanding issues on my side that I'd love to get some help with.
- My write code looks as follow:
with iio.imopen(temp_output, "w", plugin="pyav") as writer:
writer.init_video_stream("libx264", fps=fps)
...
writer.write(batch)
This works great, but I can't seem to figure out how to control the quality - in v2's FFmpeg writer there's the quality keyword that allows a quality between 0 and 10. How can I achieve something similar in v3 with pyav?
- My read works as follows:
with iio.imopen(input_path, "r", plugin="pyav") as reader:
for batch_index, frame_buffer in enumerate(chunked(reader.iter(thread_type="FRAME"), batch_size)):
...
I feel like I'm losing out on performance here, because I don't understand how to do a batch read properly. This snippet absolutely works, but do I understand the batching correctly? My goal is to load a batch of images into memory as fast as possible, process it and move on with the next batch.
I have, of course, tried to read the docs, but for these two questions I can't seem to come up with a solution. Thanks in advance for your feedback, and please tell me if there's any information I'm missing!
System information: python 3.11 on macOS (arm), av 9.2.0 and imageio 2.33.1.