Regarding preevent

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Regarding preevent

Shilpa Chandrappa
Hi,

Is it possible to implement circluar buffer in gstreamer to store 60 seconds video data continuously. During an event trigger I need to prepend the circular buffer data with the incoming video data and store in a file.

I saw a thread which mentions using 'queue' we can achieve this. So I tried below approach.

 gst_parse_launch ("rtspsrc location=rtsp://172.22.75.2/live.sdp name=rtsp !  queue min-threshold-time=60000000000 name=que12 ! valve drop=true name=val12 !  rtph264depay ! video/x-h264, width=1920, height=1080, framerate=30/1  ! avimux name=avi !  filesink location=rtsp.avi", &error);

 During an event trigger I am setting the below properties.

g_object_set (G_OBJECT (val2), "drop",false, NULL);
g_object_set (G_OBJECT (que2), "min-threshold-time",(gint64)0, NULL);

With this approach I am not able to see creation of preevent video of 60seconds(prepended) in the recorded file rtsp.avi.

Is there anything which I am missing ?

I request you to provide inputs on how to achieve this.

Regards,
Shilpa



Reply | Threaded
Open this post in threaded view
|

AW: Regarding preevent

Thornton, Keith
I did something similar with a queue and a valve. In c it looked like this

        m_delayQueue = gst_element_factory_make("queue", "DelayQueue");
        gst_object_ref(GST_OBJECT(m_delayQueue));
       g_object_set(G_OBJECT(m_delayQueue), "min-threshold-buffers", 30, (char *)NULL);
        g_object_set(G_OBJECT(m_delayQueue), "min-threshold-bytes", 0, (char *)NULL);
        g_object_set(G_OBJECT(m_delayQueue), "min-threshold-time", (gint64)0, (char *)NULL);
        g_object_set(G_OBJECT(m_delayQueue), "max-size-buffers", 31, (char *)NULL);
        g_object_set(G_OBJECT(m_delayQueue), "max-size-bytes", 0, (char *)NULL);
        g_object_set(G_OBJECT(m_delayQueue), "max-size-time", (gint64)0, (char *)NULL);

        m_delayValve = gst_element_factory_make("valve", "DelayValve");
        gst_object_ref(GST_OBJECT(m_delayValve));
        g_object_set(G_OBJECT(m_delayValve), "drop", TRUE, (char *)NULL);

initially I stored 30 seconds of video (30 GOPS) and then started to drop the oldest.
I then switched it into athe file by re-configuring the following

    g_object_set(G_OBJECT(m_delayValve), "drop", FALSE, (char *)NULL);
    g_object_set(G_OBJECT(m_delayQueue), "min-threshold-buffers", 0, (char *)NULL);

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]] Im Auftrag von Shilpa Chandrappa
Gesendet: Montag, 17. März 2014 12:34
An: [hidden email]
Betreff: Regarding preevent

Hi,

Is it possible to implement circluar buffer in gstreamer to store 60 seconds video data continuously. During an event trigger I need to prepend the circular buffer data with the incoming video data and store in a file.

I saw a thread which mentions using 'queue' we can achieve this. So I tried below approach.

 gst_parse_launch ("rtspsrc location=rtsp://172.22.75.2/live.sdp name=rtsp !
*queue min-threshold-time=60000000000 name=que12 ! valve drop=true
name=val12* !  rtph264depay ! video/x-h264, width=1920, height=1080,
framerate=30/1  ! avimux name=avi !  filesink location=*rtsp.avi*", &error);

 During an event trigger I am setting the below properties.

g_object_set (G_OBJECT (val2), "drop",false, NULL); g_object_set (G_OBJECT (que2), "min-threshold-time",(gint64)0, NULL);

With this approach I am *not able* to see creation of preevent video of
60seconds(prepended) in the recorded file rtsp.avi.

Is there anything which I am missing ?

I request you to provide inputs on how to achieve this.

Regards,
Shilpa







--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Regarding-preevent-tp4665983.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

---------------
This message is intended for a particular addressee only and may contain business or company secrets.
If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Regarding preevent

jlemmetti
In reply to this post by Shilpa Chandrappa
Hello,

It seems like you do not set max-size-buffers (default 200), max-size-bytes (default 10 MB) or max-size-time (default 1 second). I guess that in your case the 1 second limit is reached and after that the queue is not considered empty and it no longer stores buffers. You can check this by checking current-level-buffers or current-level-time when the event is triggered.

Regards,

 Juha L

Shilpa Chandrappa wrote
 gst_parse_launch ("rtspsrc location=rtsp://172.22.75.2/live.sdp name=rtsp !  queue min-threshold-time=60000000000 name=que12 ! valve drop=true name=val12 !  rtph264depay ! video/x-h264, width=1920, height=1080, framerate=30/1  ! avimux name=avi !  filesink location=rtsp.avi", &error);
Reply | Threaded
Open this post in threaded view
|

Re: Regarding preevent

Shilpa Chandrappa
Thank you both of you.

Setting "min-threshold-time=60000000000 min-threshold-buffers=0 min-threshold-bytes=0 max-size-bytes=0 max-size-buffers=0 max-size-time=60000000000"  parameters before preevent helped me achieve it.