VLC inmemory transcoding
Asked Answered
B

0

6

I want to do in-memory converting between audio formats supported by VLC. For instance from MP3 to PCM wave. Because of various reasons (speed, real-time streaming) it is not possible to write the file to disk, convert it and read it back. It all has to be done in memory. I'm not too familiar with the VLC API so this could very well be a trivial question.

From what I can see in this Codeproject article this can be done using a "Memory Renderer" which came in VLC 1.2. However it doesn't say anything about input.

How can I use VLC to do in-memory converting (think System.IO.Stream) of audio formats?
Best case: input (source) and output (destination) is in memory.
Can settle with: Output is in memory.

I have looket at several projects for this. The only one (from what I could see) that requires VLC >=1.2 is VlcDotNet. But again, maybe this feature was there before 1.2?

Bought answered 30/3, 2012 at 8:32 Comment(4)
Just send VLC sout command as follows: vlc -I dummy -vvv "input.mp3" --sout=#transcode{acodec=s16l,channels=2,ab=128,samplerate=44100}:standard{access=file,mux=wav,dst="output.wav"} vlc://quitCountrydance
Check this for your guide on how to pass VLC command options via vlc.AddTargetAndPlay(target, options); using VLCdotNet.Countrydance
My whole point was avoiding to use files. That gives me a big overhead.Bought
IMemoryRenderer callback in nVLC (.NET C++/CLI binding of libVLC) looks similar to RenderCallbackAdapter callback in VLCJ (Java binding of libVLC) which requires pre-allocated memory frame buffer. However, both are used for direct video rendering, not for audio. You just play the transcoded audio on-the-fly is sufficient enough if you don't want to save it to a file; there is a sout command to perform it.Countrydance

© 2022 - 2024 — McMap. All rights reserved.