From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 1/2] avformat/matroskaenc: Don't create wrong packet durations
Date: Fri, 29 Sep 2023 18:47:39 +0200
Message-ID: <AS8P250MB0744A392F6954D8A5A5B403C8FC0A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <181aecfd-986e-4976-bfdb-ef29e3bd1e4e@gmail.com>
James Almer:
> On 9/29/2023 1:01 PM, Andreas Rheinhardt wrote:
>> We have to write an explicit BlockDuration element (and use
>> a BlockGroup instead of a SimpleBlock) in case the Track
>> has a DefaultDuration that is inconsistent with the duration
>> of the packet.
>>
>> The matroska-h264-remux test uses a file with coded fields
>> where the duration of a Block is the duration of a field,
>> not of a frame, therefore this patch writes said BlockDuration
>> elements.
>>
>> (When using a BlockGroup, one has to add ReferenceBlock elements
>> to distinguish keyframes from non-keyframes. Unfortunately,
>> the AV1 codec mapping [1] requires us to reference all references
>> and to really use the real references, which requires a lot of
>> effort for basically no gain. When BlockGroups are used with AV1,
>> the created files are most likely invalid, both before and after
>> this patch, but this patch makes this more likely to happen.)
>
> AV1 has no fields, and the vast majority of samples will also have fixed
> frame duration across the entire coded stream, so i doubt this will make
> a difference.
>
> There's also the fact it's unlikely parsers will care about
> ReferenceBlock elements at all to begin with, and instead just have the
> decoder handle things relying on the bitstream level information.
>
That's why I consider this requirement to be nonsense. In fact, I would
only require one thing from the ReferenceBlock elements: If one
recursively goes back the ReferenceBlock elements until one has reached
a keyframe, then decoding these blocks is sufficient to be able to
decode the actually desired block. That way a simple muxer like ours
could always reference the preceding block (in case the current packet
is not a keyframe) and create a valid stream.
- Andreas
_______________________________________________
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".
next prev parent reply other threads:[~2023-09-29 16:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-29 16:01 Andreas Rheinhardt
2023-09-29 16:04 ` [FFmpeg-devel] [PATCH 2/2] avformat/matroskaenc: Write default duration for audio Andreas Rheinhardt
2023-09-29 16:08 ` [FFmpeg-devel] [PATCH 1/2] avformat/matroskaenc: Don't create wrong packet durations James Almer
2023-09-29 16:47 ` Andreas Rheinhardt [this message]
2023-10-01 13:08 ` Andreas Rheinhardt
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=AS8P250MB0744A392F6954D8A5A5B403C8FC0A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--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