Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th October 2010, 22:39   #1  |  Link
Alex-Kid
Antronio's DV ambassador
 
Alex-Kid's Avatar
 
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
Why there's no LATM AAC demuxer/converter?

Almost a year ago I got a DTV capture device (ISDB-Tb) to be able to watch the first digital broadcasts, since DTV standard was adopted in my country in September 2009.

From the beginning, the programs have been broadcasted with HE-AAC audio in LATM container, forcing me to decode it through Winamp to WAV and then back to HE-AAC without LATM (LATM HE-AAC → WAV → HE-AAC). Searching in the forum, I've realized that LATM has always been a problem when decoding since 2007, and after 3 years the problem seems to remain in the same way.

I asked my man Google to find a way to demux LATM HE-AAC to raw AAC or to ADTS (the most popular container) and it finds nothing but this webpage with CLI programs that convert from LATM to ADTS and to raw AAC. When I try to convert a LATM stream, I get access violation error.

So, I'm still reencoding LATM HE-AAC audio. Then, the only thing I can do (since I'm not a programmer) is to wonder why, after 3 years, there's still no LATM AAC demuxer/converter.

Saludos

By ALEX-KID
Alex-Kid is offline   Reply With Quote
Old 15th October 2010, 23:53   #2  |  Link
kieranrk
Registered User
 
Join Date: Jun 2009
Location: London, United Kingdom
Posts: 707
Because latm is a very ugly format that is difficult to get into ffmpeg and other players without many dirty hacks.
kieranrk is offline   Reply With Quote
Old 17th October 2010, 22:42   #3  |  Link
Alex-Kid
Antronio's DV ambassador
 
