[vlc-commits] transcode: use transcode_video_size_config_apply to get the encoder input format

Steve Lhomme git at videolan.org
Mon Jan 18 08:08:34 UTC 2021


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jan 14 13:47:25 2021 +0100| [2ec4cd4ac1a88a8879df7cd0e680b9b404b7ef84] | committer: Steve Lhomme

transcode: use transcode_video_size_config_apply to get the encoder input format

Use it via transcode_encoder_video_set_src() which does a bit more.

As opposed to before we set the output dimensions as the ones from the input,
not the other way around.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2ec4cd4ac1a88a8879df7cd0e680b9b404b7ef84
---

 modules/stream_out/transcode/encoder/video.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/modules/stream_out/transcode/encoder/video.c b/modules/stream_out/transcode/encoder/video.c
index 683d9031af..cfa4b09504 100644
--- a/modules/stream_out/transcode/encoder/video.c
+++ b/modules/stream_out/transcode/encoder/video.c
@@ -238,16 +238,14 @@ void transcode_encoder_video_configure( vlc_object_t *p_obj,
     p_enc->p_encoder->fmt_out.i_codec = p_enc_out->i_chroma = p_cfg->i_codec;
     p_enc->p_encoder->fmt_out.i_bitrate = p_cfg->video.i_bitrate;
     p_enc_out->i_sar_num = p_enc_out->i_sar_den = 0;
-    if( p_cfg->video.fps.num )
+    transcode_encoder_video_set_src(p_enc->p_encoder, p_src, p_cfg);
+    if (p_enc_in->i_frame_rate && p_enc_in->i_frame_rate_base)
     {
-        p_enc_in->i_frame_rate = p_enc_out->i_frame_rate =
-                p_cfg->video.fps.num;
-        p_enc_in->i_frame_rate_base = p_enc_out->i_frame_rate_base =
-                __MAX(p_cfg->video.fps.den, 1);
+        p_enc_out->i_frame_rate = p_enc_in->i_frame_rate;
+        p_enc_out->i_frame_rate_base = p_enc_in->i_frame_rate_base;
     }
 
     /* Complete source format */
-    p_enc_in->orientation = ORIENT_NORMAL;
     p_enc_out->orientation = p_enc_in->orientation;
 
     p_enc_in->i_chroma = p_enc->p_encoder->fmt_in.i_codec;
@@ -259,13 +257,11 @@ void transcode_encoder_video_configure( vlc_object_t *p_obj,
              p_dec_out->i_frame_rate, p_dec_out->i_frame_rate_base,
              p_enc_in->i_frame_rate, p_enc_in->i_frame_rate_base );
 
-    /* Modify to requested sizes/scale */
-    transcode_video_size_config_apply( p_obj, p_src, p_cfg, p_enc_out );
     /* Propagate sizing to output */
-    p_enc_in->i_width = p_enc_out->i_width;
-    p_enc_in->i_visible_width = p_enc_out->i_visible_width;
-    p_enc_in->i_height = p_enc_out->i_height;
-    p_enc_in->i_visible_height = p_enc_out->i_visible_height;
+    p_enc_out->i_width = p_enc_in->i_width;
+    p_enc_out->i_visible_width = p_enc_in->i_visible_width;
+    p_enc_out->i_height = p_enc_in->i_height;
+    p_enc_out->i_visible_height = p_enc_out->i_visible_height;
 
     transcode_video_sar_apply( p_src, p_enc_out );
     p_enc_in->i_sar_num = p_enc_out->i_sar_num;



More information about the vlc-commits mailing list