<div dir="ltr"><div>Hi!<br><br></div>Thanks for pointing me to splitmuxsink and splitmuxsrc. That would spare me a good chunk of code.=) <br><br>The only thing I don't understand about splitmuxsrc is how to specify a specific file list or to modify it in playing state. By default I have a separate directory for each hour of recording. I can stream files from one hour with location=/archive/video/cam/day/hour/*.mp4, but what happens when I finish this hour? The awkward hack is to make a temp directory and add simlinks to videofiles from main archive to it in advance...<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-30 23:53 GMT+03:00 Tim Müller <span dir="ltr"><<a href="mailto:tim@centricular.com" target="_blank">tim@centricular.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, 2016-03-27 at 22:28 +0300, Krutskikh Ivan wrote:<br>
<br>
Hi,<br>
<br>
Your subject line mentions 'playbin2' - are you using the outdated and<br>
unmaintained GStreamer 0.10 ? If yes, you should switch to a current<br>
1.x version.<br>
<span class=""><br>
> I'm developing a video recording/broadcasting server with gstreamer<br>
> and python.<br>
><br>
> Right now I'm facing 2 tasks:<br>
><br>
> - recording video from different sources (rtsp and http) and with<br>
> different codecs (mjpeg,mpeg4,h264,h265) in a series of mkv files<br>
><br>
> - broadcasting video from my archive to different clients using http<br>
> and rtsp.<br>
><br>
> Before discovering the playbin magic I used a number of template<br>
> pipelines to capture video from source, pass it to multifilesink and<br>
> ffmpeg to finish and store them in a convinient way, But if I could<br>
> somehow feed my uri to playbin and get an undecoded video/audio<br>
> stream from it, I would be able to put all my templates to single<br>
> gstreamer pipeline: playbin uri=rtsp... (magic here) ! mpegtsmux !<br>
> multifilesink... And that would be very convenient.<br>
<br>
</span>For what it's worth, there is also decodebin and uridecodebin, which<br>
are used inside of playbin but lower level.<br>
<br>
You can also make (uri)decodebin stop autoplugging decoders early so<br>
you can transmux without re-encoding, for example (auto* signals).<br>
<div><div class="h5"><br>
<br>
> The second task is more ambitious. I want to feed the recorded video<br>
> to my clients as if it was a live source. Right now I have a file<br>
> tree:<br>
><br>
> /basedir/cam_name/yearmonthday/hour/minutesecond-duration.mp4<br>
><br>
> Example:<br>
><br>
> archive-test:/archive/video/multi/160327/21 # ls<br>
> 0120-00125.mp4 0730-00120.mp4 1335-00120.mp4 1940-00125.mp4 2545-<br>
> 00120.mp4 3150-00120.mp4 3755-00120.mp4 4400-00125.mp4 5005-<br>
> 00125.mp4 5610-00125.mp4<br>
> 0325-00120.mp4 0930-00120.mp4 1535-00125.mp4 2145-00120.mp4 2745-<br>
> 00125.mp4 3350-00125.mp4 3955-00125.mp4 4605-00120.mp4 5210-<br>
> 00120.mp4 5815-00120.mp4<br>
> 0525-00125.mp4 1130-00125.mp4 1740-00120.mp4 2345-00120.mp4 2950-<br>
> 00120.mp4 3555-00120.mp4 4200-00120.mp4 4805-00120.mp4 5410-<br>
> 00120.mp4<br>
><br>
> At some point in the future I recieve a request to play video from<br>
> cam multi from 21:05 160327. I can then find my started file,<br>
> construct a pipeline with playbin and multisocketsink, fast forward<br>
> to the desired time and replace the uri of the file upon each about-<br>
> to-finish signal. The complex part is that I also need an undecoded<br>
> video stream since I plan to broadcast it to remote client without<br>
> re-encoding.<br>
><br>
> So my questions are:<br>
><br>
> 1) Is this design possible?<br>
> 2) Where can I find some examples of such pipelines, preferably in<br>
> python.<br>
<br>
</div></div>It's all possible, but will be a bit fiddly.<br>
<br>
You probably want something lower-level than playbin.<br>
<br>
In recent GStreamer versions we have splitmuxsink and splitmuxsrc which<br>
you might find helpful in this context.<br>
<br>
What protocols do you want to stream as? The easiest would be to just<br>
use gst-rtsp-server (see gst-rtsp-server/examples for some simple<br>
examples).<br>
<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888"> -Tim<br>
<br>
<br>
--<br>
Tim Müller, Centricular Ltd - <a href="http://www.centricular.com" rel="noreferrer" target="_blank">http://www.centricular.com</a><br>
<br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</font></span></blockquote></div><br></div>