[Ffmpeg-devel] avcodec_find_best_pix_fmt non consistent with mjpeg?!?

Karl H. Beckers karl.h.beckers
Mon Jul 3 23:21:07 CEST 2006


Hi folks,

had previously hard-coded pix_fmt for mjpeg encoding to yuvj420p to
avoid colorspace error messages.

Am now trying to make this bit in my app more generic by using
avcodec_find_best_pix_fmt.

For codec 8 (CODEC_ID_MJPEG) this with pix_fmt_mask 15 (from the codec),
has alpha 0, input_pixfmt 9 yields: output pixfmt 2 (PIX_FMT_RGB24).

While this all looks very well with RGB24 being less lossy than YUV422
(moving up the mask 15) later-on I get the dreaded colorspace error
again:

[mjpeg @ 0x8390ba8]colorspace not supported in jpeg

Am I wrong to expect ...find_best_pix_fmt to always return a valid
pix_fmt from the mask? ... or is there no generic always correct
algorithm and I need to keep this hard-codec? ... or does the
find_best_pix_fmt assume the input pix_fmt is yup420p from a previous
decode?

TIA,

Karl.








More information about the ffmpeg-devel mailing list