NVIDIA / VideoProcessingFramework

Set of Python bindings to C++ libraries which provides full HW acceleration for video decoding, encoding and GPU-accelerated color space and pixel format conversions
Apache License 2.0
1.32k stars 233 forks source link

Compile from source using old wiki doc and newest code #430

Closed quqixun closed 1 year ago

quqixun commented 1 year ago

Describe the problem I compiled VPF as the description in wiki, using code at commit ec8caf75c341b9f4a125db59676c6742c8b666fd .

Then, I got a library as shown below:

~/Git/VideoProcessingFramework/install/
└── PyNvCodec
    └── _PyNvCodec.cpython-39-x86_64-linux-gnu.so

I tried to add PyNvCodec dir to LD_LIBRARY_PATH, or copy _PyNvCodec.cpython-39-x86_64-linux-gnu.so to python lib, then import PyNvCodec, but I always get error ModuleNotFoundError: No module named 'PyNvCodec'.

How to use _PyNvCodec.cpython-39-x86_64-linux-gnu.so as a python library?

New compiled outputs are different with previous at 873a17b829f1bb2181b9e5a7bd24960dcf17d94a as shown below:

~/Git/VideoProcessingFramework/install/
└── bin
    ├── libTC_CORE.so
    ├── libTC.so
    ├── PyNvCodec.cpython-39-x86_64-linux-gnu.so
    ├── PytorchNvCodec.cpython-39-x86_64-linux-gnu.so
    └── ...

I added this bin dir to LD_LIBRARY_PATH, then sample code worked fine.

Could you please change the wiki to make it work with newest code.

Desktop (please complete the following information):

theHamsta commented 1 year ago

The wiki is outdated. When doing the update to the pip installation I tried to find the old wiki to update it but I didn't find it.

For the new installation process it shouldn't be necessary to manipulate to manipulate LD_LIBRARY_PATH path except your ffmpeg libraries are outside LD_LIBRARY_PATH/LD_LOAD_PATH. The pip installation should handle everything for you.

To use PyNvCodec.cpython-39-x86_64-linux.so from python it's directory needs to be in your PYTHON_PATH environment variable or sys.path python list. . You can also just change the working directory to the extension. Pip installation will handle this automatically for you. You can then import it via import PyNvCodec. When your python extension starts with an underscore, you also need to use import _PyNVCodec

theHamsta commented 1 year ago

I've updated the wiki. Please feel free to reopen, if the problem still exists