Skip to content

Commit

Permalink
lavc,lavd vid: print used subs in warn
Browse files Browse the repository at this point in the history
Print used subsampling (or sw fmt in lavd) in warning if not using 4:2:0.

This may be helpful sometimes as an additional information.
  • Loading branch information
MartinPulec committed Oct 6, 2023
1 parent 15fe21d commit f2ac2cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/video_compress/libavcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1584,8 +1584,10 @@ incomp_feature_warn(enum incomp_feature f, int req_val)
return;
}
MSG(WARNING,
"Selected pixfmt has not 4:2:0 subsampling, "
"which is usually not supported by hw. decoders\n");
"Selected pixfmt has subsampling %d:%d:%d and not 4:2:0, "
"which is usually not supported by hw. decoders\n",
(req_val / 1000), ((req_val / 100) % 10),
((req_val / 10) % 10));
disable_opt = ":subs=420";
break;
}
Expand Down
5 changes: 3 additions & 2 deletions src/video_decompress/libavcodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,9 @@ static enum AVPixelFormat get_format_callback(struct AVCodecContext *s, const en
struct state_libavcodec_decompress *state = (struct state_libavcodec_decompress *) s->opaque;
if (av_pixfmt_get_subsampling(s->sw_pix_fmt) != SUBS_420) {
log_msg(LOG_LEVEL_WARNING, "[lavd] Hw. acceleration requested "
"but incoming video has not 4:2:0 subsampling, "
"which is usually not supported by hw. accelerators\n");
"but incoming video has not 4:2:0 subsampling (format is %s), "
"which is usually not supported by hw. accelerators\n",
av_get_pix_fmt_name(s->sw_pix_fmt));
}
const enum hw_accel_type forced_hwaccel =
strlen(hwaccel) > 0 ? hw_accel_from_str(hwaccel)
Expand Down

0 comments on commit f2ac2cb

Please sign in to comment.