Tanu, this worked great! I do get exactly the expected flow rate as you said...<br>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. <br>
I'm investigating why this is happening, but if anybody knows the reason, I would love to hear it! :)<br><br>Thanks,<br>Rui<br><br><div class="gmail_quote">On Fri, May 23, 2008 at 8:59 PM, Tanu Kaskinen <<a href="mailto:tanuk@iki.fi">tanuk@iki.fi</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Fri, May 23, 2008 at 12:00:26PM +0200, Rui Pereira wrote:<br>
> So, another idea is using pipe-sinks. In theory, I could set up N different<br>
> pipe-sinks for N running clients and move each stream to a separate pipe.<br>
> Then, since FFMPEG can get its input from a pipe, I could have N instances<br>
> of FFMPEG running and encoding in real-time.<br>
><br>
> But here's my problem - when reading the pipe that PA creates, I get an<br>
> enormous data rate out of it. I configure it for 22050Hz, s16le and 2<br>
> channels, so I expect around 705kb/s..<br>
> Even without anything playing, it seems that the output is just flooding<br>
> with zeros. To do a quick test, if I "cat pipname > grabbed" for a couple of<br>
> seconds, the file reaches 200, 300 MB easily. So - my guess is that<br>
> pipe-sink module seems to be outputting data as fast as it can, even if it<br>
> is just 0s.<br>
><br>
> Is is this case? Is it on purpose? Can someone explain what's going on? (or<br>
> perhaps have better suggestions on how to achieve the same goal)?<br>
<br>
<br>
</div>I don't know how exactly the pipe sink is supposed to work,<br>
so I'll skip to the last question. One solution would be<br>
using null sinks instead of pipes, and recording from their<br>
monitor sources, like this:<br>
<br>
parec -d null_sink1.monitor | encoder1<br>
parec -d null_sink2.monitor | encoder2<br>
<br>
etc...<br>
<br>
If you record while nothing is played, zeros are generated<br>
just like with the pipe sink too, but at least the timing is<br>
sensible.<br>
<br>
See parec --help for available options and the default<br>
values for the stream format.<br>
<font color="#888888"><br>
--<br>
Tanu Kaskinen<br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@mail.0pointer.de">pulseaudio-discuss@mail.0pointer.de</a><br>
<a href="https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss" target="_blank">https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss</a><br>
</font></blockquote></div><br>