transcode aac stream to mp3 stream on-the-fly

About encoding, codec settings, muxers and filter usage
hakova
Blank Cone
Blank Cone
Posts: 16
Joined: 20 Dec 2007 02:45

transcode aac stream to mp3 stream on-the-fly

Postby hakova » 30 Mar 2009 01:50

Hi there,

What I aim to achieve is transcoding an aac stream to an mp3 one, preferably using a big enough cache to avoid problems. I will then play the mp3 stream on my receiver, which fails to play the aac stream. A command line solution is preferred to a description of how to do this by using the GUI, although I will happily take whatever can be provided.

I tried the following with no success:

Code: Select all

vlc -vvv http://xx.xx.xxx.x:8875/ --sout-transcode-acodec 'mp3' --sout-transcode-ab 192 --sout-transcode-channels 2 --sout-standard-access 'http' --sout-standard-mux 'raw' --sout-standard-dst '8091'
I am using Mandriva 2008.0 with vlc 0.8.6c.

Regards,

Hakan

Arite
Big Cone-huna
Big Cone-huna
Posts: 2478
Joined: 26 Jun 2007 20:40
VLC version: 3.0.20
Operating System: Debian Testing|Win10

Re: transcode aac stream to mp3 stream on-the-fly

Postby Arite » 30 Mar 2009 03:03

Try for example:

Code: Select all

vlc -vvv http://xx.xx.xxx.x:8875/ --sout #transcode{acodec=mp3,ab=192,channels=2}:duplicate{dst=std{access=http,mux=raw,dst=DEST_IP:8091}}
Where DEST_IP is your destination IP address (receiver IP address).

Arite.
Don't use PMs for support questions.

hakova
Blank Cone
Blank Cone
Posts: 16
Joined: 20 Dec 2007 02:45

Re: transcode aac stream to mp3 stream on-the-fly

Postby hakova » 30 Mar 2009 05:12

Thanks Arite for your quick reply. It works, but with a strange twist. The stream is 22050 Hz instead of 44100, and probably because of that the playback is like listening to a 1/2 of normal playback rate, which sounds like slow motion. Now if you have a vlc client listening to this stream, you can double the playback rate there and listen to it at normal rate, but my receiver cannot increase the playback rate unfortunately. Is there any way to enforce a transcoding/sampling frequency of 44100 Hz? Or is there any other solution to this problem that you can think of?

Regards,

Hakan

Edit: I added the following to the transcode section of the command line:

Code: Select all

samplerate=44100
Unfortunately, everything is still in slow motion on the client side, although now the sample rate reads 44100 instead of 22050. It must be something else than the sampling rate.

hakova
Blank Cone
Blank Cone
Posts: 16
Joined: 20 Dec 2007 02:45

Re: transcode aac stream to mp3 stream on-the-fly

Postby hakova » 31 Mar 2009 03:36

OK, after searching quite a bit, I figured that there have been other users with similar experience. There was also a bug report (#1630) about a similar issue, although not quite the same. That bug report was then closed with an update note of a newer version. Therefore, I tried the same command line on vlc 0.9.3 Grishenko, which just produced noise instead of a real audio stream. The slow audio problem was at least solvable when one used vlc client on the other end by multiplying the playback rate; whereas noise is not. Therefore, it seems like version 0.9.3 was a step backward on this aspect.

A workaround for this issue might be transcoding the mp4/aac stream to a local mp3 file and then streaming from it, instead of doing it on the fly. In this case scenario, there has to be a certain delay in playback (which is fine) and a file size limit to avoid using valuable HDD space in GBs. Can any one point me to the right direction of how to rotate local mp3 file(s)? For example, if I have 3 mp3 files used as some kind of a cache, the first one gets deleted as the third one is created and written to, and the second one will be played back. Then second one then will be rotated to the first one once the playback finishes, the third one will become the second one and therefore will start to be played back, while a new third mp3 file will be written synchronously. I just don't have the required programming background to put something together like this, and any help will be greatly appreciated.

Hakan

Osman
New Cone
New Cone
Posts: 3
Joined: 03 Apr 2009 09:31

Re: transcode aac stream to mp3 stream on-the-fly

Postby Osman » 03 Apr 2009 09:39

Hi,
I'm trying to transcode an AAC 32k 44.1kHz stereo shoutcast stream into MP3 12k8kHz 44.kHz stereo.
So far, using info from this thread, I've got it transcoding into MP3 128kHz 44.kHz mono.
I just can't seem to get stereo to work. I've included 'channels=2', but this is not making any difference.
Any ideas?

hakova
Blank Cone
Blank Cone
Posts: 16
Joined: 20 Dec 2007 02:45

Re: transcode aac stream to mp3 stream on-the-fly

Postby hakova » 04 Apr 2009 23:15

...
So far, using info from this thread, I've got it transcoding into MP3 128kHz 44.kHz mono....
Hi Osman,

May I ask what operating system and which version of vlc you are using?

Osman
New Cone
New Cone
Posts: 3
Joined: 03 Apr 2009 09:31

Re: transcode aac stream to mp3 stream on-the-fly

Postby Osman » 04 Apr 2009 23:29

Hi,
I'm using 0.9.9 (the latest version which I downloaded the other day).
This has a lot of problems fixed, and leaves only this mono issue.
Prior to this, version 0.9.8 did not work well at all and was literally unusable.
If you can help/advise, it would be greatly appreciated.
Thanks,
Osman

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: transcode aac stream to mp3 stream on-the-fly

Postby Jean-Baptiste Kempf » 05 Apr 2009 00:15

Yeah, 1.0.0 has more issues fixed.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Osman
New Cone
New Cone
Posts: 3
Joined: 03 Apr 2009 09:31

Re: transcode aac stream to mp3 stream on-the-fly

Postby Osman » 05 Apr 2009 01:22

I've tried the latest 1.0.0 from the nightlies area, but this isn't working either :(
I'm pretty sure I've got the config right, and this is a functionality problem within the player.
Unless anyone knows how to overcome this problem, I'm guessing it's going to be a case of waiting until a release comes out which has the fix.
I wait in hope and patience...
Osman


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 6 guests