CLOSED: G.7xx codecs

About encoding, codec settings, muxers and filter usage
xyz000
Blank Cone
Blank Cone
Posts: 27
Joined: 08 Jun 2009 09:33

CLOSED: G.7xx codecs

Postby xyz000 » 09 Jun 2009 17:57

Hello,

Can anyone tell me which of the following CODECs are supported in the VLC and what the required "acodec=" parameter is please? I have VLC 0.9.9 but I'm happy to build a later version from source if required.

G.711 u-law (64 Kbps) (acodec=ulaw)
G.711 a-law (64 Kbps) (acodec=alaw)
G.723.1 (5.3 and/or 6.3 Kbps)
G.726 (any of 16, 24, 32 or 40 Kbps)
G.728 (16 Kbps)
G.729 (any of 6.4, 8 or 11.8 Kbps)

Thanks!
Last edited by xyz000 on 23 Jun 2009 18:01, edited 1 time in total.

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: G.7xx codecs

Postby Rémi Denis-Courmont » 09 Jun 2009 18:10

G.711 is alaw or ulaw and support is built-in. G.726 is g726, VLC supports 16, 24, 32 and 64 kbps variants through libavcodec. The others are not supported.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

xyz000
Blank Cone
Blank Cone
Posts: 27
Joined: 08 Jun 2009 09:33

Re: G.7xx codecs

Postby xyz000 » 10 Jun 2009 12:11

Great answer thank you. I'm most of the way there but I'm still missing something. Here's my command (note that "source.wav" is 8khz 16 bit mono):

Code: Select all

cvlc -vvv source.wav --sout '#transcode{codec=g723,ab=16,rate=8000}:duplicate{dst=rtp{dst=192.168.0.2,port-audio=1234}}'
The output with -vvv enabled is huge ... the section below encapsulates just the -vvv output related to the transcode:

Code: Select all

[00000428] main input debug: `source.wav' successfully opened [00000428] main input debug: control type=1 [00000429] main stream output debug: adding a new sout input (sout_input:0x8270780) [00000430] stream_out_transcode stream out debug: creating audio transcoding from fcc=`s16l' to fcc=`g726' [00000488] main decoder debug: looking for decoder module: 33 candidates [00000488] araw decoder debug: samplerate:8000Hz channels:1 bits/sample:16 [00000488] main decoder debug: using decoder module "araw" [00000488] main decoder debug: TIMER module_Need() : 22.481 ms - Total 22.481 ms / 1 intvls (Avg 22.481 ms) [00000489] main encoder debug: looking for encoder module: 11 candidates [00000489] avcodec encoder debug: libavcodec initialized (interface 3352580 ) [00000489] avcodec encoder debug: found encoder G.726 ADPCM Audio [00000489] main encoder debug: using encoder module "avcodec" [00000489] main encoder debug: TIMER module_Need() : 41.938 ms - Total 41.938 ms / 1 intvls (Avg 41.938 ms) [00000433] stream_out_duplicate stream out debug: duplicated a new stream codec=g726 (es=0 group=0) [00000435] stream_out_rtp stream out debug: maximum RTP packet size: 1400 bytes [00000435] main stream out debug: net: connecting to [192.168.0.2]:1234 [00000435] main stream out debug: net: connecting to [192.168.0.2]:1235 from [192.168.0.3]:32773 [00000435] stream_out_rtp stream out error: cannot add this stream (unsupported codec:g726) [00000433] stream_out_duplicate stream out debug: - failed for output 0 [00000488] main decoder debug: removing module "araw" [00000489] main encoder debug: removing module "avcodec"
So this shows me that libavcodec was enabled and that the G.723 codec is good to go ... yet a few lines later there is an error with the codec! Any ideas?

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: G.7xx codecs

Postby Rémi Denis-Courmont » 10 Jun 2009 17:40

As I said, G.723 is not supported.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

xyz000
Blank Cone
Blank Cone
Posts: 27
Joined: 08 Jun 2009 09:33

Re: G.7xx codecs

Postby xyz000 » 10 Jun 2009 17:56

As I said, G.723 is not supported.
:oops: My fault - there's a mistake in post #3. The command I used was:

Code: Select all

cvlc -vvv source.wav --sout '#transcode{codec=g726,ab=16,rate=8000}:duplicate{dst=rtp{dst=192.168.0.2,port-audio=1234}}'
...and if I can trouble you to revisit the VLC output in post #3 you'll see that G.726 was the attempted codec. Requoted below for absolute clarity:

Code: Select all

[00000489] avcodec encoder debug: found encoder G.726 ADPCM Audio

Code: Select all

[00000435] stream_out_rtp stream out error: cannot add this stream (unsupported codec:g726)
Would you mind taking another peek safe in the knowledge that I sincerely apologise for being an idiot when I typed up my previous reply?

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: G.7xx codecs

Postby Rémi Denis-Courmont » 10 Jun 2009 20:10

RTP packetization for G.726 is a new feature of version 1.0.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

xyz000
Blank Cone
Blank Cone
Posts: 27
Joined: 08 Jun 2009 09:33

Re: G.7xx codecs

Postby xyz000 » 23 Jun 2009 12:45

