Skip to content

Investigate ffmpegcv backend for video input #505

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

Open
Breakthrough opened this issue Apr 15, 2025 · 2 comments
Open

Investigate ffmpegcv backend for video input #505

Breakthrough opened this issue Apr 15, 2025 · 2 comments
Labels

Comments

@Breakthrough
Copy link
Owner

Breakthrough commented Apr 15, 2025

See if https://github.com/chenxinfeng4/ffmpegcv is worth adding as a backend. It might be useful in the future, especially as it supports GPU (CUDA).

@Breakthrough
Copy link
Owner Author

Breakthrough commented Apr 27, 2025 via email

@NevermindNilas
Copy link

NevermindNilas commented Apr 28, 2025

Hi @Breakthrough

Moviepy afaik already integrates a similar approach to piping ffmpeg's rawvideo stdout.

But if you wish to add it yourself you have to make sure that all color formats are supported which is a pain, assuming your internal pipeline works with rgb24 / bgr24, in that case yuv420p, rgb24 or bgr24 will work just fine because FFMPEG can internally change the color format to the desired color format, but the moment you have yuv420p10le or yuv444p inputs the pipeline breaks. Maybe you could use kornia's built in functions in order to accurately estimate the bytesizes of each frame but as you can imagine, it's a pretty error prone / fragile workflow.

I have a similar approach right here altho' deprecated for a good while now due to the reasons mentioned above:

https://github.com/NevermindNilas/TheAnimeScripter/blob/ced1cf3ac6da5a96b40d1c917168a3e47a844a45/src%2FffmpegSettings.py#L108

If you wish to add such workflow lmk as I am willing to contribute to the best of my knowledge, but I'd suggest sticking with pyav for the simplicity and look for other opportunities to improve performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants