Jump to content

LOAS/LATM -> ADTS Conversion


Gabriella Katona

Recommended Posts

Hello!

 

Since I cannot find a better way (except PM) to reach Griga I post here:

 

I'm trying to write a simple command line tool that converts LOAS/LATM packeted AAC into ADTS packeted AAC.

 

The idea is simple: read each raw frame from LOAS/LATM (ReadLATMPacket) and write each frame with ADTS header. I've used your UParser.pas extended with some code. (I've attached my code).

Since the ADTS header is ok lot of tools can recognize the file but nothing can play it. :wacko: Even neroAacDec tells me data incomplete. Probably I miss something.

Do you have any idea?

 

regards,

NA

 

ps. LOAS/LATM sample was extracted with DGAVCDec from a TS capture (DVBViewer) - ts can be played with DVBViewer fine

LOAS_LATM_to_ADTS.zip

Link to comment

I've tested your tool with one of my Norwegian AAC samples. The output couldn't be played. Libfaad2 doesn't accept it. A debugging session revealed that initializing the library fails. So I've examined the ADTS headers a bit closer in a hex editor. That's what I've found out:

 

In TAACParser.WriteADTSHeader your tool sets AudioObjectType as AAC profile

 

   bsr.SetBits(config[0].AudioObjectType, 2);		// AAC profile

 

yielding 2 in this case (AFAIK = AAC SSR Scalable Sample Rate profile in ADTS headers), and I think that's not correct - AudioObjectType read from LATM headers is a 5 bit value, and it doesn't seem to be identical with the AAC profile in ADTS headers.

 

However, when I simply set the profile bits to 0 (AAC main profile) or 1 (AAC LC low complexity profile) in your code, TSPlayer & libfaad2 wrapper as decoder are playing the output of your tool quite happily.

 

BTW: Rather use the 1.1.3 parser source code, since it additionally covers explicit SBR signaling (AudioObjectType = 5, e.g. used by Brazilian DVB-T).

Link to comment

Ok. Now tool is ready and working fine. (Also made a ADTS to RAW and LOAS/LATM to RAW converter)

I think it interest lot of people should I post it somewhere here or it is totally off-topic? If yes where should I since it is not a plugin/mod.

Link to comment

Hello!

 

I've attached my simple command line AAC Tools (lossless converters). Contents of the zip file:

 

AAC_Tools_NA_source.7z: source code of the binaries (Delphi 2009 but I think will work with even Delphi7)

LOAS_LATM_to_ADTS.exe: LOAS/LATM packeted AAC to ADTS packeted AAC conversion

ADTS_to_RAW.exe: ADTS packeted AAC to RAW AAC conversion

LOAS_LATM_to_RAW.exe: LOAS/LATM packeted AAC to RAW AAC conversion

 

verison is 0.1 so error handling is minimal (almost nothing) so be sure what you're doing :wacko:

AAC_Tools_NA_0.1.zip

Link to comment
  • 8 months later...

Hi, Gabriella!

 

I'd tried to convert an LOAS/LATM AAC stream (Brazilian HDTV), but I allways get an error on line #771 on UParser module (It gets streamindex=14 at first read).

 

My aac file I got thru DGAVCDec.

 

I'm serching for more info on LATM encapsulating, but unsuccessfull until now.

 

Any news on the code?

 

Best Regards.

 

Fernando

Edited by frnando
Link to comment
  • 7 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...