Re: [FFmpeg-devel] [PATCH, V3] avformat/concat: Fix wrong wrapped timestamp

2017-12-29 Thread
I already answered:

http://ffmpeg.org/pipermail/ffmpeg-devel/2017-December/222605.html


I just refine coding style following your advice and re-submit it.

Thanks.

On Fri, Dec 29, 2017 at 7:33 PM, Nicolas George  wrote:

> mymoey...@gmail.com (2017-12-29):
> > From: Wu Zhiqiang 
> >
> > When using concat protocol, start from middle of file will generate
> non-zero wrap reference.
> > If seek to time before the wrap reference, wrap control will generate
> wrong wrapped timestamp.
> > Copy wrap related stream properties when reading header can fix this
> problem.
> >
> > Signed-off-by: Wu Zhiqiang 
>
> You did not answer to this mail:
>
> https://ffmpeg.org/pipermail/ffmpeg-devel/2017-December/222549.html
>
> Regards,
>
> --
>   Nicolas George
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH, V2] avformat/concat: Fix wrong wrapped timestamp

2017-12-17 Thread
Thanks for your replay.

I see wrap timestamp control is enable by pts_wrap_bits(default 33),
but mp4 demuxer  will later set this to 64 (means disabled).
Now pts_wrap_bits are always tied to 33 without copy it, which seems
strange.

Normally the pts_wrap_reference  is based on first packet of a file in
avformat_find_stream_info.
Without copy the value,  the value is based on first packet of read_packet,
will be non-zero after seeking.

2017-12-17 22:55 GMT+08:00 Nicolas George :

> mymoey...@gmail.com (2017-12-14):
> > From: Wu Zhiqiang 
> >
> > When using concat protocol, start from middle of file will generate
> non-zero wrap reference.
> > If seek to time before the wrap reference, wrap control will generate
> wrong wrapped timestamp.
> > Copy wrap related stream properties when reading header can fix this
> problem.
> >
> > Signed-off-by: Wu Zhiqiang 
> > ---
> >  libavformat/concatdec.c | 5 +
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
> > index 0e189012ad..8dae2737df 100644
> > --- a/libavformat/concatdec.c
> > +++ b/libavformat/concatdec.c
> > @@ -188,6 +188,11 @@ static int copy_stream_props(AVStream *st, AVStream
> *source_st)
> >  st->time_base   = source_st->time_base;
> >  st->sample_aspect_ratio = source_st->sample_aspect_ratio;
> >
> > +/* Fix wrap control problem */
> > +avpriv_set_pts_info(st, source_st->pts_wrap_bits,
> source_st->time_base.num, source_st->time_base.den);
> > +st->pts_wrap_behavior   = source_st->pts_wrap_behavior;
> > +st->pts_wrap_reference  = source_st->pts_wrap_reference;
> > +
> >  av_dict_copy(>metadata, source_st->metadata, 0);
> >  return 0;
> >  }
>
> The concat demuxer is mine to maintain, but I am not very familiar with
> the wrapped timestamps handling, and the commit message does not
> enlighten me.
>
> (By the way, please wrap it at 60-70 characters.)
>
> The way I see it, if the library takes care of de-wrapping timestamps,
> then the concat demuxer will see de-wrapped timestamps from the
> underlying demuxer, and the timestamps do not need to be de-wrapped a
> second time: setting the wrap information is unnecessary and even wrong.
>
> Please explain what I am missing.
>
> Regards,
>
> --
>   Nicolas George
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/concat: Fix wrong wrapped timestamp

2017-12-14 Thread
I see pts_wrap_bits must be modified in this function.   I re-submit  the
new patch, only replace avpriv_set_pts_info st->pts_wrap_bits   =
source_st->pts_wrap_bits by avpriv_set_pts_info.

Liu Steven  于 2017年12月15日周五 上午6:30写道:

>
> > 在 2017年12月15日,上午12:04,Michael Niedermayer  写道:
> >
> > On Thu, Dec 14, 2017 at 03:00:50AM -0500, mymoey...@gmail.com wrote:
> >> From: wu zhiqiang 
> >>
> >> When using concat protocal, start from middle of file will generate
> non-zero wrap reference. If seek to time less than the wrap reference, wrap
> control will be triggered and generate wrong wrapped timestamp.
> >> Copy wrap related stream properties when reading header can fix this
> problem.
> >>
> >> Signed-off-by: wu zhiqiang 
> >> ---
> >> libavformat/concatdec.c | 5 +
> >> 1 file changed, 5 insertions(+)
> >>
> >> diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
> >> index 0e189012ad..e933888661 100644
> >> --- a/libavformat/concatdec.c
> >> +++ b/libavformat/concatdec.c
> >> @@ -188,6 +188,11 @@ static int copy_stream_props(AVStream *st,
> AVStream *source_st)
> >> st->time_base   = source_st->time_base;
> >> st->sample_aspect_ratio = source_st->sample_aspect_ratio;
> >>
> >> +/* Fix wrap control problem */
> >> +st->pts_wrap_bits   = source_st->pts_wrap_bits;
> >> +st->pts_wrap_behavior   = source_st->pts_wrap_behavior;
> >> +st->pts_wrap_reference  = source_st->pts_wrap_reference;
> >
> > why does this not use avpriv_set_pts_info() ?
>
> Add st->pts_wrap_behavior   = source_st->pts_wrap_behavior; and
> st->pts_wrap_reference  = source_st->pts_wrap_reference; into
> avpriv_set_pts_info?
> or only replace avpriv_set_pts_info st->pts_wrap_bits   =
> source_st->pts_wrap_bits; here?
>
> Thanks
>
> Steven
> >
> >
> > [...]
> > --
> > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >
> > There will always be a question for which you do not know the correct
> answer.
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel