[Libav-user] does swscale support rgbf32 conversions?

Andrew Randrianasulu randrianasulu at gmail.com
Tue Nov 21 02:33:48 EET 2023


I am trying to add fp32 tiff reading via ffmpeg for cinelerra-gg.

we have this routine:

convert_ctx = sws_getCachedContext(convert_ctx, ip->width, ip->height,
pix_fmt,
 frame->get_w(), frame->get_h(), ofmt, SWS_POINT, NULL, NULL, NULL);

if( !convert_ctx ) {
               fprintf(stderr, "FFVideoConvert::convert_picture_frame:"
                       " sws_getCachedContext() failed\n");
               fprintf(stderr, "pix_fmt %s \n",
av_get_pix_fmt_name(pix_fmt));
 fprintf(stderr, "output format %s \n", av_get_pix_fmt_name(ofmt));

return -1;
}


so for rgbaf32 tiff it prints:


FFMPEG::open_decoder: some stream have bad times:
/data/data/com.termux/files/home/test_color.tif  FFMPEG::open_decoder: some
stream have bad times: /data/data/com.termux/files/home/test_color.tif
FFVideoConvert::convert_picture_frame: sws_getCachedContext() failed
                       pix_fmt rgbf32le
                                output format rgbaf32le
                                   FFVideoConvert::convert_picture_frame:
sws_getCachedContext() failed                               pix_fmt
rgbf32le
 output format rgbf32le

for rgba-float pipeline, or


FFVideoConvert::convert_picture_frame: sws_getCachedContext() failed
                       pix_fmt rgbf32le
                                 output format rgba

for rgba-8 pipeline.


tiff images from


https://github.com/imageio/imageio/files/7697625/TestImages_float32_Photoshop.zip

our ffmpeg.C

http://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blob;f=cinelerra-5.1/cinelerra/ffmpeg.C;h=e95cc87e6da6f8c835a199db8ea445d9696a8190;hb=HEAD

I just added mappings to

case BC_RGBA_FLOAT:     return AV_PIX_FMT_RGBAF32LE;

and from libavcodec

case AV_PIX_FMT_RGBAF32LE:      return BC_RGBA_FLOAT;

did I miss something in setup parameters for this format?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20231121/cc37581c/attachment.htm>


More information about the Libav-user mailing list