Open utterances-bot opened 2 years ago
Thanks for sharing! Do you mind to give more details about why ffmpeg-python offers "slow speed in performance-critical applications"? Telling us about your use-case and how you used it would suffix 😊
I almost bought it due to the async call in the TF example.
Thanks for sharing! Do you mind to give more details about why ffmpeg-python offers "slow speed in performance-critical applications"? Telling us about your use-case and how you used it would suffix 😊
I almost bought it due to the async call in the TF example.
Initially, we use ffmpeg-python to extract frames from videos at a specific rate. We have observed a higher frame extraction speed when using pyav. So we switch to use pyav instead.
Thank you for the short introduction. It is still helpful a few years later. Note that your snippet has three typing errors.
if not os.path.exist(out_dir): # exist -> exists
frame.to_image.save("frame-{idx}.jpg") # to_image -> to_image() / "fram..." -> f"fram..."
For the to_image
method to work, I also had to install the Pillow package.
PyAV for video processing - jdhao's blog
ffmpeg is an excellent tool for video processing. However, using ffmpeg directly inside Python is not convenient enough. Previously, I have been using ffmpeg-python, which is a thin wrapper around the ffmpeg command line executable.
https://jdhao.github.io/2021/11/04/pyav-video-processing/