[FFmpeg-cvslog] avformat/matroska: Add support for A_ATRAC/AT1

2024-02-13 Thread asivery
ffmpeg | branch: master | asivery  | Mon Feb 12 
19:01:32 2024 +0100| [7f4abe7c371f669b0fa8b957e33f95b966775dd9] | committer: 
Andreas Rheinhardt

avformat/matroska: Add support for A_ATRAC/AT1

Signed-off-by: asivery 
Signed-off-by: Andreas Rheinhardt 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f4abe7c371f669b0fa8b957e33f95b966775dd9
---

 libavformat/matroska.c| 1 +
 libavformat/matroskadec.c | 8 
 libavformat/matroskaenc.c | 1 +
 3 files changed, 10 insertions(+)

diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index 5878594e68..d0ecfbeb6a 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -28,6 +28,7 @@ const CodecTags ff_mkv_codec_tags[]={
 {"A_AAC", AV_CODEC_ID_AAC},
 {"A_AC3", AV_CODEC_ID_AC3},
 {"A_ALAC"   , AV_CODEC_ID_ALAC},
+{"A_ATRAC/AT1"  , AV_CODEC_ID_ATRAC1},
 {"A_DTS", AV_CODEC_ID_DTS},
 {"A_EAC3"   , AV_CODEC_ID_EAC3},
 {"A_FLAC"   , AV_CODEC_ID_FLAC},
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 8f000f86be..5d3d18a146 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2779,6 +2779,14 @@ static int mka_parse_audio_codec(MatroskaTrack *track, 
AVCodecParameters *par,
 return AVERROR(ENOMEM);
 break;
 }
+case AV_CODEC_ID_ATRAC1:
+/* ATRAC1 uses a constant frame size.
+ * Typical ATRAC1 streams are either mono or stereo.
+ * At most, ATRAC1 was used to store 8 channels of audio. */
+if (track->audio.channels > 8)
+return AVERROR_INVALIDDATA;
+par->block_align = track->audio.channels * 212;
+break;
 case AV_CODEC_ID_FLAC:
 if (track->codec_priv.size) {
 ret = matroska_parse_flac(s, track, extradata_offset);
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 1457a6890c..21ce4aef3d 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -3474,6 +3474,7 @@ static int mkv_check_bitstream(AVFormatContext *s, 
AVStream *st,
 
 static const AVCodecTag additional_audio_tags[] = {
 { AV_CODEC_ID_ALAC,  0X },
+{ AV_CODEC_ID_ATRAC1,0x },
 { AV_CODEC_ID_MLP,   0x },
 { AV_CODEC_ID_OPUS,  0x },
 { AV_CODEC_ID_PCM_S16BE, 0x },

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avformat/aea: add aea muxer

2024-03-12 Thread asivery
ffmpeg | branch: master | asivery  | Fri Mar  8 
14:45:02 2024 +0100| [9124d807dc0d6eabed297c922cc2a4d18e08ee0a] | committer: 
Stefano Sabatini

avformat/aea: add aea muxer

Signed-off-by: asivery 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9124d807dc0d6eabed297c922cc2a4d18e08ee0a
---

 Changelog   |   1 +
 doc/muxers.texi |  10 
 libavformat/Makefile|   3 +-
 libavformat/{aea.c => aeadec.c} |   0
 libavformat/aeaenc.c| 115 
 libavformat/allformats.c|   1 +
 6 files changed, 129 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 069b827448..641c6b7cc5 100644
--- a/Changelog
+++ b/Changelog
@@ -32,6 +32,7 @@ version :
 - DVD-Video demuxer, powered by libdvdnav and libdvdread
 - ffprobe -show_stream_groups option
 - ffprobe (with -export_side_data film_grain) now prints film grain metadata
+- AEA muxer
 
 
 version 6.1:
diff --git a/doc/muxers.texi b/doc/muxers.texi
index 7f05dfcb69..a697e4b153 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -684,6 +684,16 @@ Enable to set MPEG version bit in the ADTS frame header to 
1 which
 indicates MPEG-2. Default is 0, which indicates MPEG-4.
 @end table
 
+@anchor{aea}
+@section aea
+MD STUDIO audio muxer.
+
+This muxer accepts a single ATRAC1 audio stream with either one or two channels
+and a sample rate of 44100Hz.
+
+As AEA supports storing the track title, this muxer will also write
+the title from stream's metadata to the container.
+
 @anchor{aiff}
 @section aiff
 Audio Interchange File Format muxer.
diff --git a/libavformat/Makefile b/libavformat/Makefile
index a3bfc209c3..785349c036 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -91,7 +91,8 @@ OBJS-$(CONFIG_ADTS_MUXER)+= adtsenc.o 
apetag.o img2.o \
 id3v2enc.o
 OBJS-$(CONFIG_ADX_DEMUXER)   += adxdec.o
 OBJS-$(CONFIG_ADX_MUXER) += rawenc.o
-OBJS-$(CONFIG_AEA_DEMUXER)   += aea.o pcm.o
+OBJS-$(CONFIG_AEA_DEMUXER)   += aeadec.o pcm.o
+OBJS-$(CONFIG_AEA_MUXER) += aeaenc.o rawenc.o
 OBJS-$(CONFIG_AFC_DEMUXER)   += afc.o
 OBJS-$(CONFIG_AIFF_DEMUXER)  += aiffdec.o aiff.o pcm.o \
 mov_chan.o replaygain.o
diff --git a/libavformat/aea.c b/libavformat/aeadec.c
similarity index 100%
rename from libavformat/aea.c
rename to libavformat/aeadec.c
diff --git a/libavformat/aeaenc.c b/libavformat/aeaenc.c
new file mode 100644
index 00..65d018c844
--- /dev/null
+++ b/libavformat/aeaenc.c
@@ -0,0 +1,115 @@
+/*
+ * MD STUDIO audio muxer
+ *
+ * Copyright (c) 2024 asivery
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "avio_internal.h"
+#include "rawenc.h"
+#include "mux.h"
+
+static int aea_write_header(AVFormatContext *s)
+{
+const AVDictionaryEntry *title_entry;
+size_t title_length = 0;
+AVStream *st;
+
+if (s->nb_streams > 1) {
+av_log(s, AV_LOG_ERROR, "Got more than one stream to encode. This is 
not supported.\n");
+return AVERROR(EINVAL);
+}
+
+st = s->streams[0];
+if (st->codecpar->ch_layout.nb_channels != 1 && 
st->codecpar->ch_layout.nb_channels != 2) {
+av_log(s, AV_LOG_ERROR, "Only maximum 2 channels are supported in the 
audio"
+   " stream, %d channels were found.\n", 
st->codecpar->ch_layout.nb_channels);
+return AVERROR(EINVAL);
+}
+
+if (st->codecpar->codec_id != AV_CODEC_ID_ATRAC1) {
+av_log(s, AV_LOG_ERROR, "AEA can only store ATRAC1 streams, %s was 
found.\n", avcodec_get_name(st->codecpar->codec_id));
+return AVERROR(EINVAL);
+}
+
+if (st->codecpar->sample_rate != 44100) {
+av_log(s, AV_LOG_ERROR, "Invalid sample rate (%d) AEA only supports 
44.1kHz.\n", st->codecpar->sample_rate);
+return AVERROR(EINVAL);
+}
+
+/* Write magic */
+avio_wl32(s->pb, 2048);
+
+/* Write AEA title */
+title_en

[FFmpeg-cvslog] avformat/aea: make the AEA demuxer return EOF at the end of file instead of EIO

2023-03-09 Thread asivery
ffmpeg | branch: master | asivery  | Tue Sep 27 
00:13:10 2022 +0200| [1a4560ce4e957f16fbfce9d5e563f3c06ded37d1] | committer: 
Marton Balint

avformat/aea: make the AEA demuxer return EOF at the end of file instead of EIO

Signed-off-by: asivery 
Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a4560ce4e957f16fbfce9d5e563f3c06ded37d1
---

 libavformat/aea.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/libavformat/aea.c b/libavformat/aea.c
index f4b39e4f9e..d16217381b 100644
--- a/libavformat/aea.c
+++ b/libavformat/aea.c
@@ -90,13 +90,7 @@ static int aea_read_header(AVFormatContext *s)
 
 static int aea_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
-int ret = av_get_packet(s->pb, pkt, s->streams[0]->codecpar->block_align);
-
-pkt->stream_index = 0;
-if (ret <= 0)
-return AVERROR(EIO);
-
-return ret;
+return av_get_packet(s->pb, pkt, s->streams[0]->codecpar->block_align);
 }
 
 const AVInputFormat ff_aea_demuxer = {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avformat/oma: Demux oma-encapsulated AAC audio

2024-10-13 Thread asivery
ffmpeg | branch: master | asivery  | Tue Sep 24 
18:58:37 2024 +0200| [31a63e4e011a63e3ae6dd2a02864055e29bd467a] | committer: 
Anton Khirnov

avformat/oma: Demux oma-encapsulated AAC audio

Signed-off-by: asivery 
Signed-off-by: Anton Khirnov 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=31a63e4e011a63e3ae6dd2a02864055e29bd467a
---

 libavformat/oma.c| 1 +
 libavformat/oma.h| 1 +
 libavformat/omadec.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/libavformat/oma.c b/libavformat/oma.c
index 7282d464aa..68482fca74 100644
--- a/libavformat/oma.c
+++ b/libavformat/oma.c
@@ -28,6 +28,7 @@ const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 
960, 0 };
 const AVCodecTag ff_oma_codec_tags[] = {
 { AV_CODEC_ID_ATRAC3,  OMA_CODECID_ATRAC3},
 { AV_CODEC_ID_ATRAC3P, OMA_CODECID_ATRAC3P   },
+{ AV_CODEC_ID_AAC, OMA_CODECID_AAC   },
 { AV_CODEC_ID_MP3, OMA_CODECID_MP3   },
 { AV_CODEC_ID_PCM_S16BE,   OMA_CODECID_LPCM  },
 { AV_CODEC_ID_ATRAC3PAL,   OMA_CODECID_ATRAC3PAL },
diff --git a/libavformat/oma.h b/libavformat/oma.h
index 1a8e16f6d6..d9c7795d5b 100644
--- a/libavformat/oma.h
+++ b/libavformat/oma.h
@@ -34,6 +34,7 @@
 enum {
 OMA_CODECID_ATRAC3  = 0,
 OMA_CODECID_ATRAC3P = 1,
+OMA_CODECID_AAC = 2,
 OMA_CODECID_MP3 = 3,
 OMA_CODECID_LPCM= 4,
 OMA_CODECID_WMA = 5,
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 86d3e7202f..552a37df18 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -511,6 +511,7 @@ static int oma_read_header(AVFormatContext *s)
 st->codecpar->bit_rate= samplerate * framesize / (2048 / 8);
 avpriv_set_pts_info(st, 64, 1, samplerate);
 break;
+case OMA_CODECID_AAC:
 case OMA_CODECID_MP3:
 ffstream(st)->need_parsing = AVSTREAM_PARSE_FULL_RAW;
 framesize = 1024;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".