Gabriella Katona Posted August 17, 2009 Share Posted August 17, 2009 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. 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 Quote Link to comment
Griga Posted August 17, 2009 Share Posted August 17, 2009 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). Quote Link to comment
Gabriella Katona Posted August 17, 2009 Author Share Posted August 17, 2009 (edited) Thanks for the feedback. You're right. Based on this http://wiki.multimedia.cx/index.php?title=MPEG-4_Audio I have to make a LATM -> ADTS object type conversion. Edited August 17, 2009 by Gabriella Katona Quote Link to comment
Gabriella Katona Posted August 17, 2009 Author Share Posted August 17, 2009 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. Quote Link to comment
Griga Posted August 17, 2009 Share Posted August 17, 2009 Well, I think this sub-forum is the best place for this discussion. Feel free to attach your code and/or binary here. Quote Link to comment
Gabriella Katona Posted August 17, 2009 Author Share Posted August 17, 2009 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 AAC_Tools_NA_0.1.zip Quote Link to comment
frnando Posted May 2, 2010 Share Posted May 2, 2010 (edited) 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 May 2, 2010 by frnando Quote Link to comment
GuSTaVauM Posted January 3, 2018 Share Posted January 3, 2018 Does this tool still a thing? I never managed to get it work with my recordings The attached file is the error I'm getting Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.