I now have 1.0.0-rc3 built from source. I've tested that I can transcode an 8kHz mono file to the alaw codec:

Code: Select all

./vlc -vvv -I "dummy" source.wav --sout='#transcode{acodec=alaw,ab=16,channels=1,samplerate=8000}:duplicate{dst=rtp{dst=192.168.0.2,port-audio=1234}}'
This works correctly; I can listen to the received stream and I can see the correct codec in UDP packets in Wireshark.

When I try to transcode to G.726 I get a segmentation fault. Here's the command line:

Code: Select all

./vlc -vvv -I "dummy" source.wav --sout='#transcode{acodec=g726,ab=16,channels=1,samplerate=8000}:duplicate{dst=rtp{dst=192.168.0.2,port-audio=1234}}'
Here's the (truncated) output of VLC:

Code: Select all

[0x82b3b80] main stream out debug: set config option: sout-transcode-acodec to g726 [0x82b3b80] main stream out debug: set config option: sout-transcode-ab to 16 [0x82b3b80] main stream out debug: set config option: sout-transcode-channels to 1 [0x82b3b80] main stream out debug: set config option: sout-transcode-samplerate to 8000 [0x82b3b80] stream_out_transcode stream out debug: codec audio=g726 8000Hz 1 channels 16Kb/s (stuff omitted) [0x82b0b38] main stream output debug: adding a new sout input (sout_input:0x82b8728) [0x82b3b80] stream_out_transcode stream out debug: creating audio transcoding from fcc=`s16l' to fcc=`g726' [0x82c7ee8] main decoder debug: looking for decoder module: 26 candidates [0x82c7ee8] araw decoder debug: samplerate:8000Hz channels:1 bits/sample:16 [0x82c7ee8] main decoder debug: using decoder module "araw" [0x82c7ee8] main decoder debug: TIMER module_need() : 5.798 ms - Total 5.798 ms / 1 intvls (Avg 5.798 ms) [0x82c8848] main encoder debug: looking for encoder module: 6 candidates [0x82c8848] avcodec encoder debug: libavcodec initialized (interface 0x341e02) [0x82c8848] avcodec encoder debug: found encoder G.726 ADPCM Audio (stuff omitted) [0x82b74b8] stream_out_rtp stream out debug: sdp= v=0 o=(stuff omitted) s=Unnamed i=N/A c=IN IP4 192.168.0.2 t=0 0 a=tool:vlc 1.0.0-rc3 a=recvonly a=type:broadcast a=charset:UTF-8 m=audio 1234 RTP/AVP 96 b=AS:16 b=RR:0 a=rtpmap:96 G726-16/8000 [0x82b5cc0] stream_out_duplicate stream out debug: - added for output 0 [0x82afb48] main input debug: Decoder buffering done in 55 ms Segmentation fault
A GDB backtrace shows this:

Code: Select all

#0 0x02f3b5d3 in g726_encode_frame (avctx=0x9cb4730, dst=0xb6b54008 "U@@", buf_size=335896, data=0x9cb5830) at libavcodec/g726.c:357 #1 0x02cc1738 in avcodec_encode_audio (avctx=0x9cb4730, buf=0xb6b54008 "U@@", buf_size=384000, samples=0x2) at libavcodec/utils.c:510 #2 0x02cbb297 in EncodeAudio (p_enc=0x9cb07c0, p_aout_buf=0x9cb0f88) at ../../../../modules/codec/avcodec/encoder.c:1088 #3 0x001291f2 in Send (p_stream=0x9c99080, id=0x9ca9f80, p_buffer=0x9c9a5a0) at ../../../modules/stream_out/transcode.c:1345 #4 0x003d53fd in sout_InputSendBuffer (p_input=0x9c9b8d0, p_buffer=0x9c9a5a0) at ../../src/stream_output/stream_output.c:277 #5 0x003667bf in DecoderProcess (p_dec=0x9ca41c8, p_block=<value optimized out>) at ../../src/input/decoder.c:1628 #6 0x00367448 in DecoderThread (p_this=0x9ca41c8) at ../../src/input/decoder.c:887 #7 0x003bb5e7 in thread_entry (data=0x9c98c10) at ../../src/misc/threads.c:1061 #8 0x00d2046b in start_thread () from /lib/libpthread.so.0 #9 0x00c77dbe in clone () from /lib/libc.so.6
Hopefully lots of detail there. Any ideas?

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: G.7xx codecs

Postby Rémi Denis-Courmont » 23 Jun 2009 17:53

Looks a lot like a bug in libavcodec (or in the transcode plugin). Either way, I am not the person to help you.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

xyz000
Blank Cone
Blank Cone
Posts: 27
Joined: 08 Jun 2009 09:33

Re: G.7xx codecs

Postby xyz000 » 23 Jun 2009 18:00

Thanks. I now have a better understanding of the structure; VLC uses the services provided by libavcodec but libavcodec is developed by the lovely FFmpeg people.

I have a Linux distro which doesn't provide the VLC development libs so I've been building everything from source. I'll be more careful to try to direct my questions to the correct people. I've marked the original subject of this thread as "CLOSED".


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 27 guests