Skip to content

Commit

Permalink
vcomp/lavc: warn if requesting codecs w/o enc
Browse files Browse the repository at this point in the history
Warn if requesting input encoder pixel formats but the encoder is
not specified explicitly, eg. for
`uv -c lavc:codec=H.264 --param lavc-use-codec=help`
we cannot know, whinch encoder will be used in the
end (usually libx264 for YCbCr and libx264rgb for RGB pixel formats).
  • Loading branch information
MartinPulec committed Jun 3, 2024
1 parent 59407ef commit 3801f6e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/video_compress/libavcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,11 @@ void
handle_help(bool full, string const &req_encoder, string const &req_codec)
{
if (req_codec == "help") {
if (req_encoder.empty()) {
MSG(ERROR, "The encoder needs to be specified "
"explictly for input codec listing!\n");
return;
}
const auto *codec =
avcodec_find_encoder_by_name(req_encoder.c_str());
if (codec != nullptr) {
Expand Down

0 comments on commit 3801f6e

Please sign in to comment.