[Libav-user] Converting AV_PIX_FMT_CUDA image (AVFrame) to AV_PIX_FMT_BGRA image
Ахмед Анам
ahmedanam at mail.ru
Fri Feb 22 12:24:18 EET 2019
I have to transform AV_PIX_FMT_CUDA image to AV_PIX_FMT_BGRA image. In your code you transform AV_PIX_FMT_RGB24 to AV_PIX_FMT_NV12. I tried to run your code. There are no errors but I can not display images because I need BGRA pixel format to display them. I don't understand how to get BGRA image from AV_PIX_FMT_CUDA image.
>Четверг, 21 февраля 2019, 17:36 +03:00 от Omar Álvarez <omar.alvarez at cinfo.es>:
>
>You could try:
>
>sws_getContext(src_width, src_height, (AVPixelFormat) AV_PIX_FMT_RGB24,
> src_width, src_height, (AVPixelFormat) AV_PIX_FMT_NV12,
> SWS_FAST_BILINEAR, NULL, NULL, NULL);
>
>But for me it was too slow due to resizing code after the Meltdown bugs.
>El jue., 21 feb. 2019 a las 14:12, Ахмед Анам (< ahmedanam-at-mail.ru at ffmpeg.org >) escribió:
>>Hello!
>>
>>I am trying to use libav API with hardware accelaration (CUDA). I need to transform an AVFrame with AV_PIX_FMT_CUDA pixel format to the frame with AV_PIX_FMT_BGRA pixel format. I tried to create Sws_Context for this purpose ( my_sws_context = sws_getContext(width, height, AV_PIX_FMT_CUDA , width, height, AV_PIX_FMT_BGRA , SWS_BILINEAR, NULL, NULL, NULL) ) but the function always return NULL.
>>
>>What is the best way to do this? Are there some examples?
>>
>>
>>--
>>С уважением, Ахмед Анам.
>>Best regards, Akhmed Anam. _______________________________________________
>>Libav-user mailing list
>>Libav-user at ffmpeg.org
>>https://ffmpeg.org/mailman/listinfo/libav-user
>>
>>To unsubscribe, visit link above, or email
>>libav-user-request at ffmpeg.org with subject "unsubscribe".
>_______________________________________________
>Libav-user mailing list
>Libav-user at ffmpeg.org
>https://ffmpeg.org/mailman/listinfo/libav-user
>
>To unsubscribe, visit link above, or email
>libav-user-request at ffmpeg.org with subject "unsubscribe".
--
С уважением, Ахмед Анам.
Best regards, Akhmed Anam.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20190222/10fe957b/attachment.html>
More information about the Libav-user
mailing list