Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Anthony Bajoua via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
Cc: Anthony Bajoua <anthonybajoua@meta.com>
Subject: [FFmpeg-devel] [PATCH] libavformat/mov: FMp4 Fixes duration calculation for individual streams on videos where crash occurs.
Date: Wed, 23 Apr 2025 00:50:57 +0000
Message-ID: <SA3PR15MB5654230225020D290322B96DD1BA2@SA3PR15MB5654.namprd15.prod.outlook.com> (raw)

Both the audio and video sidx boxes at the end point to a range corresponding to the final mdat atom. Since there is no mfra following the final mdat when recording crashes, current logic sets the flag frag_index.complete flag on the penultimate sidx atom since it points to the end of the file. Results in underreporting duration by ffprobe and libavformat for one of the streams.

Signed-off-by: Anthony Bajoua <anthonybajoua@meta.com<mailto:anthonybajoua@meta.com>>
---
libavformat/mov.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 452690090c..36a60cab65 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6150,7 +6150,8 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
             }
         }

-        c->frag_index.complete = 1;
+        if (offset == 0)
+            c->frag_index.complete = 1;
     }

     return 0;
--
2.49.0


_______________________________________________
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:[~2025-04-23  0:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=SA3PR15MB5654230225020D290322B96DD1BA2@SA3PR15MB5654.namprd15.prod.outlook.com \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=anthonybajoua@meta.com \
    /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