Opened 7 years ago
Closed 6 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 follow-up: ↓ 2 Changed 7 years ago by cehoyos
comment:2 in reply to: ↑ 1 Changed 7 years ago by str
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 Changed 7 years ago by cehoyos
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 Changed 7 years ago by cehoyos
- Version changed from 1.2 to git-master
comment:5 Changed 7 years ago by str
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
comment:6 Changed 6 years ago by michael
- Reproduced by developer set
- Resolution set to fixed
- Status changed from new to closed
Is this also reproducible with current git head?
How can I reproduce this problem?