Skip to content

Commit

Permalink
Updated messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Feb 24, 2024
1 parent 05e1fd6 commit 7932679
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions lib/tlIO/FFmpegWrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extern "C"
}

#define LOG_INFO(x) std::cout << " [save] " << x << std::endl;
#define LOG_WARNING(x) std::cerr << " [save] " << x << std::endl;

namespace tl
{
Expand Down Expand Up @@ -202,11 +203,19 @@ namespace tl
if (*p == AV_PIX_FMT_NONE)
{
if (target != AV_PIX_FMT_NONE)
av_log(NULL, AV_LOG_WARNING,
"Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'\n",
av_get_pix_fmt_name(target),
codec->name,
av_get_pix_fmt_name(best));
{
const char* targetFormat =
av_get_pix_fmt_name(target);
const char* bestFormat = av_get_pix_fmt_name(best);
const std::string msg =
string::Format(
"Incompatible pixel format '{0}' for codec "
"'{1}', auto-selecting format '{2}'.")
.arg(targetFormat)
.arg(codec->name)
.arg(bestFormat);
LOG_WARNING(msg);
}
return best;
}
}
Expand Down Expand Up @@ -854,7 +863,7 @@ namespace tl
}

const std::string codecName = avCodec->name;
msg = string::Format("Saving audio with '{1}' codec.")
msg = string::Format("Tring to save audio with '{1}' codec.")
.arg(codecName);
LOG_INFO(msg);

Expand Down Expand Up @@ -1004,11 +1013,13 @@ namespace tl
}
else if (avCodecID == AV_CODEC_ID_VP9)
{
// Try hardware encoders first
#ifdef __APPLE__
avCodec = avcodec_find_encoder_by_name("videotoolbox_vp9");
#else
avCodec = avcodec_find_encoder_by_name("vp9_qsv");
#endif
// If failed, use software encoder
if (!avCodec)
{
avCodec = avcodec_find_encoder_by_name("libvpx-vp9");
Expand Down Expand Up @@ -1174,7 +1185,7 @@ namespace tl
}

const std::string codecName = avCodec->name;
msg = string::Format("Saving video with '{1}' codec.")
msg = string::Format("Trying to save video with '{1}' codec.")
.arg(codecName);
LOG_INFO(msg);

Expand Down

0 comments on commit 7932679

Please sign in to comment.