The TIVidenc1 has worked!<div><br></div><div>I do get a feel now as to what direction I need to head in to complete this application.</div><div>So I see this part of the exercise as recreating what it is on gst-launch as it is.</div>
<div><br></div><div>Your support has been of great help and is much appreciated.</div><div><br></div><div>Thanks a ton</div><div>N.Kartik<br><br><div class="gmail_quote">On Tue, Sep 4, 2012 at 2:55 PM, Jean-Michel Hautbois <span dir="ltr"><<a href="mailto:jhautbois@gmail.com" target="_blank">jhautbois@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, you have to reproduce exactly the same launch line...<br>
You have the following elements :<br>
v4l2src<br>
TIVidenc1<br>
filesink<br>
<br>
You need to name them exactly the same way.<br>
<div class="im">enc = gst_element_factory_make("TIVidenc", "enc");<br>
</div>==> should be enc = gst_element_factory_make("TIVidenc1", "enc");<br>
<br>
If you want to make rtp send, this is ok.<br>
But don't forget to specify the properties of your objects too...<br>
<br>
g_object_set (G_OBJECT (enc), "codecName", "h264enc", "engineName",<br>
"codecServer", NULL);<br>
<br>
And you need to use caps in order to specify your v4l2src element...<br>
<br>
You can also use gst_parse_launch() which will help you a lot.<br>
It can parse your line like gst-launch does, and you can get an<br>
element using its name if you want to modify some properties (the IP<br>
adress for instance).<br>
<br>
When you test your program, you can launch it with GST_DEBUG : this<br>
will tell you what is wrong :<br>
<br>
$> GST_DEBUG=3 ./gstream<br>
<br>
Happy hacking !<br>
<div class="HOEnZb"><div class="h5">JM<br>
<br>
2012/9/4 kartik natarajan <<a href="mailto:kartik8n8@gmail.com">kartik8n8@gmail.com</a>>:<br>
> Sure, here it is. Thanks for your cooperation<br>
><br>
> This works<br>
><br>
> gst-launch -v 'v4l2src always-copy=FALSE num-buffers=800 input-src=composite<br>
> ! video/x-raw-yuv, format=\(fourcc\)NV12, width=720, height=480 ! TIVidenc1<br>
> codecName=h264enc engineName=codecServer !filesink location=/home/gr8.264'<br>
><br>
><br>
><br>
> #include <gst/gst.h><br>
><br>
> #include<glib.h><br>
><br>
><br>
> #define STATIC_IP "127.0.0.1"<br>
><br>
><br>
> int main(int argc, char *argv[])<br>
><br>
> {<br>
><br>
>         GMainLoop *loop;<br>
><br>
><br>
><br>
>         GstElement *pline, *src, *enc,*pay, *sink;<br>
><br>
>         GstBus *bus;<br>
><br>
>         guint major,minor, micro, nano;<br>
><br>
><br>
><br>
>         gst_init(&argc, &argv);<br>
><br>
>         gst_version(&major, &minor,&micro, &nano);<br>
><br>
>         printf("gstreamer version: %d.%d.%d",major,minor,micro);<br>
><br>
>         loop = g_main_loop_new(NULL, FALSE);<br>
><br>
> pline = gst_pipeline_new ("Ossler video");<br>
><br>
>         if(!pline)<br>
><br>
>         g_printerr("\npipeline creation failed\n");<br>
><br>
>         else<br>
><br>
>         g_print("\npipeline created\n");<br>
><br>
>         src = gst_element_factory_make("v4lsrc", "src");<br>
><br>
>         if(!src)<br>
><br>
>         g_printerr("\nsrc creation failed\n");<br>
><br>
>         else<br>
><br>
>         g_print("\nv4lsrc created\n");<br>
><br>
>         //********************************************************<br>
><br>
>         enc = gst_element_factory_make("TIVidenc", "enc");<br>
><br>
>         if(!enc)<br>
><br>
>         g_printerr("\nencoder TI-Video enc creation failed\n");<br>
><br>
>         else<br>
><br>
>         g_print("\n264 encoder created\n");<br>
><br>
>         g_assert(enc);<br>
><br>
> //      g_object_set();<br>
><br>
>         //**************************************************************<br>
><br>
>         sink = gst_element_factory_make("udpsink", "sink");<br>
><br>
>         if(!sink)<br>
><br>
>         g_printerr("\nudp sink creation failed\n");<br>
><br>
>           else<br>
><br>
>         g_print("\nudp sink created\n");<br>
><br>
>         g_assert(sink);<br>
><br>
>         g_object_set (sink, "port", 1234, "host", STATIC_IP, NULL);<br>
><br>
><br>
><br>
>        pay = gst_element_factory_make("rtph264pay", "my264pay");<br>
><br>
>         if(!sink)<br>
><br>
>         g_printerr("\npayload element creation failed\n");<br>
><br>
>         else<br>
><br>
>         g_print("\n payloader created\n");<br>
><br>
><br>
><br>
>         //**********************add all in<br>
> bin*********************************<br>
><br>
>         gst_bin_add_many(GST_BIN(pline),src,enc,pay,sink,NULL);<br>
><br>
><br>
><br>
><br>
><br>
>         //*********************link<br>
> them***************************************<br>
><br>
>         gst_element_link_many(src,enc,pay,sink,NULL);<br>
><br>
><br>
><br>
><br>
><br>
><br>
> //*********************cleanup***************************************<br>
><br>
>         gst_element_set_state(pline,GST_STATE_NULL);<br>
><br>
> //      gst_object_unref(pline);<br>
><br>
> //      gst_main_loop_unref(loop);<br>
><br>
>         return 0;<br>
><br>
>         }<br>
><br>
><br>
> I am compiling this code with this<br>
><br>
> arm-none-linux-gnueabi-gcc -o gstream gstream.c -lz `pkg-config --cflags<br>
> --libs gstreamer-0.10`<br>
><br>
><br>
> I tried this too..<br>
><br>
> arm-none-linux-gnueabi-gcc -o gstream gstream.c -lz  -L $(LIB)/ `pkg-config<br>
> --cflags --libs gstreamer-0.10`<br>
><br>
>   [where LIB is the path where the libgstticodec.so library is for the<br>
> TIVidEnc is]<br>
><br>
><br>
><br>
><br>
><br>
> N.Kartik<br>
><br>
><br>
> On Tue, Sep 4, 2012 at 2:22 PM, Jean-Michel Hautbois <<a href="mailto:jhautbois@gmail.com">jhautbois@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Well, in order to go further, we will need more information, a paste<br>
>> of a part of your code, and a GST_DEBUG output for instance.<br>
>> Can you paste your gst-launch line too ?<br>
>><br>
>> JM<br>
>><br>
>> 2012/9/4 kartik natarajan <<a href="mailto:kartik8n8@gmail.com">kartik8n8@gmail.com</a>>:<br>
>> > Thanks for your response.<br>
>> > The TIVidEnc seems to fail too.<br>
>> > Any suggestions?<br>
>> > I am developing the gstreamer app using the same like only.<br>
>> > I figured the elements I would need and have done a simple factory make,<br>
>> > only the encoder seems to fail.<br>
>> ><br>
>> ><br>
>> > On Tue, Sep 4, 2012 at 1:19 PM, Jean-Michel Hautbois<br>
>> > <<a href="mailto:jhautbois@gmail.com">jhautbois@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> Hi,<br>
>> >><br>
>> >> Your element should not be x264enc, but TIVidEnc :<br>
>> >>  enc = gst_element_factory_make("x264enc", "encoder");<br>
>> >> Then, you can set its properties using g_object_set();<br>
>> >><br>
>> >> If you did not read it, please take a look at this documentation :<br>
>> >><br>
>> >><br>
>> >> <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/index.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/index.html</a><br>
>> >><br>
>> >> Regards,<br>
>> >> JM<br>
>> >><br>
>> >> 2012/9/4 kartik natarajan <<a href="mailto:kartik8n8@gmail.com">kartik8n8@gmail.com</a>>:<br>
>> >> > Hi,<br>
>> >> >     DVSDK on DM365, developing a gstreamer app to encode raw images<br>
>> >> > into<br>
>> >> > h.264 and store in file.<br>
>> >> >  I have been able to execute a gst-launch where I provide<br>
>> >> > codecName=h264enc<br>
>> >> > to encode raw video and store it in a file. This works well.<br>
>> >> > Now I build an application on gstreamer.<br>
>> >> > I have tried doing enc = gst_element_factory_make("x264enc",<br>
>> >> > "encoder");<br>
>> >> > but it fails with enc getting a NULL. I tried "h264enc" and morbidly<br>
>> >> > did<br>
>> >> > "GstX264Enc" as well for the factory name but they failed too.<br>
>> >> > How do I get this going ahead?<br>
>> >> ><br>
>> >> > Thanks in advance<br>
>> >> ><br>
>> >> > N.Kartik<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="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><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="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Believe in your dreams, they have a strange way of coming true!!!<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="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><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="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Believe in your dreams, they have a strange way of coming true!!!<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="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><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="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Believe in your dreams, they have a strange way of coming true!!!<br>
</div>