[FFmpeg-devel] [PATCH 3/3] lavf/utils: avoid giving up probing early with long subtitle events

Michael Niedermayer michaelni at gmx.at
Thu Oct 1 04:53:31 CEST 2015


On Wed, Sep 30, 2015 at 09:29:57PM -0500, Rodger Combs wrote:
> This happens on files with many overlapping subtitle events before the first packet of another stream. The combined durations of the subtitle events can exceed the max_analyze_duration before reading any of the other streams (even if they also start at the same timestamp).
> 
> I also considered simply skipping this check for subtitle streams; sound better?

hmm

maybe something like this would give a better and more robust value ?

if (pkt->pts != AV_NOPTS_VALUE && pkt->pts > st->start_time)
    st->info->codec_info_duration = FFMIN(pkt->pts - st->start_time, st->info->codec_info_duration + pkt->duration);



> 
> > On Sep 30, 2015, at 21:09, Michael Niedermayer <michaelni at gmx.at> wrote:
> > 
> > On Sun, Sep 20, 2015 at 12:29:33PM -0500, Rodger Combs wrote:
> >> ---
> >> libavformat/utils.c | 7 ++++++-
> >> 1 file changed, 6 insertions(+), 1 deletion(-)
> >> 
> >> diff --git a/libavformat/utils.c b/libavformat/utils.c
> >> index 199e80b..0256894 100644
> >> --- a/libavformat/utils.c
> >> +++ b/libavformat/utils.c
> >> @@ -3343,7 +3343,12 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
> >>                 break;
> >>             }
> >>             if (pkt->duration) {
> >> -                st->info->codec_info_duration        += pkt->duration;
> >> +                if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
> >> +                    if (pkt->pts != AV_NOPTS_VALUE)
> >> +                        st->info->codec_info_duration = pkt->pts - st->start_time;
> > 
> > this is wrong when theres a timestamp discontinuity
> > 
> > can you explain how to reproduce the problem this fixes ?
> > 
> > [...]
> > -- 
> > Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> > 
> > The bravest are surely those who have the clearest vision
> > of what is before them, glory and danger alike, and yet
> > notwithstanding go out to meet it. -- Thucydides
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org <mailto:ffmpeg-devel at ffmpeg.org>
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel <http://ffmpeg.org/mailman/listinfo/ffmpeg-devel>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151001/017e7a77/attachment.sig>


More information about the ffmpeg-devel mailing list