using ffmpeg for transcoding to Ulaw

About encoding, codec settings, muxers and filter usage
baboom
Blank Cone
Blank Cone
Posts: 50
Joined: 17 Oct 2011 09:13

using ffmpeg for transcoding to Ulaw

Postby baboom » 26 Nov 2012 17:38

Hi all,
I'm having some trouble with the transcoding. I need to stream ulaw audio via RTP protocol. I've tried to transcode the original mp3 files and it looks like it's working properly but when I listen to the stream sent, I can hear a periodic noise. To check wether the noise was coming at the transcodification or when sending it with RTP I've tried saving the transcoded audio into a file, which has this annoying noise already. The sout string I use is :

:#sout=transcode{vcodec=none,acodec=ulaw,ab=64,channels=1,samplerate=8000}:rtp{dst=1.1.1.1,port=5004}

However, I knew that VLC uses FFMPEG so I downloaded it and tried to do the transcodification with this program. This is the string I used:

ffmpeg -i <input_file> -ac 1 -ar 8000 -ab 64 -acodec pcm_mulaw <output_file> -f mulaw

And after transcoding the audio, I sent it via RTP and the audio was fine, no noise at all! So, I have been googling and searching at the forum how to use the ffmpeg transcoding modules instead of VLCs own ones. I've seen the --demux ffmpeg option, but wasn't enough to get rid of the noise...

How could I achieve this?

Thanks a lot in advance,

Ben.

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

Re: using ffmpeg for transcoding to Ulaw

Postby Rémi Denis-Courmont » 26 Nov 2012 21:11

Add venc=ffmpeg
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

baboom
Blank Cone
Blank Cone
Posts: 50
Joined: 17 Oct 2011 09:13

Re: using ffmpeg for transcoding to Ulaw

Postby baboom » 27 Nov 2012 08:26

I haven't tried yet, but shouldn't it be aenc? I'm just trying to transcode audio... and another little question, this shold be added at the sout string, right?

Thanks a lot Mr. Denis-Courmont.

Ben.

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

Re: using ffmpeg for transcoding to Ulaw

Postby Rémi Denis-Courmont » 27 Nov 2012 09:03

Right.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

baboom
Blank Cone
Blank Cone
Posts: 50
Joined: 17 Oct 2011 09:13

Re: using ffmpeg for transcoding to Ulaw

Postby baboom » 27 Nov 2012 11:05

I'm afraid that's not enough to get rid of this problem... The noise is still added when transcoding... I'm using the next sout string:
:sout=#transcode{aenc=ffmpeg,acodec=ulaw,ab=64,channels=1,samplerate=8000}:rtp{dst=1.1.1.1, port=5004} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep
And have tried both, adding --demux ffmpeg at runtime and not adding it, but the noise is still there... How could I get rid of it? It's like an old video game 8 bit noise repeatedly added to the song...

The parameters between bhe transcode brackets are well accepted by ffmpeg, right? I mean, shoudl I write mulaw or pcm_mulaw instead of ulaw? or should I add something which would be similar to "-f mulaw"?

Thank you,

Ben.

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

Re: using ffmpeg for transcoding to Ulaw

Postby Rémi Denis-Courmont » 27 Nov 2012 12:43

That just means that this is not an encoder problem, and the VLC native µlaw codec works fine. My best guess is resampling. Another potential issue is remixing.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

baboom
Blank Cone
Blank Cone
Posts: 50
Joined: 17 Oct 2011 09:13

Re: using ffmpeg for transcoding to Ulaw

Postby baboom » 27 Nov 2012 16:04

but VLC uses avcodec for resampling, doesn't it? (at least I've seen so at the messages) and so does ffmpeg... :S

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

Re: using ffmpeg for transcoding to Ulaw

Postby Rémi Denis-Courmont » 27 Nov 2012 16:35

No.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

baboom
Blank Cone
Blank Cone
Posts: 50
Joined: 17 Oct 2011 09:13

Re: using ffmpeg for transcoding to Ulaw

Postby baboom » 27 Nov 2012 17:13

sorry, it's ugly_resampler... So, is this a known problem which has not been solved I guess...
Is there any way to avoid using this resampling module and letting ffmpeg to get control on all that stuff?

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

Re: using ffmpeg for transcoding to Ulaw

Postby Rémi Denis-Courmont » 27 Nov 2012 20:11

Not that I know.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

baboom
Blank Cone
Blank Cone
Posts: 50
Joined: 17 Oct 2011 09:13

Re: using ffmpeg for transcoding to Ulaw

Postby baboom » 28 Nov 2012 08:34

alright, thank you!


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 19 guests