Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] libavformat/mov: FMp4 Fixes duration calculation for individual streams on videos where crash occurs.
@ 2025-04-23  0:50 Anthony Bajoua via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: Anthony Bajoua via ffmpeg-devel @ 2025-04-23  0:50 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Anthony Bajoua

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".

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-23  0:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-23  0:50 [FFmpeg-devel] [PATCH] libavformat/mov: FMp4 Fixes duration calculation for individual streams on videos where crash occurs Anthony Bajoua via ffmpeg-devel

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