Hello,
I'm having a bit of trouble with a conversion from a YUVA420P to RGBA.
I have an OpenGL aplication that uses a video with alpha compresion and show
the video on the screen. I only know two codecs that save the Alpha
component, the "Animator" codec from a Quicktime video, or the vp6 codec
(format YUVA420P)
I'm using this context:
<code>
img_convert_ctx =
sws_getCachedContext(img_convert_ctx,pCodecCtx->width,pCodecCtx-->height,pCodecCtx->pix_fmt,pCodecCtx->width,pCodecCtx->height,
PIX_FMT_RGBA, SWS_BICUBIC,
NULL, NULL, NULL);
sws_scale(img_convert_ctx, pFrame->data,
pFrame->linesize, 0,
pCodecCtx->height,
pFrameConvertido->data, pFrameConvertido->linesize);
pFrameConvertido->data[0];
</code>
With a quicktime file everything works fine, I could write the animation on
the screen without any problem, but this file is to big (about 130MB for 2
secons).
If I try to use a "flv" file encodec with "vp6" in format YUVA420P,
sometimes work fine and sometimes the image is garbagged and seems
displaced.
I made some tests, and it seems that the libswscale have problems to change
format YUVA420P to RGBA when the video is not power of two. 64x64, 256x256,
512x512, 1024x1024
The same video rendered at 500x500 pixels doesn't work, but at 1024x1024
works fine.
One thing I don't know is the variable "pFrameConvertido->linesize", after
rendering a 500x500 video frame, printing this value give me a 2048, but I
thing it needs to be 2000 -> 500widthx32Bit/pixel = 2000.
Rendering a 1024x1024 video give me a value of 4096, that seems to be
correct -> 1024 pixels width x 32 bits/pixel = 4096
Someone know It's a bug of the swscale?
Could I render a texture in yuva420p format?
Thank's a lot, I apologiced for my english, I'm from Spain
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user