[Libav-user] Internal error: Could not register an input HW frame

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] Internal error: Could not register an input HW frame

freefalcon
Hi,

I am writing an h264 encoder, and the video frame data is from Nvidia GPU.

If the video frame was transferred from GPU memory to system memory, the encoder worked fine.

But I want to encode the HW frame directly to avoid performance loss. When I called avcodec_send_frame, I got an error :

Error registering an input resource: resource register failed (23)
Could not register an input HW frame

The error was triggered by nvEncRegisterResource function.

I'd like to know what I should do if I want to use HW frame directly, expecially on how to set AVHWFramesContext. 

Is there any example about this? Now, I just referred to vaapi_encode.c  (https://www.ffmpeg.org/doxygen/4.0/vaapi_encode_8c-example.html).

Thanks for your help.

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Internal error: Could not register an input HW frame

Attila Krüpl
hi,

i think you are trying to encode the sw frame instead of transfering the data buffer to hw frame and then encoding the hw frame. 

i believe the vaapi example works fine for the other hw encoders too (nvenc, qsv, amf)

best regards

attila

On Thu, 10 Oct 2019, 12:20 freefalcon, <[hidden email]> wrote:
Hi,

I am writing an h264 encoder, and the video frame data is from Nvidia GPU.

If the video frame was transferred from GPU memory to system memory, the encoder worked fine.

But I want to encode the HW frame directly to avoid performance loss. When I called avcodec_send_frame, I got an error :

Error registering an input resource: resource register failed (23)
Could not register an input HW frame

The error was triggered by nvEncRegisterResource function.

I'd like to know what I should do if I want to use HW frame directly, expecially on how to set AVHWFramesContext. 

Is there any example about this? Now, I just referred to vaapi_encode.c  (https://www.ffmpeg.org/doxygen/4.0/vaapi_encode_8c-example.html).

Thanks for your help.
_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".