[vlc-devel] [PATCH] chromecast: resize large resolution videos

Erick Tyndall erythros at gmail.com
Tue Oct 2 21:46:52 CEST 2018


The maxwidth and maxheight settings function correctly for videos that
are below the maximum resolution, regardless of whether the videos
have been cropped. The same occurs for large resolution videos that
have not been cropped. ( As long as they conform to HD, FHD, and UHD
resolution standards. )

The issue arises with videos that are larger than the maximum set
resolution and have been cropped.

Example: a 1080p bluray should be 1920x1080. If the user selects the
low/low cpu casting choices, the max resolution is set to 1280x720.
If the video file has been processed for compression (prior to
casting) and the black bars are cropped giving a new resolution of
1920x816 the chromecast transcode goes awry. This occurs because
f_scale_height attempts to reconcile the cropped resolution with a
non-cropped resolution and produces an incorrect scale.

Passing the width value triggers the "else if( p_dst->i_visible_width
&& p_dst->i_visible_height == 0 )" statement (line 104) and sets the
scale for width and height (based on width), thus resulting in a
proper scaling of the height.
On Tue, Oct 2, 2018 at 5:54 AM Thomas Guillem <thomas at gllm.fr> wrote:
>
> Finally, I'm not sure I understand this patch. When looking at transcode_encoder_video_configure() in modules/stream_out/transcode/encoder/video.c I see that the encoder fmt_out is scaled to the maxwidth/maxheight. So this should be enough. Why adding this width parameter then?
>
> On Mon, Oct 1, 2018, at 18:33, Erick Tyndall wrote:
> > From: erythros <erythros at gmail.com>
> >
> > 1080p and lower resolution videos correctly scale/resize during
> > transcoding. This patch corrects the resizing of videos that exceed
> > 1080p.
> > ---
> >  modules/stream_out/chromecast/cast.cpp | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/
> > stream_out/chromecast/cast.cpp
> > index 2ef26d8eb4..3de2d7a3ba 100644
> > --- a/modules/stream_out/chromecast/cast.cpp
> > +++ b/modules/stream_out/chromecast/cast.cpp
> > @@ -1133,10 +1133,10 @@
> > sout_stream_sys_t::GetVcodecOption( sout_stream_t *p_stream,
> > vlc_fourcc_t *p_cod
> >      {
> >          case CONVERSION_QUALITY_HIGH:
> >          case CONVERSION_QUALITY_MEDIUM:
> > -            ssout << video_maxres_hd << ',';
> > +            ssout << ( ( p_vid->i_width > 1920 ) ? "width=1920," : "" )
> > << video_maxres_hd << ',';
> >              break;
> >          default:
> > -            ssout << video_maxres_720p << ',';
> > +            ssout << ( ( p_vid->i_width > 1280 ) ? "width=1280," : "" )
> > << video_maxres_720p << ',';
> >      }
> >
> >      if( p_vid == NULL
> > --
> > 2.17.1
> >
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list