[Asterisk-video] My AMR experience with app_h324m

Klaus Darilion klaus.mailinglists at pernau.at
Tue Sep 4 05:13:38 CDT 2007


Hi!

I think it would be best if Asterisk internally uses the RTP format of 
AMR octed-aligned. This way, Asterisk can relay AMR frames from/to RTP 
without any need to analyze and manipulate the AMR frame.

The RTP format is (RFC 4867, section 4.4):

1 byte CMR (codec mode request)
x bytes ToC (table of contents, indicate the AMR mode of each AMR frame)
x AMR frames

Thus, if you have 1 frame encoded in mode 7 you will have 33 bytes:
1 byte CMR
1 byte TOC
31 bytes AMR frame in mode 7

This is they way how we handle the situation with h324m_gw and mp4save/play.

app_h324m converts between IF2 (h324 AMR frames) and RTP octed-aligned 
(ast_frame) mode.
app_mp4 need not to do any conversion as .3gp files also use the RTP 
octed-aligned mode.

For conversion from AMR to other codecs, the AMR patch from the 
asterisk-video list (Sergio's email from 16.7.2007) together with my 
patch from yesterday can be used with

[amr]
octet-aligned=1

in codecs.conf.

Then AMR codec uses RTP octed-aligned format for ast_frame.

I think you are trying the same thing, but have an error in step 3: Why 
do you add F03C? F0 is the CMR, but why adding 3C?

regards
klaus

Reza Fatahillah schrieb:
> Hi,
> 
> I have tried app_h324m with some patching, at
> app_h324m to make AMR works. It based on some
> assumptions.
> 1. I'm using IF1 format inside my application which
> will be converted to IF2 by app_h324m
> 2. I'm using AMR library from 3gpp standar, and the
> result bytestream for Mode 7 are similar to below:
> 3C02...0C (up to 32 bytes). From the 3gpp spec, the
> first byte(3C) called as AMR Header, and the rest as
> AMR Core Speech.
> 3. I'm using RTP packetization like app_h324m do, sot
> the bytestream will be 34 bytes with addition of 2
> bytes (FO3C). So the final stream will be
> F03C3C02...0C
> 
> And because of this pattern the current SVN codes
> didn't work. 
> I have to move the offset one more byte so app_h324m
> can convert to IF2 properly.
> 
> My question, is this the correct pattern?
> 
> Thanks,
> Reza
> 
> 
>        
> ____________________________________________________________________________________
> Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
> http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-video mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-video



More information about the asterisk-video mailing list