How to stop and restart writing to a filesink (while the pipeline is alive).

Alexander Botero alex.botero at gmail.com
Thu Sep 13 09:17:08 PDT 2012


Many thanks for your replies.

The output-selector element:
Ref:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-output-selector.html
Yes, this look very promising.
I made a small test and it does switch between the filesinks (or between a
filesink and fakesink), but the the resulting file is really big.

Here is my (gtk3 based) test code:
http://www.futuredesktop.org/tmp/test3.c

Compile:
gcc -Wall test3.c -o test3 $(pkg-config --cflags --libs gtk+-3.0 gdk-2.0
gthread-2.0 gstreamer-0.10)

And run:
./test3

The button_1_click() creates the pipeline. In the code, choose
either pipeline_create1() or pipeline_create2() function.
Button_2_click() and button_3_click() functions set the "active-pad"
(active file) on the output-selector.

The resulting file is about 23GB for a few seconds of recording. The file
is not playable.
$ ls -l *.wav
-rw-rw-r-- 1 moma moma 23025309546 Sep 13 17:53 test1.wav

The filesize is correct in the beginning. It gets totally wrong when I
switch between the pads.
My understanding of the pads and sinks is not very good.

What can I do to keep the filesize correct?
----------------------------------------------------------------

The GstCutter element:
I just began to test the "cutter" element. I will comment it later on.
----------------------------------------------------------------

>Tim-Philipp Müller:
> Do you want the resulting audio to be in one single file (without
the "silent" bits), or do you want to start a new file for each piece with
a"signal".

The recording should output a single file. It should filter out the
"silent" parts.

This is the audio-recorder i want to improve.
http://bildr.no/view/805395
It's on the launchpad.net. "audio-recorder".

Kindly
 Alexander


On Mon, Sep 10, 2012 at 9:02 PM, Tim-Philipp Müller <t.i.m at zen.co.uk> wrote:

> On Mon, 2012-09-10 at 19:48 +0200, Alexander Botero wrote:
>
> Hi,
>
> > I have a small audio recorder that uses Gstreamer.
> > I would like the recorder to pause when the signal-level drops under a
> > certain value,  and re-start when the level rises again.
>
> Do you want the resulting audio to be in one single file (without the
> "silent" bits), or do you want to start a new file for each piece with a
> "signal".
>
> There's also the "cutter" element btw (so you don't have to actively
> monitor the level value).
>
> Cheers
>  -Tim
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120913/81dd042a/attachment.html>


More information about the gstreamer-devel mailing list