Need help for rezising video.

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

Need help for rezising video.

Nicolas-2
Hello,

I have created a plugin that displays a video in an evas image.

Here is my problem:
When I resize the picture I am calling "evas_object_image_fill_set", it
works correctly, however the consumption of CPU is just horrible, more
than 120% !
If I leave it in normal size, the consumption of CPU is normal.

I want to know if there is a way to resize the video (via gstreamer) in
my plugin.
Have you any idea?
May be I could create a function "buffer alloc"
(gstbase_sink_class->buffer_alloc = mybufferalloc) and modify the buffer
in it ?

I know that there is "videoscale" but I do not know how to use it inside
the plugin.

Thank you in advance for your reply,
Sincerely,
Nicolas.

Ps: sorry for bad english.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

lijinshyam
Hi..

   If you are looking for a plugin to resize the image ..i think capsfilter will help you..

Reagrds 
Lijin
 

On Tue, Jan 4, 2011 at 12:29 AM, Nicolas <[hidden email]> wrote:
Hello,

I have created a plugin that displays a video in an evas image.

Here is my problem:
When I resize the picture I am calling "evas_object_image_fill_set", it
works correctly, however the consumption of CPU is just horrible, more
than 120% !
If I leave it in normal size, the consumption of CPU is normal.

I want to know if there is a way to resize the video (via gstreamer) in
my plugin.
Have you any idea?
May be I could create a function "buffer alloc"
(gstbase_sink_class->buffer_alloc = mybufferalloc) and modify the buffer
in it ?

I know that there is "videoscale" but I do not know how to use it inside
the plugin.

Thank you in advance for your reply,
Sincerely,
Nicolas.

Ps: sorry for bad english.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Nicolas-2
In reply to this post by Nicolas-2
Hi Lijin,

Thanks for your reply.

But how capsfilter can help me ?

I only see in the doc:
capsfilter — Pass data without modification, limiting formats

Regards,
Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

rohitratri@gmail.com
You will have to create a capsfilter element and set the relevant caps on it (with the frame size you require). Then follow it up with a video scale element. (...->decoder->capsfilter->videoscale->...->sink)
Check out this doc here -

Its pygst but the concept is the same.

Rohit

On Tue, Jan 4, 2011 at 2:36 AM, Nicolas <[hidden email]> wrote:
Hi Lijin,

Thanks for your reply.

But how capsfilter can help me ?

I only see in the doc:
capsfilter — Pass data without modification, limiting formats

Regards,
Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

lijinshyam
 Hi...

 This is how  i  used the capsfilter

        vflt=gst_element_factory_make("capsfilter","imagefilter");
if(!vflt)
{
g_print("\n Image Filter element could not be created \n");
return 0;
}
g_object_set(G_OBJECT(vflt),"caps",gst_caps_new_simple("image/jpeg",
"width",G_TYPE_INT,320,
"height",G_TYPE_INT,240,
"framerate",GST_TYPE_FRACTION,30,1,
NULL),NULL);
I think this will help you...

On Tue, Jan 4, 2011 at 9:36 AM, Rohit Atri <[hidden email]> wrote:
You will have to create a capsfilter element and set the relevant caps on it (with the frame size you require). Then follow it up with a video scale element. (...->decoder->capsfilter->videoscale->...->sink)
Check out this doc here -

Its pygst but the concept is the same.

Rohit


On Tue, Jan 4, 2011 at 2:36 AM, Nicolas <[hidden email]> wrote:
Hi Lijin,

Thanks for your reply.

But how capsfilter can help me ?

I only see in the doc:
capsfilter — Pass data without modification, limiting formats

Regards,
Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Nicolas-2
In reply to this post by Nicolas-2
Hi,

Thanks for your reply.

Ok, i do:

pipeline = gst_pipeline_new ("pipeline");
playbin = gst_element_factory_make ("playbin2", "playbin");

// Filter
filter = gst_element_factory_make ("capsfilter", "filter");
caps = gst_caps_new_simple ("video/x-raw-yuv", "format",
GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), "width",
G_TYPE_INT, 800, "height", G_TYPE_INT, 600, NULL);
g_object_set ((GObject*) filter, "caps", caps, NULL);

// My sink
sink = gst_element_factory_make ("evasvideosink", "sink");
g_object_set ((GObject*) playbin, "video-sink", sink, NULL); // Tell to
playbin2 to use my sink
g_object_set ((GObject*) playbin, "uri", argv[1], NULL);
g_object_set ((GObject*) sink, "evas-object", video, NULL); // Tell my
sink to use evas image

