[pulseaudio-discuss] Converting sound output with FFMPEG

Rui Pereira rfapereira at gmail.com
Tue May 27 02:06:19 PDT 2008


Tanu, this worked great! I do get exactly the expected flow rate as you
said...
I did some tests with ffmpeg, and I can generate mp3 files using this
approach. The only strange thing is that I'm getting these weird sound
hiccups on the recorded stream... but it seems a bit random when they
happen. It's not silence, but like the wrong sound sample pops in the middle
of the normal music.
I'm investigating why this is happening, but if anybody knows the reason, I
would love to hear it! :)

Thanks,
Rui

On Fri, May 23, 2008 at 8:59 PM, Tanu Kaskinen <tanuk at iki.fi> wrote:

> On Fri, May 23, 2008 at 12:00:26PM +0200, Rui Pereira wrote:
> > So, another idea is using pipe-sinks. In theory, I could set up N
> different
> > pipe-sinks for N running clients and move each stream to a separate pipe.
> > Then, since FFMPEG can get its input from a pipe, I could have N
> instances
> > of FFMPEG running and encoding in real-time.
> >
> > But here's my problem - when reading the pipe that PA creates, I get an
> > enormous data rate out of it. I configure it for 22050Hz, s16le and 2
> > channels, so I expect around 705kb/s..
> > Even without anything playing, it seems that the output is just flooding
> > with zeros. To do a quick test, if I "cat pipname > grabbed" for a couple
> of
> > seconds, the file reaches 200, 300 MB easily. So - my guess is that
> > pipe-sink module seems to be outputting data as fast as it can, even if
> it
> > is just 0s.
> >
> > Is is this case? Is it on purpose? Can someone explain what's going on?
> (or
> > perhaps have better suggestions on how to achieve the same goal)?
>
>
> I don't know how exactly the pipe sink is supposed to work,
> so I'll skip to the last question. One solution would be
> using null sinks instead of pipes, and recording from their
> monitor sources, like this:
>
> parec -d null_sink1.monitor | encoder1
> parec -d null_sink2.monitor | encoder2
>
> etc...
>
> If you record while nothing is played, zeros are generated
> just like with the pipe sink too, but at least the timing is
> sensible.
>
> See parec --help for available options and the default
> values for the stream format.
>
> --
> Tanu Kaskinen
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20080527/09c2e75d/attachment.htm>


More information about the pulseaudio-discuss mailing list