From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 31CDF43234 for ; Fri, 24 Jun 2022 20:35:04 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0F49A68B6C7; Fri, 24 Jun 2022 23:35:02 +0300 (EEST) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6986068B2F2 for ; Fri, 24 Jun 2022 23:34:55 +0300 (EEST) Received: from localhost (213-47-68-29.cable.dynamic.surfer.at [213.47.68.29]) (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 4FD77240003 for ; Fri, 24 Jun 2022 20:34:54 +0000 (UTC) Date: Fri, 24 Jun 2022 22:34:53 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20220624203453.GP396728@pb2> References: <20220623233105.GN396728@pb2> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH] avformat/mpegts: correct timestamp overflow on multiple pcr loopback X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============7223279080540353554==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============7223279080540353554== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mjY4tR3oi1f6C/8a" Content-Disposition: inline --mjY4tR3oi1f6C/8a Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi On Fri, Jun 24, 2022 at 02:30:19PM +0200, S=E9bastien Rossi wrote: > The issue I tried to patch is that on ts stream that last more than 26,5h > (time between pcr loopback) we had pts and dts discontinuities. In > wrap_timestamp function in demux.c, I've seen there's some code to correct > timestamp overflow, but when the stream last more than 26,5h, timestamps > are upper than pts_wrap_reference two times. So the second time we outrun > the pts_wrap_reference we lose the timestamp correction and have some > errors like pts < dts. > What I tried to do is to restamp pts and dts using mpegts pcr information. > The preserve_continuity function checks relative position between timesta= mp > (dts or pts) and pcr, and handle cases when pcr have already loopback and > timestamp not or vice versa. Then it applicates correction to the timesta= mp > depending on pcr loopback count. there can be more timestamp discontinuities than one per 26.5h if the goal is to remove all that requires more code. Either some scaning of the whole file or some quite smart stuff and either way a buffer to store where the discontinuities are so they are consistantly handled during seeking. if the goal is to eliminate 1 wraparound only, there should be some existing code i think that does this. IIRC see pts_wrap_behavior the wraping behavior is applies to multiple demuxers so code handling it really does not belong in a single demuxer >=20 > I can provide a stream with a duration of 30h, if you want to. not needed >=20 > Could you tell me how to reproduce the segfault you've seen ? it segfaults because filter is NULL. i can send you the file but as the code and why its segfaults is specific to one demxuer and this shouldnt be in one single demuxer i dont think it would help you thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates --mjY4tR3oi1f6C/8a Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCYrYf5AAKCRBhHseHBAsP q4uyAJ9nED7fvRc1OluhmGxmoD5mO8+X9ACgkz1mfMuI6/2AQjOlZkWTpCVjCPA= =GB/5 -----END PGP SIGNATURE----- --mjY4tR3oi1f6C/8a-- --===============7223279080540353554== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============7223279080540353554==--