transcode: fix user filter codepath on transcoding video
authorIlkka Ollakka <ileoo@videolan.org>
Mon, 14 Jan 2019 06:38:57 +0000 (08:38 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Mon, 14 Jan 2019 06:43:48 +0000 (08:43 +0200)
Everything in chroma wise and size-wise are already in ok case without
this check, in this codepath we broke the i_chroma for encoder input fmt
and defined it to be encoder output i_chroma, which is usually the
codec. So filter chain ended up trying to find chroma-filtering between
I420 and h264, and failing.

Tested with
"#transcode{vfilter=canvas{width=640,height=640,aspect=16:9},vcodec=h264}:dummy"
and
"#transcode{width=640,height=640,vcodec=h264}:dummy"

Without this change, first case failed and second worked, with this code
removal, both cases worked and produced output file that was correct
resolution and size and playable.

modules/stream_out/transcode/video.c

index 90f32a9..b3f2cb5 100644 (file)
@@ -281,25 +281,6 @@ static void transcode_video_filter_init( sout_stream_t *p_stream,
 
         /* Update encoder so it matches filters output */
         transcode_encoder_update_format_in( id->encoder, p_src );
-
-        /* FIXME: modifying decoder output size from filters
-         *        sounds really suspicious an buggy
-         *        see also size adaption already done in conversion_video_filter_append() */
-        const es_format_t *enc_out = transcode_encoder_format_out( id->encoder );
-        if( enc_out->video.i_width != p_dst->video.i_width ||
-            enc_out->video.i_height != p_dst->video.i_height ||
-            enc_out->video.i_sar_num != p_dst->video.i_sar_num ||
-            enc_out->video.i_sar_den != p_dst->video.i_sar_den )
-        {
-            es_format_t tmp;
-            es_format_Copy( &tmp, enc_out );
-            tmp.video.i_width = p_dst->video.i_width;
-            tmp.video.i_height = p_dst->video.i_height;
-            tmp.video.i_sar_num = p_dst->video.i_sar_num;
-            tmp.video.i_sar_den = p_dst->video.i_sar_den;
-            transcode_encoder_update_format_in( id->encoder, &tmp );
-            es_format_Clean( &tmp );
-        }
     }
 }