Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avformat/movenc: Fix flush fragment
Date: Wed, 28 May 2025 20:56:54 +0800
Message-ID: <tencent_1771C0A9B4DC695603016B627CC6AD0A3B0A@qq.com> (raw)
In-Reply-To: <tencent_7F079A3F9F4EAB9F4E2F70372D359A414008@qq.com>



> On May 22, 2025, at 17:37, Zhao Zhili <quinkblack@foxmail.com> wrote:
> 
> From: Zhao Zhili <zhilizhao@tencent.com>
> 
> The follow cmd output corrupted file before the patch:
> 
> ffmpeg -f lavfi -i color=blue,trim=duration=0.04 \
> 	-f lavfi -i anullsrc,atrim=duration=2 \
> 	-movflags +empty_moov+hybrid_fragmented \
> 	-frag_duration 1000000 \
> 	-frag_interleave 1 \
> 	output.mp4
> 
> 1. first_track is the first track with track->entry != 0. As in the
> command above, video track (track index 0) has a single frame. When
> flush the second fragment, first_track is 1, the audio track.
> 
> 2. write_moof = i == first_track, so write_moof is false for i = 0.
> 
> 3. When mov->frag_interleave != 0, mov->mdat_buf != NULL, because
> it contains audio data. So avio_write is called before write_moof,
> that is, the data write before moof, and mov_finish_fragment
> executed with wrong mdat_start.
> 
> 4. With normal fmp4 output, the error isn't obvious. With
> hybrid_fragmented, ffplay output.mp4 shows a lot of error messages.
> ---
> 

Will apply soon.

_______________________________________________
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-05-28 12:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-22  9:37 Zhao Zhili
2025-05-28 12:56 ` Zhao Zhili [this message]

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=tencent_1771C0A9B4DC695603016B627CC6AD0A3B0A@qq.com \
    --to=quinkblack-at-foxmail.com@ffmpeg.org \
    --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