gst_bin_add_many (GST_BIN (pipeline), playbin, filter, NULL);

gst_element_set_state (pipeline, GST_STATE_PLAYING);

It does not change the size of the video, is this the correct way ?

Thanks in advance for your reply,
Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Timothy Braun
The capsfilter isn't going to do anything for you unless something in the pipeline is able to make the needed changes to match the caps.  Before the capsfilter you should add a videoscale element so it is able to match the requested caps of the filter.  You may also want to take a gander at the ffmpeg_colorspace and videorate elements as well.

As a side note:
You can simplify the creation of the caps with the gst_caps_from_string( "video/x-raw-yuv, format=I420, width=800, height=600") call.
You need to unref the caps when you're done with it as well.

Just my 2c.

Best,
Tim

On Tue, Jan 4, 2011 at 2:02 PM, Nicolas <[hidden email]> wrote:
Hi,

Thanks for your reply.

Ok, i do:

pipeline = gst_pipeline_new ("pipeline");
playbin = gst_element_factory_make ("playbin2", "playbin");

// Filter
filter = gst_element_factory_make ("capsfilter", "filter");
caps = gst_caps_new_simple ("video/x-raw-yuv", "format",
GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), "width",
G_TYPE_INT, 800, "height", G_TYPE_INT, 600, NULL);
g_object_set ((GObject*) filter, "caps", caps, NULL);

// My sink
sink = gst_element_factory_make ("evasvideosink", "sink");
g_object_set ((GObject*) playbin, "video-sink", sink, NULL); // Tell to
playbin2 to use my sink
g_object_set ((GObject*) playbin, "uri", argv[1], NULL);
g_object_set ((GObject*) sink, "evas-object", video, NULL); // Tell my
sink to use evas image

gst_bin_add_many (GST_BIN (pipeline), playbin, filter, NULL);

gst_element_set_state (pipeline, GST_STATE_PLAYING);

It does not change the size of the video, is this the correct way ?

Thanks in advance for your reply,
Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

rohitratri@gmail.com
@Nicolas  

You could use the capsfilter element like this as well - 

caps = gst_caps_new_simple ("video/x-raw-rgb",
                           "bpp", G_TYPE_INT, 24,
                           "depth", G_TYPE_INT, 24,
                           NULL);

gst_element_link_filtered(capsfilter, videosink, caps);  (Considering videoscale element is already linked to capsfilter on to its left.)

instead of doing a gst_object_set()...
 
Of course the choice between the 2 depends on your convenience.

Rohti



On Wed, Jan 5, 2011 at 12:48 AM, Timothy Braun <[hidden email]> wrote:
The capsfilter isn't going to do anything for you unless something in the pipeline is able to make the needed changes to match the caps.  Before the capsfilter you should add a videoscale element so it is able to match the requested caps of the filter.  You may also want to take a gander at the ffmpeg_colorspace and videorate elements as well.

As a side note:
You can simplify the creation of the caps with the gst_caps_from_string( "video/x-raw-yuv, format=I420, width=800, height=600") call.
You need to unref the caps when you're done with it as well.

Just my 2c.

Best,
Tim

On Tue, Jan 4, 2011 at 2:02 PM, Nicolas <[hidden email]> wrote:
Hi,

Thanks for your reply.

Ok, i do:

pipeline = gst_pipeline_new ("pipeline");
playbin = gst_element_factory_make ("playbin2", "playbin");

// Filter
filter = gst_element_factory_make ("capsfilter", "filter");
caps = gst_caps_new_simple ("video/x-raw-yuv", "format",
GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), "width",
G_TYPE_INT, 800, "height", G_TYPE_INT, 600, NULL);
g_object_set ((GObject*) filter, "caps", caps, NULL);

// My sink
sink = gst_element_factory_make ("evasvideosink", "sink");
g_object_set ((GObject*) playbin, "video-sink", sink, NULL); // Tell to
playbin2 to use my sink
g_object_set ((GObject*) playbin, "uri", argv[1], NULL);
g_object_set ((GObject*) sink, "evas-object", video, NULL); // Tell my
sink to use evas image

gst_bin_add_many (GST_BIN (pipeline), playbin, filter, NULL);

gst_element_set_state (pipeline, GST_STATE_PLAYING);

It does not change the size of the video, is this the correct way ?

Thanks in advance for your reply,
Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

rohitratri@gmail.com
Sorry typo - change the caps string to suit your needs.

On Wed, Jan 5, 2011 at 9:34 AM, Rohit Atri <[hidden email]> wrote:
@Nicolas  

You could use the capsfilter element like this as well - 

