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

HWACCEL + tensorflow without leaving GpuRam #837

Open
BlueMagma2 opened this issue Apr 17, 2024 · 1 comment
Open

HWACCEL + tensorflow without leaving GpuRam #837

BlueMagma2 opened this issue Apr 17, 2024 · 1 comment

Comments

@BlueMagma2
Copy link

I would like to decode a video using complex_filter and nvdec hardware acceleration.
To have it be as fast as possible I would like the decoded frame to be passed to tensorflow directly without leaving the gpu ram so that we don't spend time memcpy-ing the frame from gpu memory to cpu memory and back.

Is it possible using ffmpeg-python ?

@page200
Copy link

page200 commented Jul 8, 2024

In the "Experimental" section of TensorFlow, there's the barely documented/commented tfio.experimental.ffmpeg.decode_video() -> ffmpeg_ops.io_ffmpeg_decode_video() -> libtensorflow_io_ffmpeg_4.2.so -> ...

PyTorch seems more promising. TorchAudio (a library for audio and signal processing with PyTorch) talks here about video:

Using NVIDIA’s GPU decoder and encoder, it is also possible to pass around CUDA Tensor directly, that is decode video into CUDA tensor or encode video from CUDA tensor, without moving data from/to CPU.

The bottom of that page leads to tutorials on video decoding and encoding.

Keep us posted how that goes.

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

No branches or pull requests

2 participants