Recording webm streams to disk
Tim Müller
tim at centricular.com
Sat Jun 14 08:54:17 PDT 2014
On Fri, 2014-06-13 at 09:21 +0200, Lee Matthews wrote:
Hi,
> I am currently using gstreamer to stream video captured from a webcam
> connected to a mobile phone. I'm using the vp8 codec within a webm
> container. I wish to, on command, start and stop recording the webm
> stream for future playback. So I used output-selector to switch between
> a fakesink and a filesink.
>
> bin = gst_parse_launch ("webmmux streamable=true name=stream v4l2src
> device=/dev/video3 !
> video/x-raw,format=(string)YUY2,width=(int)320,height=(int)240,framerate=(fraction)20/1
> ! videoconvert ! vp8enc deadline=1 threads=3 token-partitions=2
> cpu-used=1 end-usage=cbr target-bitrate=2048000 ! tee name=t ! queue !
> stream. t. ! queue ! webmmux name=mux ! output-selector name=s s. !
> fakesink name=fakesink async=0 s. ! filesink name=filesink
> location=/data/data/com.mobinet.mobinetbootapp/files/test.webm
> async=0", &err);
>
> The filesink seems to save data ok, but I'm unable to play the
> resulting file with vlc, mplayer or gstreamer.
>
> My question is, given that I just start recording the stream at a
> random time, am I missing valuable metadata that is required to decode
> the stream when stored on a file?
>
> If so, is there something that I can do to add the necessary metadata
> so that the file becomes playable ?
Two things:
1) Are you aware of camerabin? It should handle all that stuff for you.
2) How are you stopping recording? Are you sending an EOS event on the
pipeline (and wait for the EOS on the bus) so that the encoder + muxer +
filesink can finalize headers and index tables properly?
Cheers
-Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com
More information about the gstreamer-devel
mailing list