diff --git a/src/artwork.c b/src/artwork.c index 423bdebc..a17a6519 100644 --- a/src/artwork.c +++ b/src/artwork.c @@ -457,7 +457,11 @@ artwork_rescale(struct evbuffer *evbuf, AVFormatContext *src_ctx, int s, int out dst->codec_id = dst_fmt->video_codec; dst->codec_type = AVMEDIA_TYPE_VIDEO; - dst->pix_fmt = avcodec_find_best_pix_fmt_of_list((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL); + if (dst_fmt->video_codec == AV_CODEC_ID_PNG) + dst->pix_fmt = AV_PIX_FMT_RGB24; + else + dst->pix_fmt = avcodec_find_best_pix_fmt_of_list((enum AVPixelFormat *)img_encoder->pix_fmts, src->pix_fmt, 1, NULL); + if (dst->pix_fmt < 0) { DPRINTF(E_LOG, L_ART, "Could not determine best pixel format\n");