BT.601 color matrix instead of the BT.709 color matrix. RGB codecs like\r
qtrle was never affected but all the YCbCr based codecs were.\r
+ Fixed bug in parsing of paths containing -.\r
+ + Fixed bugs where previously effective arguments like -pix_fmt were\r
+ ignored.\r
o DeckLink consumer:\r
+ Rewrote the frame hand-off between send() and ScheduledFrameCompleted() in\r
a way that hopefully resolves all dead-lock scenarios previously possible.\r
{
configure_video_filters(
*video_codec,
- try_remove_arg<std::string>(options_,
- boost::regex("vf|f:v|filter:v")).get_value_or(""));
+ try_remove_arg<std::string>(options_, boost::regex("vf|f:v|filter:v"))
+ .get_value_or(""),
+ try_remove_arg<std::string>(options_, boost::regex("pix_fmt")));
configure_audio_filters(
*audio_codec,
void configure_video_filters(
const AVCodec& codec,
- std::string filtergraph)
+ std::string filtergraph,
+ const boost::optional<std::string>& preferred_pix_fmt)
{
video_graph_.reset(
avfilter_graph_alloc(),
#pragma warning (push)
#pragma warning (disable : 4245)
- FF(av_opt_set_int_list(
+ if (preferred_pix_fmt)
+ {
+ auto requested_fmt = av_get_pix_fmt(preferred_pix_fmt->c_str());
+ auto valid_fmts = from_terminated_array<AVPixelFormat>(codec.pix_fmts, AVPixelFormat::AV_PIX_FMT_NONE);
+
+ if (!cpplinq::from(valid_fmts).contains(requested_fmt))
+ CASPAR_THROW_EXCEPTION(user_error() << msg_info(*preferred_pix_fmt + " is not supported by codec."));
+
+ std::vector<AVPixelFormat> fmts = { requested_fmt, AVPixelFormat::AV_PIX_FMT_NONE };
+
+ FF(av_opt_set_int_list(
+ filt_vsink,
+ "pix_fmts",
+ fmts.data(),
+ -1,
+ AV_OPT_SEARCH_CHILDREN));
+ }
+ else
+ {
+ FF(av_opt_set_int_list(
filt_vsink,
"pix_fmts",
codec.pix_fmts,
-1,
AV_OPT_SEARCH_CHILDREN));
+ }
+
#pragma warning (pop)