Audio decoding: Transcoder configuration

2 views
Skip to first unread message

sander.borsboom

unread,
Oct 8, 2013, 3:03:04 PM10/8/13
to avblocks...@googlegroups.com
Hi,

we have implemented most of the infrastructure to decode audio, but the last open issue is configuring the  Transcoder. When we try to open it after configuration, we get the following error codes:

open transcoder1: Unsupported format (facility:5 code:7)

Using the following error function:

void AvBlockPoc::printError(const wchar_t* action, const primo::avblocks::ErrorInfo* e)
{
if (action)
{
wcout << action << L": ";
}

if (ErrorFacility::Success == e->facility())
{
wcout << L"Success" << endl;
return;
}

// AVBlocks only defines primo::ustring
#ifdef __linux__
wcout << ustring( e->message() ) << L" (facility:" << e->facility() << L" code:" << e->code() << L")" << endl;
#else
wcout << e->message() << L" (facility:" << e->facility() << L" code:" << e->code() << L")" << endl;
#endif

}

My question: how should we configure the transcoder when we have as input:
  • G726 ADPCM, 
  • a sample rate of 8000
  • a bitRate of 32000 
  • 1 channel
  • signed (likely, not entirely sure yet).
And as output:
  • PCM 
  • with the same sampleRate (so 8000)
  • 16 bits per sample, 
  • little-endian, 
  • 1 channel, 
  • signed.
I have attached our approached, simplified from the code, so there might be small typing mistakes, in simplification.txt.

Greetings,

Sander Borsboom
simplification.txt

Svilen Stoilov

unread,
Oct 9, 2013, 3:48:10 AM10/9/13
to avblocks...@googlegroups.com

Hi Sander,

 

The G726 codec has a subtype an it must be set explicitly like this:

 

asi->setStreamSubType(StreamSubType::G726_PACKED_RFC3551); // for RTP

 

See StreamSubType in PrimoAV.h. There are 2 subtypes for G726 (used in RTP and in wave files).

The G726 codec cannot detect which packetization is used and it does not default to anything so it must be told explicitly.

The rest of the transcoder configuration looks Ok (I assume that you release your StreamInfo, MediaPin and MediaSocket instances after you set them, otherwise they will leak).

 

Regards,

Svilen

 

Reply all
Reply to author
Forward
0 new messages