[vlc-devel] [PATCH 3/3] transcode: video: fix insertion of fps filter

Alexandre Janniaux ajanni at videolabs.io
Wed Jan 27 17:25:45 UTC 2021


Hi,

On Wed, Jan 27, 2021 at 08:45:40AM -0800, Nick Briggs wrote:
>
> > Date: Tue, 26 Jan 2021 15:14:49 +0100
> > From: Alexandre Janniaux <ajanni at videolabs.io>
> > To: Mailing list for VLC media player developers
> > 	<vlc-devel at videolan.org>
> > Subject: Re: [vlc-devel] [PATCH 3/3] transcode: video: fix insertion
> > 	of fps filter
> > Message-ID: <20210126141449.fbrhk4olwnqbgucl at bulbizarre>
> > Content-Type: text/plain; charset=us-ascii
> >
> > On Tue, Jan 26, 2021 at 03:06:50PM +0100, Thomas Guillem wrote:
> >>
> >>
> >> On Tue, Jan 26, 2021, at 15:01, Alexandre Janniaux wrote:
> >>> The fps filter must be added iif. the target framerate is different from
> >>
> >> Typo in the commit log.
> >
> > Is it for iff? iif. = If and only if.
>
> If-and-only-if is abbreviated "iff" not "iif".

Thanks :) Given the other discussion, I'll just remove iif. and
replace by «when».

>
> >
> >>
> >> I'm OK with the set, but I would wait for Steve or Francois review.
> >>
> >>> the source framerate, not when we define the fps parameter.
> >>>
> >>> We also check that fps.den > 0 to avoid divide-by-zero errors.
> >>>
> >>> Probably regression from 030183d79045a1747d891572b2fe77d8cd0fd946 in
> >>> which the target framerate was defined in the destination format.
> >>> .
> >>> ---
> >>> modules/stream_out/transcode/video.c | 12 ++++++++++--
> >>> 1 file changed, 10 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/modules/stream_out/transcode/video.c
> >>> b/modules/stream_out/transcode/video.c
> >>> index b36ed90bbf..ce657088ad 100644
> >>> --- a/modules/stream_out/transcode/video.c
> >>> +++ b/modules/stream_out/transcode/video.c
> >>> @@ -297,11 +297,19 @@ static int transcode_video_filters_init(
> >>> sout_stream_t *p_stream,
> >>>         src_ctx = filter_chain_GetVideoCtxOut( id->p_f_chain );
> >>>     }
> >>>
> >>> -    if( id->p_enccfg->video.fps.num > 0 )
> >>> +    if( id->p_enccfg->video.fps.num > 0 &&
> >>> +        id->p_enccfg->video.fps.den > 0 &&
> >>> +      ( id->p_enccfg->video.fps.num != p_src->video.i_frame_rate ||
> >>> +        id->p_enccfg->video.fps.den != p_src->video.i_frame_rate_base ) )
> >>>     {
> >>> -        filter_chain_AppendFilter( id->p_f_chain, "fps", NULL, p_src );
> >>> +        es_format_t dst;
> >>> +        es_format_Copy(&dst, p_src);
> >>> +        dst.video.i_frame_rate = id->p_enccfg->video.fps.num;
> >>> +        dst.video.i_frame_rate_base = id->p_enccfg->video.fps.den;
> >>> +        filter_chain_AppendFilter( id->p_f_chain, "fps", NULL, &dst );
> >>>         p_src = filter_chain_GetFmtOut( id->p_f_chain );
> >>>         src_ctx = filter_chain_GetVideoCtxOut( id->p_f_chain );
> >>> +        es_format_Clean(&dst);
> >>>     }
> >>>
> >>>     /* User filters */
> >>> --
> >>> 2.30.0
> >>>
> >>> _______________________________________________
> >>> 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
> >
>
> _______________________________________________
> 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