caps = gst_caps_new_simple ("video/x-raw-rgb",
                           "bpp", G_TYPE_INT, 24,
                           "depth", G_TYPE_INT, 24,
                           NULL);

gst_element_link_filtered(capsfilter, videosink, caps);  (Considering videoscale element is already linked to capsfilter on to its left.)

instead of doing a gst_object_set()...
 
Of course the choice between the 2 depends on your convenience.

Rohti



On Wed, Jan 5, 2011 at 12:48 AM, Timothy Braun <[hidden email]> wrote:
The capsfilter isn't going to do anything for you unless something in the pipeline is able to make the needed changes to match the caps.  Before the capsfilter you should add a videoscale element so it is able to match the requested caps of the filter.  You may also want to take a gander at the ffmpeg_colorspace and videorate elements as well.

As a side note:
You can simplify the creation of the caps with the gst_caps_from_string( "video/x-raw-yuv, format=I420, width=800, height=600") call.
You need to unref the caps when you're done with it as well.

Just my 2c.

Best,
Tim

On Tue, Jan 4, 2011 at 2:02 PM, Nicolas <[hidden email]> wrote:
Hi,

Thanks for your reply.

Ok, i do:

pipeline = gst_pipeline_new ("pipeline");
playbin = gst_element_factory_make ("playbin2", "playbin");

// Filter
filter = gst_element_factory_make ("capsfilter", "filter");
caps = gst_caps_new_simple ("video/x-raw-yuv", "format",
GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), "width",
G_TYPE_INT, 800, "height", G_TYPE_INT, 600, NULL);
g_object_set ((GObject*) filter, "caps", caps, NULL);

// My sink
sink = gst_element_factory_make ("evasvideosink", "sink");
g_object_set ((GObject*) playbin, "video-sink", sink, NULL); // Tell to
playbin2 to use my sink
g_object_set ((GObject*) playbin, "uri", argv[1], NULL);
g_object_set ((GObject*) sink, "evas-object", video, NULL); // Tell my
sink to use evas image

gst_bin_add_many (GST_BIN (pipeline), playbin, filter, NULL);

gst_element_set_state (pipeline, GST_STATE_PLAYING);

It does not change the size of the video, is this the correct way ?

Thanks in advance for your reply,
Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Nicolas-2
In reply to this post by Nicolas-2
Hi,

Thanks everyone for your reply.

Can you send me your pipeline (in C or Python), because mine does not work ?

Thanks in advance,
Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Edward Hervey
Administrator
On Wed, 2011-01-05 at 18:34 +0100, Nicolas wrote:
> Hi,
>
> Thanks everyone for your reply.
>
> Can you send me your pipeline (in C or Python), because mine does not work ?

  The changes of getting a response would be exponentially higher if you
were to actually provide *your* pipeline.

   Edward

>
> Thanks in advance,
> Nicolas.
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Nicolas-2
In reply to this post by Nicolas-2
Hi,

In fact, i made a new pipeline just for testing and my problem is, i
don't know what to link together !
In the code below nothing append, no message (gst-launch sample work
perfectly).

#include <gst/gst.h>

