Jan, <div>I have a similar requirement and would be willing to collaborate with you on this one. I agree that mutlifilesink is the right implementation from a pipeline architecture perspective. But mux and codec complexities might throw some curves. I am interested in using it with the mp4mux. </div>
<div>It looks as if multifilesink is very close to doing it. Here's what I have tried:</div><div><br></div><div>gst-launch -vt --gst-plugin-spew videotestsrc num-buffers=10 do-timestamp=true is-live=true ! queue \</div>
<div><div>! 'video/x-raw-yuv,width=1280,height=720,framerate=15/1' ! x264enc pass=5 quantizer=22 speed-preset=4 profile=1 ! queue ! mux. \</div><div> audiotestsrc is-live=true num-buffers=10 ! queue ! faac bitrate=44100 ! queue ! mux. \</div>
<div> mp4mux name="mux" faststart=true ! \</div><div> multifilesink location=segment%05d.mp4 post-messages=true next-file=<span style="background-color:rgb(255,255,102)">1 </span></div><div>#filesink location=segment.mp4 </div>
<div># above works but multifilesink fails to open file line 532</div><div><br></div><div>There appear to be a few problems:
</div><div>1. With any next-file value other than 0, multifilesink fails to open file line 532. I'm not sure why.</div><div>2. There needs to be a new GstMultiFileSinkNext file for a certain amount of time. </div><div>
3. Currently, the files created with next-file=0 have size but are corrupt, presumably because the lack the proper mp4 format. Although next-file=2 is commented as being useful for TSMUX streams, which are similar. Also not sure why.</div>
<div><br></div><div>It seems like a very useful feature for DVR applications. Anyone have some guidance on this? </div><div><br></div><div><div><div><b>Mike Mitchell</b><br><br><br>
<br><br><div class="gmail_quote">On Wed, Feb 1, 2012 at 3:00 AM, Jan Spurny <span dir="ltr"><<a href="mailto:JSpurny@seznam.cz" target="_blank">JSpurny@seznam.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I'm trying to store video from one video stream into multiple files with given duration.<br>
Something which could look like this:<br>
<br>
gst-launch souphttpsrc location=<a href="http://1.2.3.4/video1" target="_blank">http://1.2.3.4/video1</a> ! decodebin ! x264enc ! SOMETHING filename="file_%D_%T.mp4" duration=2m<br>
<br>
and it would produce files like these:<br>
<br>
file_2012-02-01_10-12-43.mp4<br>
file_2012-02-01_10-14-43.mp4<br>
file_2012-02-01_10-16-43.mp4<br>
..<br>
<br>
I don't expect that element "SOMETHING" already exists so I'll have to write it myself. I have written a few simple gstreamer elements (mostly some kind of raw-video transformations) so I'm quite confident I'll be able to do it, but I do need all advices and guidelines I can get.<br>
<br>
I'll have many different inputs - different input sources (files, http streams, rtsp streams, v4l, ..) and also different input formats (mjpeg, mpeg4, h264, raw-yuv). But that's ok, gstreamer can handle these without problems.<br>
<br>
Now I can either just simply reuse the stream and just "cut it into chunks of desired length", but as there are so many different formats to work with..<br>
Or I'll just recode video into some default format. That's why I have a "decodebin ! x264enc" in my pipeline above. I may support more formats in the future but for the first version one is enough.<br>
<br>
So with one known format (let's say h264) I'll have to "pack it" (muxer) into small chunks and write them down to disk.<br>
<br>
This is the part where I don't really know where to start - I guess studying some existing muxer and would be a good start, but I'm really scared of all the complexity with encoded video streams, B-frames, I-frames, and all this..<br>
<br>
<br>
Thanks in advance for any help, advices or suggestions.<br>
<span><font color="#888888"><br>
Jan Spurny<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</font></span></blockquote></div><br></div></div></div>
</div>