[FFmpeg-devel] [PATCH 2/3] flvdec: Mark the demuxer as allowing discontinuous timestamps

Michael Niedermayer michael at niedermayer.cc
Thu Nov 22 04:16:51 EET 2018


On Wed, Nov 21, 2018 at 03:58:47PM +0000, Derek Buitenhuis wrote:
> Any FLV file, not necessarily valid, but in extremely common use for live
> or archived live purposes, may output discontinuous timestamps. As it currently
> is, only files produced by NGINX's RTMP module will be marked as supporting
> discontinuous timestamps, which is obviously untrue, and the fix was only
> ever put in place for a single bug report / file. The FLV demuxer, however
> will happily ingest any FLV, and output discontinuous timestamps, regardless
> of whether this "live" demuxer is used, making the current set of flags untrue.
> 
> Add the flag to the main demuxer, as this is how it *actually* works. Lying to
> downstream API users about a demuxer's behavior is not OK.
> 
> Also set AVFMT_NOBINSEARCH, as this should be true given discontinuous timetsamps.
> 
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> ---
>  libavformat/flvdec.c | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)

the specification says this:
"Timestamp UI24 Time in milliseconds at which the data in this tag
               applies. This is relative to the first tag in the FLV file,
               which always has a timestamp of 0.
"
So flv does not seem to allow discontinuities. Any tool writing files with 
discontinuities would be faulty

declaring files which have no discontinuities as having some would
result in worse performing seeking in some cases. Both slower and or less 
accurate. Also flv IIRC allows gaps in tracks like no packets where there is
silence. This may interfere with discontinuities as it looks
like a discontinuity. 

Can these files with discontinuities be detected somehow from the headers?
If so then the probe function could be changed so they get the discontinuity
flag while valid files do not have the disadvantages from having it set

Thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181122/74bbe40d/attachment.sig>


More information about the ffmpeg-devel mailing list