Opened 11 years ago

Closed 11 years ago

#2578 closed defect (fixed)

avcodec_find_best_pix_fmt_of_list gives wrong format

Reported by: str Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
avcodec_find_best_pix_fmt_of_list gives me AV_PIX_FMT_PAL8 instead of AV_PIX_FMT_GRAY8, although src is AV_PIX_FMT_GRAY8 and it is contained in the list.
How to reproduce:
Use the ffmpeg API and try to call avcodec_find_best_pix_fmt_of_list with src = GRAY8. As destination list I used the list of png encoder, which contains GRAY8 as well as PAL8.

Change History (6)

comment:1 by Carl Eugen Hoyos, 11 years ago

Is this also reproducible with current git head?
How can I reproduce this problem?

in reply to:  1 comment:2 by str, 11 years ago

Replying to cehoyos:

Is this also reproducible with current git head?
How can I reproduce this problem?

Yes. This problem also occurs in git head.
I already explained how to reproduce:
Simply call
avcodec_find_best_pix_fmt_of_list(pix_fmt_list, AV_PIX_FMT_GRAY8, 0, 0)

with the pix_fmt_list taken from png encoder for example.

comment:3 by Carl Eugen Hoyos, 11 years ago

What I meant was:
Assuming this is not reproducible with ffmpeg (or is it?), could you provide source code that allows to reproduce the problem?

comment:4 by Carl Eugen Hoyos, 11 years ago

Version: 1.2git-master

comment:5 by str, 11 years ago

  AVPixelFormat list[] = {PIX_FMT_PAL8, PIX_FMT_GRAY8};
  AVPixelFormat src = PIX_FMT_GRAY8;

  AVPixelFormat res = avcodec_find_best_pix_fmt_of_list(list, src, 0, 0);
//res is PIX_FMT_PAL8 instead of PIX_FMT_GRAY8
Last edited 11 years ago by Carl Eugen Hoyos (previous) (diff)

comment:6 by Michael Niedermayer, 11 years ago

Reproduced by developer: set
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.