Dump 10 seconds of video at once.

Anton Pryima zingfrid at gmail.com
Wed Feb 19 18:39:36 UTC 2020


Hello,

I've tried, but there are couple disadvantages:
1. I'm not able to stop part of the pipe which writing to the file.
2. Setting min-threshold-time to 1 dynamically doesn't have any effect.

Finally, I'm trying to achieve that using shm:
pipeline_string = "rtspsrc location=<video_uri> " \
                  "! rtph264depay " \
                  "! tee name=t " \
                  "t. " \
                  "! queue" \
                  "! avdec_h264 " \
                  "! autovideosink " \
                  "t. " \
                  "! queue min-threshold-time=11000000000 name=cam1 " \
                  "! h264parse" \
                  "! shmsink socket-path=/tmp/src wait-for-connection=false
shm-size=10000000"

And,
pipeline2_string = "shmsrc socket-path=/tmp/src"  \
                   "! queue" \
                   "! filesink location=vid.avi"

At other end.

But in such case - pipeline doesn't want to preroll error!

Any other suggestions?

Best regards,
Anton


On Wed, Feb 19, 2020, 12:40 Thornton, Keith <keith.thornton at zeiss.com>
wrote:

> Hi, if you want to dump h264 to an mp4 file for instance try
>
>
>
> Tee --- queue avdec_h264  --- autovideosink
>
>          |--queue (with min-threshold == 11 secs) – h264parse – mp4mux –
> filesink.
>
> If you then set min-threshold to 1 it will empty the queue
>
>
>
> *Von:* gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> *Im
> Auftrag von *Anton Pryima
> *Gesendet:* Mittwoch, 19. Februar 2020 10:16
> *An:* Discussion of the development of and with GStreamer <
> gstreamer-devel at lists.freedesktop.org>
> *Betreff:* Dump 10 seconds of video at once.
>
>
>
> Hello all.
>
>
>
> I need to make program which displays online video from rtsp and then, by
> a command, it dumps 10 seconds of video to the disk (creates playable video
> file).
>
>
>
> I've created working pipeline looking like:
>
> *rtspsrc location=<video_uri> ! rtph264depay ! queue
> min-threshold-time=11000000000 name=n ! avdec_h264 ! autovideosink*
>
>
>
> It has 10 seconds of buffer and working fine.
>
>
>
> Now I need to dump all content of the queue to the disk at once.
>
>
>
> I've tried different methods:
>
> queue2, shmsink, appsink and etc.
>
> But all of them has some disadvantages:
>
>     queue2 - creates temp file on disk during playout. But when I try to
> 'cat' it I'm not getting playable video file. I've tried to pass it as
> filesrc - but this pipeline refuses to start. As I understand queue does
> not store video directly - it has its metadata aside.
>
>     shmsink - socket is created, I've tried to shmcat it - but it doesn't
> work.
>
>     appsink - provides video stream frame by frame, but no whole buffer at
> once.
>
>
>
> So is there is any way to make it with standard GST tools? Or only the way
> it to create appsink callback and save frame by frame to gst.buffer and
> then, when it is needed, dump this buffer to disk with appsrc->filesink?
>
>
>
> Thank you in advance.
>
> Best regards,
>
> Anton.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200219/dec22fda/attachment-0001.htm>


More information about the gstreamer-devel mailing list