Commit d16fb5e7 authored by Ilkka Ollakka's avatar Ilkka Ollakka

transcode: add chroma conversion to be the first filter if needed

For example croppadd doesn't like if input and output chromas are not the same.
This is visible for example webcam input and h264 encode (YUV2->I420).

Reported by: Jean-Paul Saman
parent 6403d128
......@@ -337,6 +337,13 @@ static void transcode_video_filter_init( sout_stream_t *p_stream,
p_stream->p_sys );
filter_chain_Reset( id->p_uf_chain, p_fmt_out,
&id->p_encoder->fmt_in );
if( p_fmt_out->video.i_chroma != id->p_encoder->fmt_in.video.i_chroma )
{
filter_chain_AppendFilter( id->p_uf_chain,
NULL, NULL,
p_fmt_out,
&id->p_encoder->fmt_in );
}
filter_chain_AppendFromString( id->p_uf_chain, p_stream->p_sys->psz_vf2 );
p_fmt_out = filter_chain_GetFmtOut( id->p_uf_chain );
es_format_Copy( &id->p_encoder->fmt_in, p_fmt_out );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment