Hi everybody !
I'm a bit new at GStreamer, it looks like it could be a nice framework even if you get mad at it most of the times...

So, I'm trying to do the following thing : I'd like to stream from my webcam but make a backup of this stream in a file. But I would like to "seek" in the stream with a custom made program (in C) that also sends the stream over UDP. So, as it is not possible to directly seek in a stream, I decided to record what my webcam can see in file, then stream the file and try to seek it (this is done with a C program). I really want to use the H.264 codec.

I've tried two containers : AVI and MP4.
Here are the pipelines (and the problems I encountered) :

AVI : 
Recording : gst-launch -v -e v4l2src ! videoscale ! videorate ! "video/x-raw-yuv,width=(int)320,height=(int)240,framerate=(fraction)15/1" ! x264enc byte-stream=true ! avimux ! filesink location=test.avi & 

Streaming : gst-launch -v -e filesrc location=test.avi ! avidemux name=demux demux.video_00 ! queue !  decodebin ! x264enc byte-stream=true ! rtph264pay ! udpsink host=192.168.1.12 port=1234 &


<i>Problems : I can stream the "being recorded" file and see it with totem and a sdp file but I can't seek backward. I tried the nice gst-rtsp-server library that helps you easily set up a RTSP server but it didn't work. And my program that streams the file over UDP (which contains this pipeline in C) doesn't let me seek backward (and I tried the official GStreamer tutorial "Time Management").
</i>


MP4 : 

Recording : gst-launch -e -v v4l2src ! videoscale ! videorate ! "video/x-raw-yuv,width=320,height=240,framerate=15/1" ! ffmpegcolorspace ! x264enc byte-stream=true ! h264parse ! mp4mux ! filesink location=test.mp4


Streaming : gst-launch -v filesrc location=test.mp4 ! qtdemux name=d d. ! queue !  decodebin ! x264enc byte-stream=true ! rtph264pay ! udpsink host=192.168.1.12 port=1234 &


<i>Problems : This time I cannot stream the "being recorded" file. I tried the second pipeline, then my custom program, then the gst-rtsp-server example test-mp4 and all worked with a "finished" file. But not with a "being recorded" file.
</i>


So I'm pretty much lost because each of the solutions does part of the job but not completely.
Do you have any idea? Maybe my pipelines are wrong or the muxers/demuxers/codec can't make it work... 

Thanks in advance for every single answer I'll get :)


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Webcam-stream-a-file-that-is-being-recorded-tried-avi-and-mp4-but-nonthing-worked-tp4671330.html">Webcam : stream a file that is being recorded, tried .avi and mp4 but nonthing worked...</a><br/>
Sent from the <a href="http://gstreamer-devel.966125.n4.nabble.com/">GStreamer-devel mailing list archive</a> at Nabble.com.<br/>