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

Opportunity convert one frame from bytes #105

Open
kadimon opened this issue Sep 16, 2024 · 3 comments
Open

Opportunity convert one frame from bytes #105

kadimon opened this issue Sep 16, 2024 · 3 comments

Comments

@kadimon
Copy link

kadimon commented Sep 16, 2024

Is it possible to use this library to convert a single keyframe from bytes?

@RomanArzumanyan
Copy link
Owner

Hi @kadimon

Yes, it does.
Did you try the samples ?

@kadimon
Copy link
Author

kadimon commented Sep 16, 2024

I have not found an example of creating a packet of bytes in samples. I am currently experiencing some hardware compatibility issues when trying to run code from a decoder sample. It is great that the ability to decode bytes of keyframes is available. @RomanArzumanyan if you have a sample code that would be cool.

@RomanArzumanyan
Copy link
Owner

RomanArzumanyan commented Sep 16, 2024

@kadimon

You can e. g. run samples in Google Colab notebook with T4 runtime type.

I have not found an example of creating a packet of bytes in samples

That contradicts the issue description. I was under impression that you need to decode a single key frame.
If you don't have compressed packet with the key frame, you have to create it first.
Any suitable framework will do. VALI, OpenCV, PyAV, you name it.
Encoding sample isn't written yet, but you can reference PyNvEncoder class unit test, it's quite small and simple:

def test_encode_all_surfaces(self):

Please note that VALI can only take files as input. You can mmap encoded packet, but it has to have the URL.
That is done to keep PyDecoder class API manageable. Otherwise it will have to return variety of status codes for all sorts of corner cases (like when a single packet isn't enough to decode something meaningful).

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