Alex-Kid's Avatar
 
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
Ok, I understand that. However, there are some LATM filters that works to get audio from speakers. For example, the Elecard LATM demultiplexer (bundled in Elecard Codec SDK G4) only connects to audio decoders, it cannot connect to file writers or something like that. Maybe (I really don't know) it could be possible to write a CLI that write raw or ADTS AAC data to a file using that demultiplexer. On the other hand, Igor Janos (taken from his blog at Monogram AAC decoder 0.9.6.0 thread) wrote on July 4, 2009, "As for the LATM -> ADTS conversion… I’m currently not aware of any filter/software that would do this. However the AAC decoder contains a routine that performs this when feeding the libfaad library with AAC data so I suppose it might be possible to write just a simple LATM->RAW/ADTS convertor filter." But there's still no tool like this.

My only hope (very blind, since I don't have programming skills) were the programs that I found on the webpage quoted in the first message. They look very simple, CLI and small, but I don't know if they are missing a little thing or are written completely bad. All I can say is that they don't work with my captures.

I don't know if LATM is a "very ugly format", but when I search through the Internet I see much information about it, so I can't understand why there's no LATM demuxer or converter. Speccially if Igor says it could be done.

Saludos

By ALEX-KID
Alex-Kid is offline   Reply With Quote
Old 18th October 2010, 12:05   #4  |  Link
kieranrk
Registered User
 
Join Date: Jun 2009
Location: London, United Kingdom
Posts: 707
A limited version of latm will probably be added to ffmpeg soon.
kieranrk is offline   Reply With Quote
Old 18th October 2010, 20:55   #5  |  Link
Alex-Kid
Antronio's DV ambassador
 
Alex-Kid's Avatar
 
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
Well, those are good news. And will it be able to demux or convert from LATM to raw/ADTS?
Alex-Kid is offline   Reply With Quote
Old 18th October 2010, 22:32   #6  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Out of interest... Are you able to provide any samples?
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 19th October 2010, 16:23   #7  |  Link
Alex-Kid
Antronio's DV ambassador
 
Alex-Kid's Avatar
 
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
Here it is a TS sample containing LATM AAC audio (54.91 Mb)
http://www.mediafire.com/?l0qvuwl53ne18e3

And here it is the LATM encapsulated audio stream from the same file above (404.2 Kb).
http://www.mediafire.com/?99128a2ntkd0tam

Thank you for your interest. Saludos

By ALEX-KID
Alex-Kid is offline   Reply With Quote
Old 24th October 2010, 12:05   #8  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Thanks for the samples Alex...

Essentilly I wanted to know if my Xtreamer hardware players supported playback of such audio streams. And yes they do
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 25th October 2010, 22:42   #9  |  Link
Alex-Kid
Antronio's DV ambassador
 
Alex-Kid's Avatar
 
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
I thought you could give me a little surprise, SeeMoreDigital. But it's ok , you're welcome, and I'm glad your device supports LATM AAC playback.
Alex-Kid is offline   Reply With Quote
Old 26th October 2010, 18:09   #10  |  Link
Vippe
Registered User
 
Join Date: Feb 2010
Posts: 1
I've managed to do this with VLC and eac3to.

They also use LATM here in Denmark and I had a lot of trouble with recordings from our HD channel.
VLC can play these files as long as they are muxed in a ts or mp4 container, but I found out that if you remuxed a ts file with VLC it would strip the LATM bit packing from the stream.

First I would use eac3to with the -demux parameter to demux the ts file and get the raw audio stream as a file.
So then I use a command like this to remux the .aac file back into a transportstream and VLC will do it's thing.

Code:
vlc.exe -I dummy aud_latm.aac --sout #std{access=file,mux=ts,dst="aud_nolatm.ts"} vlc://quit
The resulting ts file is now playable and works with most demuxers, so just use eac3to again to extract the aac stream from the file if needed.

Hope this helps
Vippe is offline   Reply With Quote
Old 27th October 2010, 00:45   #11  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Thanks Vippe.

VLC seems work with my two latm samples.

Also work using: mux=mp4,dst="aud_nolatm.mp4"
Maybe better?

The mp4 is accepted directly in MkvMerge, tsMuxeR and YAMB
With YAMB (and Foobar2000) the TVN aac in .ts is showed like AAC Main 24KHz, the .mp4 like AAC LC 48 KHz
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 27th October 2010 at 01:09.
tebasuna51 is offline   Reply With Quote
Old 27th October 2010, 09:48   #12  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Which version of VLC player are you guys using?
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 27th October 2010, 10:04   #13  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Tested with v1.1.0 and the last v1.1.4 win32
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 27th October 2010, 11:18   #14  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Quote:
Originally Posted by tebasuna51 View Post
Tested with v1.1.0 and the last v1.1.4 win32
Bummer...

I've tried VLC v1.1.4 with Alex-Kid's 54.91MB sample and got a file containing 0 bytes
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 27th October 2010, 12:16   #15  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
You need extract the aac first (404 KB), with eac3to or DGAVCIndex, like Vippe say:
"First I would use eac3to with the -demux parameter to demux the ts file and get the raw audio stream as a file."

Edit: I think Alex-Kid supply also the aac_latm extracted.
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 27th October 2010 at 12:19.
tebasuna51 is offline   Reply With Quote
Old 28th October 2010, 01:02   #16  |  Link
Alex-Kid
Antronio's DV ambassador
 
Alex-Kid's Avatar
 
Join Date: Mar 2006
Location: Santiago, Chile
Posts: 115
@Vippe: your trick works with all my samples.

@tebasuna51: your "mod" is more direct and it works too!

My problem has been solved at last. Thanks to all of you.
Alex-Kid is offline   Reply With Quote
Old 8th January 2011, 22:04   #17  |  Link
b66pak
Registered User
 
b66pak's Avatar
 
Join Date: Aug 2008
Location: The Land Of Dracula (Romania - EU)
Posts: 934
Quote:
Originally Posted by Vippe View Post
I've managed to do this with VLC and eac3to.

They also use LATM here in Denmark and I had a lot of trouble with recordings from our HD channel.
VLC can play these files as long as they are muxed in a ts or mp4 container, but I found out that if you remuxed a ts file with VLC it would strip the LATM bit packing from the stream.

First I would use eac3to with the -demux parameter to demux the ts file and get the raw audio stream as a file.
So then I use a command like this to remux the .aac file back into a transportstream and VLC will do it's thing.

Code:
vlc.exe -I dummy aud_latm.aac --sout #std{access=file,mux=ts,dst="aud_nolatm.ts"} vlc://quit
The resulting ts file is now playable and works with most demuxers, so just use eac3to again to extract the aac stream from the file if needed.

Hope this helps
how can i mux the video too?
_
__________________
if you ask a question and somebody give you the correct answer don't forget to leave a "thank you" note...
Visit The Land Of Dracula (Romania - EU)!
b66pak is offline   Reply With Quote
Old 8th January 2011, 23:32   #18  |  Link
b66pak
Registered User
 
b66pak's Avatar
 
Join Date: Aug 2008
Location: The Land Of Dracula (Romania - EU)
Posts: 934
example:

video source: h264 in .mp4 (no audio)
audio source: .aac

destination: .mp4
_

N.B. iPad sucks at editing long posts....
_
__________________
if you ask a question and somebody give you the correct answer don't forget to leave a "thank you" note...
Visit The Land Of Dracula (Romania - EU)!
b66pak is offline   Reply With Quote
Old 6th April 2012, 12:16   #19  |  Link
nitinkumgoyal
Registered User
 
Join Date: Feb 2012
Posts: 3
Hey, i have the LATM in RTP packets. Can anybody help me out how can i depacketize them??

I need some algorithm/code to do that.

I am trying to see the rfc 3016 but nothing is so clear there.
nitinkumgoyal is offline   Reply With Quote
Old 30th April 2013, 21:09   #20  |  Link
nars
Registered User
 
Join Date: Sep 2011
Posts: 3
I have been looking for latm aac converter as well for long time, and I know there is code for it on ffmpeg, it can read latm aac files properly however there is unfortunately no option to use it to output just the non latm aac audio without re-compressing it (what I'm looking for... it seems also that tvheadend guys have been able to use ffmpeg latm parser to do such a converter but just for realtime mkv recordings), I did suggested an enhancement for ffmpeg so that latm decoder could be added as a possible bitstream filter, possible allowing the latm decode on 'copy' stream without re-compressing audio:
https://ffmpeg.org/trac/ffmpeg/ticket/2439
(if anyone else interested please vote it/comment there, maybe someone picks the task if there is more people interested on it )
nars is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.