Video processing(record\play) real time from camera with metadata

Mikl michael.yarochkin at timetronics.be
Mon Sep 19 13:10:59 UTC 2016


Hello, Tim


I have a question about memory management.


Almost all functions returning pointer: for example gst_element_factory_make();


Do i need to "delete" it after i don`t need it?

Will you also have time to explain why?


My question in c++ code:


v1:

class Recorder

{

GstElement* _pipeline = nullptr;


  void Start()

{

if(_pipeline !=nullptr) delete _pipeline ;


 _pipeline = gst_pipeline_new("VideoRecorder");


//some code

}

}


v2:

class Recorder

{

GstElement* _pipeline;


  void Start()

{

_pipeline = gst_pipeline_new("VideoRecorder");


//some code

}

}



v3:

class Recorder

{

  void Start()

{


 GstElement* _pipeline = gst_pipeline_new("VideoRecorder");


//some code

}

}


Best regards, Michael.
________________________________
From: Tim Müller [via GStreamer-devel] <ml-node+s966125n4679636h65 at n4.nabble.com>
Sent: Friday, September 16, 2016 6:19:47 PM
To: Michael Yarochkin
Subject: Re: Video processing(record\play) real time from camera with metadata

On Fri, 2016-09-16 at 06:49 -0700, Mikl wrote:

Hi,

> For the moment i am doing only video and from test source.
> Here is my pipeline
> videotestsrc ! video/x-
> raw,format=RGB,width=800,height=400,framerate=24/1 ! matroskamux
> ! filesink location=c:\gstreamer\test.mkv
> I have file. It have size (big one). I can see structure
> using MKVToolNix.
> videotestsrc  will be replaced by appsrc.  And i will not
> need capsfilter anymore.
>
> But:
> -i can not play it
> -see no information

Yes, it will be very big, because you are storing raw (unencoded) video
frames in the file. If you want to encode them, add a x264enc (for
example) before matroskamux.


> Even when i did simple pipeline
> videotestsrc ! avimux ! filesink location=c:\gstreamer\test.avi
> i was not able to see information about video, navigate in video.
> And it was opened not in all players.

I suspect not all players will be able to handle raw video in AVI.
Also, if you use gst-launch-1.0 (or your own app) you will need to make
sure that you shut down the pipeline 'cleanly', so that the muxer has
an opportunity to finalise the file properly (write indices, fix up the
header, etc.). In gst-launch-1.0 you do that by passing the -e command
line option, or using videotestsrc num-buffers=100 or such. In your
application you would have to send an EOS event on the pipeline with
gst_element_send_event(pipeline, gst_event_new_eos()) and then wait for
an EOS message on the bus before shutting down the pipeline with
gst_element_set_state().

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
10-11 October 2016 in Berlin,
Germany
http://gstreamer.freedesktop.org/conference/


_______________________________________________
gstreamer-devel mailing list
[hidden email]</user/SendEmail.jtp?type=node&node=4679636&i=0>
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


________________________________
If you reply to this email, your message will be added to the discussion below:
http://gstreamer-devel.966125.n4.nabble.com/Video-processing-record-play-real-time-from-camera-with-metadata-tp4679305p4679636.html
To unsubscribe from Video processing(record\play) real time from camera with metadata, click here<http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4679305&code=bWljaGFlbC55YXJvY2hraW5AdGltZXRyb25pY3MuYmV8NDY3OTMwNXwyMDkyNzIxODU=>.
NAML<http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Video-processing-record-play-real-time-from-camera-with-metadata-tp4679305p4679650.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160919/3377b9bf/attachment.html>


More information about the gstreamer-devel mailing list