From: "Martin Storsjö" <martin@martin.st>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avformat/movenc: allow writing out channel count in MP4 and 3GP
Date: Thu, 9 Feb 2023 12:08:07 +0200 (EET)
Message-ID: <d6a830d6-bb8-97b8-1731-1cc4c27252ae@martin.st> (raw)
In-Reply-To: <20230207205934.7584-1-jeebjp@gmail.com>
On Tue, 7 Feb 2023, Jan Ekström wrote:
> ISOBMFF (14496-12) made this field ('channelcount') in the
> AudioSampleEntry structure non-template¹ somewhere before the
> release of the 2022 edition. As for ETSI TS 126 244 AKA 3GPP
> file format (V16.1.0, 2020-10), it does not seem contain any
> references limiting the channelcount entry in AudioSampleEntry
> or in its own definition of EVSSampleEntry.
>
> fate-mov-mp4-chapters test had to be adjusted as it output a
> mono vorbis stream, which would now be properly marked as such
> in the container.
>
> 1: As per 14496-12:
> Fields shown as “template” in the box descriptions are fields
> which are coded with a default value unless a derived
> specification defines their use and permits writers to use
> other values than the default.
> ---
> libavformat/movenc.c | 8 +-------
> tests/ref/fate/mov-mp4-chapters | 2 +-
> 2 files changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 8d31317838..f0e218e7b7 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -1241,13 +1241,7 @@ static int mov_write_audio_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex
> avio_wb16(pb, 16);
> avio_wb16(pb, track->audio_vbr ? -2 : 0); /* compression ID */
> } else { /* reserved for mp4/3gp */
> - if (track->par->codec_id == AV_CODEC_ID_FLAC ||
> - track->par->codec_id == AV_CODEC_ID_ALAC ||
> - track->par->codec_id == AV_CODEC_ID_OPUS) {
> - avio_wb16(pb, track->par->ch_layout.nb_channels);
> - } else {
> - avio_wb16(pb, 2);
> - }
> + avio_wb16(pb, track->par->ch_layout.nb_channels);
> if (track->par->codec_id == AV_CODEC_ID_FLAC ||
> track->par->codec_id == AV_CODEC_ID_ALAC) {
> avio_wb16(pb, track->par->bits_per_raw_sample);
This looks reasonable to me. I didn't follow the references in the commit
message, but it sounds plausible and probably correct to me.
// Martin
_______________________________________________
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-02-09 10:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 20:59 Jan Ekström
2023-02-09 10:08 ` Martin Storsjö [this message]
2023-02-09 19:24 ` Jan Ekström
2023-02-14 19:27 ` Jan Ekström
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=d6a830d6-bb8-97b8-1731-1cc4c27252ae@martin.st \
--to=martin@martin.st \
--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