storing one video stream into multiple files
Mike Mitchell
mike.mitchell at panometric.net
Thu Feb 16 13:50:00 PST 2012
Jan,
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.
It looks as if multifilesink is very close to doing it. Here's what I have
tried:
gst-launch -vt --gst-plugin-spew videotestsrc num-buffers=10
do-timestamp=true is-live=true ! queue \
! 'video/x-raw-yuv,width=1280,height=720,framerate=15/1' ! x264enc pass=5
quantizer=22 speed-preset=4 profile=1 ! queue ! mux. \
audiotestsrc is-live=true num-buffers=10 ! queue ! faac bitrate=44100 !
queue ! mux. \
mp4mux name="mux" faststart=true ! \
multifilesink location=segment%05d.mp4 post-messages=true next-file=1
#filesink location=segment.mp4
# above works but multifilesink fails to open file line 532
There appear to be a few problems:
1. With any next-file value other than 0, multifilesink fails to open file
line 532. I'm not sure why.
2. There needs to be a new GstMultiFileSinkNext file for a certain amount
of time.
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.
It seems like a very useful feature for DVR applications. Anyone have some
guidance on this?
*Mike Mitchell*
On Wed, Feb 1, 2012 at 3:00 AM, Jan Spurny <JSpurny at seznam.cz> wrote:
> Hi,
>
> I'm trying to store video from one video stream into multiple files with
> given duration.
> Something which could look like this:
>
> gst-launch souphttpsrc location=http://1.2.3.4/video1 ! decodebin !
> x264enc ! SOMETHING filename="file_%D_%T.mp4" duration=2m
>
> and it would produce files like these:
>
> file_2012-02-01_10-12-43.mp4
> file_2012-02-01_10-14-43.mp4
> file_2012-02-01_10-16-43.mp4
> ..
>
> 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.
>
> 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.
>
> 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..
> 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.
>
> 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.
>
> 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..
>
>
> Thanks in advance for any help, advices or suggestions.
>
> Jan Spurny
> _______________________________________________
> 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/20120216/6f5cb5ab/attachment.html>
More information about the gstreamer-devel
mailing list