// Build with gcc test.c `pkg-config --cflags --libs gstreamer-0.10
glib-2.0` -o test
// gst-launch filesrc location="/home/niko/jour1.avi" ! decodebin !
videoscale ! capsfilter
caps=video/x-raw-yuv,width=800,height=600,framerate=30/1 !
ffmpegcolorspace ! ximagesink

int
main (int   argc,
       char *argv[])
{
   GMainLoop *loop;
   GstElement *pipeline, *source, *decode, *scale, *filter, *color, *sink;
   GstCaps *caps;

   gst_init (&argc, &argv);
   loop = g_main_loop_new (NULL, FALSE);


   pipeline = gst_pipeline_new ("test_pipeline");

   source = gst_element_factory_make ("filesrc", "source");
   g_object_set ((GObject*) source, "location", "/home/niko/jour1.avi",
NULL);

   decode = gst_element_factory_make ("decodebin", "decode");
   scale = gst_element_factory_make ("videoscale", "scale");

   filter = gst_element_factory_make ("capsfilter", "filter");
   caps = gst_caps_new_simple ("video/x-raw-yuv", "format",
GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), "width",
G_TYPE_INT, 800, "height", G_TYPE_INT, 600, "framerate",
GST_TYPE_FRACTION, 30, 1, NULL);
   g_object_set ((GObject*) filter, "caps", caps, NULL);
   gst_caps_unref(caps);

   color = gst_element_factory_make ("ffmpegcolorspace", "color");
   sink = gst_element_factory_make ("ximagesink", "output");

   gst_bin_add_many (GST_BIN (pipeline), source, scale, filter, color,
sink, NULL);

   gst_element_link_many(source, scale, filter, color, sink, NULL);

   gst_element_set_state (pipeline, GST_STATE_PLAYING);

   g_main_loop_run (loop);

   gst_element_set_state (pipeline, GST_STATE_NULL);
   gst_object_unref (GST_OBJECT (pipeline));
   return 0;
}

Thanks in advance for you help.
Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Timothy Braun
You always want to check the return result from any of the link calls.  Also, to link the decodebin you have to listen for the pad-added (or is it new-decoded-pad, I can't recall) and link when it's available.  It won't be available until the decodebin has setup the decoders and such.

-Tim

On Wed, Jan 5, 2011 at 1:50 PM, Nicolas <[hidden email]> wrote:
Hi,

In fact, i made a new pipeline just for testing and my problem is, i
don't know what to link together !
In the code below nothing append, no message (gst-launch sample work
perfectly).

#include <gst/gst.h>

// Build with gcc test.c `pkg-config --cflags --libs gstreamer-0.10
glib-2.0` -o test
// gst-launch filesrc location="/home/niko/jour1.avi" ! decodebin !
videoscale ! capsfilter
caps=video/x-raw-yuv,width=800,height=600,framerate=30/1 !
ffmpegcolorspace ! ximagesink

int
main (int   argc,
      char *argv[])
{
  GMainLoop *loop;
  GstElement *pipeline, *source, *decode, *scale, *filter, *color, *sink;
  GstCaps *caps;

  gst_init (&argc, &argv);
  loop = g_main_loop_new (NULL, FALSE);


  pipeline = gst_pipeline_new ("test_pipeline");

  source = gst_element_factory_make ("filesrc", "source");
  g_object_set ((GObject*) source, "location", "/home/niko/jour1.avi",
NULL);

  decode = gst_element_factory_make ("decodebin", "decode");
  scale = gst_element_factory_make ("videoscale", "scale");

  filter = gst_element_factory_make ("capsfilter", "filter");
  caps = gst_caps_new_simple ("video/x-raw-yuv", "format",
GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), "width",
G_TYPE_INT, 800, "height", G_TYPE_INT, 600, "framerate",
GST_TYPE_FRACTION, 30, 1, NULL);
  g_object_set ((GObject*) filter, "caps", caps, NULL);
  gst_caps_unref(caps);

  color = gst_element_factory_make ("ffmpegcolorspace", "color");
  sink = gst_element_factory_make ("ximagesink", "output");

  gst_bin_add_many (GST_BIN (pipeline), source, scale, filter, color,
sink, NULL);

  gst_element_link_many(source, scale, filter, color, sink, NULL);

  gst_element_set_state (pipeline, GST_STATE_PLAYING);

  g_main_loop_run (loop);

  gst_element_set_state (pipeline, GST_STATE_NULL);
  gst_object_unref (GST_OBJECT (pipeline));
  return 0;
}

Thanks in advance for you help.
Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Vincent Torri
In reply to this post by Nicolas-2


On Wed, 5 Jan 2011, Nicolas wrote:

> Hi,
>
> In fact, i made a new pipeline just for testing and my problem is, i
> don't know what to link together !
> In the code below nothing append, no message (gst-launch sample work
> perfectly).
>
> #include <gst/gst.h>
>
> // Build with gcc test.c `pkg-config --cflags --libs gstreamer-0.10
> glib-2.0` -o test
> // gst-launch filesrc location="/home/niko/jour1.avi" ! decodebin !
> videoscale ! capsfilter
> caps=video/x-raw-yuv,width=800,height=600,framerate=30/1 !
> ffmpegcolorspace ! ximagesink
>
> int
> main (int   argc,
>       char *argv[])
> {
>   GMainLoop *loop;
>   GstElement *pipeline, *source, *decode, *scale, *filter, *color, *sink;
>   GstCaps *caps;
>
>   gst_init (&argc, &argv);
>   loop = g_main_loop_new (NULL, FALSE);
>
>
>   pipeline = gst_pipeline_new ("test_pipeline");
>
>   source = gst_element_factory_make ("filesrc", "source");
>   g_object_set ((GObject*) source, "location", "/home/niko/jour1.avi",
> NULL);
>
>   decode = gst_element_factory_make ("decodebin", "decode");
>   scale = gst_element_factory_make ("videoscale", "scale");
>
>   filter = gst_element_factory_make ("capsfilter", "filter");
>   caps = gst_caps_new_simple ("video/x-raw-yuv", "format",
> GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I', '4', '2', '0'), "width",
> G_TYPE_INT, 800, "height", G_TYPE_INT, 600, "framerate",
> GST_TYPE_FRACTION, 30, 1, NULL);
>   g_object_set ((GObject*) filter, "caps", caps, NULL);
>   gst_caps_unref(caps);
>
>   color = gst_element_factory_make ("ffmpegcolorspace", "color");
>   sink = gst_element_factory_make ("ximagesink", "output");
>
>   gst_bin_add_many (GST_BIN (pipeline), source, scale, filter, color,
> sink, NULL);

strangely, there is no 'decode' element here :)

Vincent

>
>   gst_element_link_many(source, scale, filter, color, sink, NULL);
>
>   gst_element_set_state (pipeline, GST_STATE_PLAYING);
>
>   g_main_loop_run (loop);
>
>   gst_element_set_state (pipeline, GST_STATE_NULL);
>   gst_object_unref (GST_OBJECT (pipeline));
>   return 0;
> }
>
> Thanks in advance for you help.
> Nicolas.
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Nicolas-2
In reply to this post by Nicolas-2
Hi Vincent,

It does not change anything if i add it ! :)

Nicolas.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Vincent Torri


On Wed, 5 Jan 2011, Nicolas wrote:

> Hi Vincent,
>
> It does not change anything if i add it ! :)

iirc, you set the source and decodebin, link them, then you pause the
pipeline. You itrerate over the pad (that were added during the preroll).
You then link your sink in the correct pad. See emotion before i
implemented the pipeline with playbin2

Vincent

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Edward Hervey
Administrator
In reply to this post by Nicolas-2
On Wed, 2011-01-05 at 20:38 +0100, Nicolas wrote:
> Hi Vincent,
>
> It does not change anything if i add it ! :)

  Could you please stop replying every time to the mail thread with a
new standalone mail ? Learn how to use the reply-to-all feature of your
mail client. Or switch mail client.

   Edward

>
> Nicolas.
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Stefan Sauer
In reply to this post by lijinshyam
Am 03.01.2011 22:03, schrieb liJin:
> Hi..
>
>    If you are looking for a plugin to resize the image ..i think capsfilter will
> help you..

capsfilter could be used to constrain caps. As nicolas noticed videoscale whould
be the right choise. Nicals, just put videoscale infront of your videosink.

Stefan

>
> Reagrds
> Lijin
>  
>
> On Tue, Jan 4, 2011 at 12:29 AM, Nicolas <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hello,
>
>     I have created a plugin that displays a video in an evas image.
>
>     Here is my problem:
>     When I resize the picture I am calling "evas_object_image_fill_set", it
>     works correctly, however the consumption of CPU is just horrible, more
>     than 120% !
>     If I leave it in normal size, the consumption of CPU is normal.
>
>     I want to know if there is a way to resize the video (via gstreamer) in
>     my plugin.
>     Have you any idea?
>     May be I could create a function "buffer alloc"
>     (gstbase_sink_class->buffer_alloc = mybufferalloc) and modify the buffer
>     in it ?
>
>     I know that there is "videoscale" but I do not know how to use it inside
>     the plugin.
>
>     Thank you in advance for your reply,
>     Sincerely,
>     Nicolas.
>
>     Ps: sorry for bad english.
>
>     ------------------------------------------------------------------------------
>     Learn how Oracle Real Application Clusters (RAC) One Node allows customers
>     to consolidate database storage, standardize their database environment, and,
>     should the need arise, upgrade to a full multi-node Oracle RAC database
>     without downtime or disruption
>     http://p.sf.net/sfu/oracle-sfdevnl
>     _______________________________________________
>     gstreamer-devel mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
>
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Need help for rezising video.

Stefan Sauer
In reply to this post by Nicolas-2
Am 03.01.2011 23:06, schrieb Nicolas:
> Hi Lijin,
>
> Thanks for your reply.
>
> But how capsfilter can help me ?
>
> I only see in the doc:
> capsfilter — Pass data without modification, limiting formats

Nicolas. forget about the capsfilter. The videodecoder is ouputing a certain
size and you want it to be scaled to the size of your evas widget. Just add a
videoscale between the decoder and the evassink and when the window is resized
set update your caps. Have a look at ximagesink (this won't resize itself as
well and relies on videoscale).

Stefan

>
> Regards,
> Nicolas.
>
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and,
> should the need arise, upgrade to a full multi-node Oracle RAC database
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to
best implement a security strategy that keeps consumers' information secure
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel