On Tue, 24 Jul 2012, Kieran Kunhya wrote:

On Mon, Jul 23, 2012 at 6:56 PM, Alex Converse <[email protected]> wrote:
On Mon, Jul 23, 2012 at 9:20 AM, Kieran Kunhya <[email protected]> wrote:

---
 libavcodec/libfdk-aacenc.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index f2c3fbd..4d7aa7b 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -33,6 +33,8 @@ typedef struct AACContext {
     int afterburner;
     int eld_sbr;
     int signaling;
+    int latm;
+    int header_period;

     AudioFrameQueue afq;
 } AACContext;
@@ -45,6 +47,8 @@ static const AVOption aac_enc_options[] = {
     { "implicit", "Implicit backwards compatible signaling", 0,
AV_OPT_TYPE_CONST, { 0 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM |
AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
     { "explicit_sbr", "Explicit SBR, implicit PS signaling", 0,
AV_OPT_TYPE_CONST, { 1 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM |
AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
     { "explicit_hierarchical", "Explicit hierarchical signaling", 0,
AV_OPT_TYPE_CONST, { 2 }, 0, 0, AV_OPT_FLAG_AUDIO_PARAM |
AV_OPT_FLAG_ENCODING_PARAM, "signaling" },
+    { "latm", "Output LATM/LOAS encapsulated data", offsetof(AACContext,
latm), AV_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM |
AV_OPT_FLAG_ENCODING_PARAM },
+    { "header_period", "StreamMuxConfig and PCE repetition period (in
frames)", offsetof(AACContext, header_period), AV_OPT_TYPE_INT, { 0 }, 0,
0xffff, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
     { NULL }
 };


Don't we use a separate codec id for LATM or is that for decoding only?

I'm not really sure whether that codec id is appropriate to use in
this instance.

I'm looking into muxing AAC ELD into mpegts, and I stumbled upon some issues related to this. ELD can't be muxed into ADTS, so it has to be wrapped in LATM in mpegts.

In order to do that, we can either have the mpegts muxer convert it into LATM ("-aflags +global_header -mpegts_flags latm", globla header so that the encoder outputs it in a format that the chained latm muxer can handle) or make the fdk-aac encoder output it in LATM form from the start, with "-latm 1".

The former case fails since the LATM muxer currently doesn't support AOTs above SBR, and for (E)LD, the ASC contains more bits that we'd have to copy into the LATM stream mux config.

The latter case fails, since if using -latm 1, it still uses the normal AAC codec id, and the mpegts muxer can't identify it as LATM (ending up with "AAC bitstream not in ADTS format and extradata missing"). If I make the fdk-aac wrapper change the codec id to AV_CODEC_ID_AAC_LATM if the latm flag is set, this seems to work fine. But is it even valid for an encoder to change the codec id during initialization?

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to