Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Stefano Sabatini <stefasab@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] doc/ffmpeg: extend -dts_delta_threshold option description
Date: Sat, 11 Feb 2023 17:28:11 +0100
Message-ID: <20230211162811.GA31279@mariano> (raw)
In-Reply-To: <20230211023000.GE338325@mariano>

[-- Attachment #1: Type: text/plain, Size: 2318 bytes --]

On date Saturday 2023-02-11 03:30:00 +0100, Stefano Sabatini wrote:
> On date Thursday 2023-02-09 00:41:18 +0100, Michael Niedermayer wrote:
> > On Mon, Feb 06, 2023 at 02:25:23AM +0100, Stefano Sabatini wrote:
> [...]
> > > Subject: [PATCH 2/2] ffmpeg: review -dts_delta_threshold and -dts_delta_error
> > >  options
> > > 
> > > Review handling of -dts_delta_threshold and -dts_delta_error options,
> > > specify them as floating point expressed in seconds.
> > > 
> > > Also, review and simplify logic. Adjust values for tests, since in
> > > some cases the new values does not trigger the correction logic.
> > > 
> > > PR: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=8252
> > > ---
> > >  doc/ffmpeg.texi             | 36 ++++++++++++++++---
> > >  fftools/ffmpeg.c            | 72 ++++++++++++++++++++-----------------
> > >  fftools/ffmpeg.h            |  2 ++
> > >  fftools/ffmpeg_demux.c      |  3 ++
> > >  tests/fate/filter-audio.mak |  2 +-
> > >  tests/fate/mpeg4.mak        |  2 +-
> > >  6 files changed, 77 insertions(+), 40 deletions(-)
> > 
> > This seems to break a case with concat and vsync
> > ./ffmpeg -y -i 'concat:///home/michael/videos/angels.mpg|/home/michael/videos/angels.mpg'  -vsync 0 -an file.avi
> > 
> > ...
> > cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
> > [mpeg4 @ 0x55e051b8d4c0] Invalid pts (0) <= last (11)00.00 bitrate=N/A speed=   0x    
> > [vost#0:0/mpeg4 @ 0x55e051b9d700] Error submitting video frame to the encoder
> > Conversion failed!
> >
> > 
> > Ill mail you the angels.mpg, i think its online somewhere but i cant
> > find it
> 
> Fixed, now the code should be equivalent to the previous
> implementation.
> 
> What happened in this case (and apparently in the other fate tests
> failing), is that some sort of limit correction is applied:
> 
> detected dts:-0.041711 < dts_limit:0.358789
> ts delta 0.5005 applied => ts_offset_discont:0.5005 dts:0.458789
> 
> preventing the invalid pts error.
> 
> The limit correction, hardcoded in the ffmpeg.c code, is completely
> unrelated to the dts_delta_threshold value, no idea if it would make
> sense to make this parametric (but at least now it should be a bit
> more clear from the code/logs).

Moving the refactoring changes to a dedicated thread.

Updating the doc extensions.

[-- Attachment #2: 0003-doc-ffmpeg-extend-documentation-for-dts_delta_thresh.patch --]
[-- Type: text/x-diff, Size: 2324 bytes --]

From f7df77c9d488fa0f470eba064cdcce915c519ca3 Mon Sep 17 00:00:00 2001
From: Stefano Sabatini <stefasab@gmail.com>
Date: Sat, 11 Feb 2023 17:18:39 +0100
Subject: [PATCH 3/3] doc/ffmpeg: extend documentation for -dts_delta_threshold
 and -dts_error_threshold

PR: https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=8252
---
 doc/ffmpeg.texi | 36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index d9d4b75567..63be7951e6 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -1837,12 +1837,38 @@ results, but increase memory use and latency.
 
 The default value is 10 seconds.
 
-@item -dts_delta_threshold
-Timestamp discontinuity delta threshold.
+@item -dts_delta_threshold @var{threshold}
+Timestamp discontinuity delta threshold, expressed as a floating point
+number of seconds.
+
+The timestamp discontinuity correction enabled by this option is only
+applied to input formats accepting timestamp discontinuity (for which
+the @code{AV_FMT_DISCONT} flag is enabled), e.g. MPEG-TS and HLS, and
+is automatically disabled when employing the @code{-copy_ts} option
+(unless wrapping is detected).
+
+If a timestamp discontinuity is detected whose absolute value is
+greater than @var{threshold}, ffmpeg will remove the discontinuity by
+decreasing/increasing the current DTS and PTS by the corresponding
+delta value.
+
+The default value is 10.
+
 @item -dts_error_threshold @var{seconds}
-Timestamp error delta threshold. This threshold use to discard crazy/damaged
-timestamps and the default is 30 hours which is arbitrarily picked and quite
-conservative.
+Timestamp error delta threshold, expressed as a floating point number
+of seconds.
+
+The timestamp correction enabled by this option is only applied to
+input formats not accepting timestamp discontinuity (for which the
+@code{AV_FMT_DISCONT} flag is not enabled).
+
+If a timestamp discontinuity is detected whose absolute value is
+greater than @var{threshold}, ffmpeg will drop the PTS/DTS timestamp
+value.
+
+The default value is @code{3600*30} (30 hours), which is arbitrarily
+picked and quite conservative.
+
 @item -muxdelay @var{seconds} (@emph{output})
 Set the maximum demux-decode delay.
 @item -muxpreload @var{seconds} (@emph{output})
-- 
2.25.1


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  reply	other threads:[~2023-02-11 16:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25  1:07 Stefano Sabatini
2023-01-25  5:17 ` Gyan Doshi
2023-02-06  1:25   ` Stefano Sabatini
2023-02-06  4:31     ` Gyan Doshi
2023-02-08 23:41     ` Michael Niedermayer
2023-02-11  2:30       ` Stefano Sabatini
2023-02-11 16:28         ` Stefano Sabatini [this message]
2023-02-11 16:56           ` Gyan Doshi
2023-02-20 17:57         ` Anton Khirnov
2023-02-28 21:32           ` Stefano Sabatini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230211162811.GA31279@mariano \
    --to=stefasab@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git