gst-launch: how to resize the video screen and play

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

gst-launch: how to resize the video screen and play

Jump to solution
26,392 Views
Swamy
Contributor III

Hi,

I would like to resize the video screen to height=400, width=700, x=0, y=40. Please tell me how to do it using the gst-launch.

I tried the following command but did not work for me.

gst-launch playbin2 uri=file://var/youtube.mp4 video-sink='mfw_isink disp-width=700 disp-height=400 axis-top=40 axis-left=0'

Please help.

Regards,

Swamy


Labels (3)
1 Solution
10,496 Views
daiane_angolini
NXP Employee
NXP Employee

Sorry for delay.

I tried to figure out if there is any missing framebuffer configuration but I was not able to find it.

I would suggest you to dig into mfw_v4lsink (or even mfw_isink) in order to see if there is any piece of code that would resize only one frame buffer.

For example, if mfw_v4lsink resize only fb0 and it´s hardcoded, and you use fb1. So needs to change it.

I hope someone else can point you a better approach.

View solution in original post

0 Kudos
14 Replies
10,497 Views
daiane_angolini
NXP Employee
NXP Employee

Sorry for delay.

I tried to figure out if there is any missing framebuffer configuration but I was not able to find it.

I would suggest you to dig into mfw_v4lsink (or even mfw_isink) in order to see if there is any piece of code that would resize only one frame buffer.

For example, if mfw_v4lsink resize only fb0 and it´s hardcoded, and you use fb1. So needs to change it.

I hope someone else can point you a better approach.

0 Kudos
10,496 Views
Swamy
Contributor III

Yes, Even I copied the gplay binary and its related library built on customized IMX535 board to the IMX53QSB and it found to be working as shown by you.

But somehow the same stuff is not working in the custom board, it is resizing to 800x480...Is it because of the video or fb0 needs to be reconfigured somewhere else in the code to suit the changes?

Regards

Swamy

0 Kudos
10,496 Views
daiane_angolini
NXP Employee
NXP Employee

How did you configured your new framebuffer device? On board file? (arch/arm/mach-mx5/your_board.c)

0 Kudos
10,496 Views
Swamy
Contributor III

static struct fb_videomode video_modes[] = {

     /* NTSC TV output */

     "TV-NTSC", 60, 720, 480, 74074,

     122, 15,

     18, 26,

     1, 1,

     FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT | FB_SYNC_EXT,

     FB_VMODE_INTERLACED,

     0,},

    {

     /* PAL TV output */

     "TV-PAL", 50, 720, 576, 74074,

     132, 11,

     22, 26,

     1, 1,

     FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT | FB_SYNC_EXT,

     FB_VMODE_INTERLACED | FB_VMODE_ODD_FLD_FIRST,

     0,},

    {

     "720P60", 60, 1280, 720, 13468,

     260, 109,

     25, 4,

     1, 1,

     FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT |

   FB_SYNC_EXT,

     FB_VMODE_NONINTERLACED,

     0,},

    {

     /* 800x480 @ 57 Hz , pixel clk @ 27MHz */

     "CLAA-WVGA", 57, 800, 480, 37037, 40, 60, 10, 10, 20, 10,

     FB_SYNC_CLK_LAT_FALL,

     FB_VMODE_NONINTERLACED,

     0,},

    {

    /* 1600x1200 @ 60 Hz 162M pixel clk*/

    "UXGA", 60, 1600, 1200, 6172,

    304, 64,

    1, 46,

    192, 3,

    FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT |

    FB_SYNC_EXT,

    FB_VMODE_NONINTERLACED,

    0,},

    {

     "1080P60", 60, 1920, 1080, 7692,

     100, 40,

     30, 3,

     10, 2,

     FB_SYNC_EXT,

     FB_VMODE_NONINTERLACED,

     0,},

    {

     "XGA", 60, 1024, 768, 15385,

     220, 40,

     21, 7,

     60, 10,

     FB_SYNC_EXT,

     FB_VMODE_NONINTERLACED,

     0,},

    {

    /* refresh,xres,yres,pixclock=1^12/33.2MHz,left_margin,right_margin,upper_margin,lower_margin,hsync_len,vsync_len,sync,vmode,flag */
    "MY_DIS", 60, 800, 480, 30120,
     88, 40,
     31, 10,
     128, 4,
     FB_SYNC_EXT,
     FB_VMODE_NONINTERLACED,
     0,},

};

The last one "MY_DIS" is my configuration..

My display size is 800x480(Main screen), when I click on the video I should display it with this configuration...height=400, width=700, x=0, y=40.

Regards

Swamy

0 Kudos
10,496 Views
jinuthomas
Contributor II

Did you find a solution to this problem ?

I am trying to resize to 320, 240 using this command

gst-launch v4l2src ! 'capture-height=240 capture-width=320' ! mfw_v4lsink

and its displaying on the full screen.

0 Kudos
10,496 Views
daiane_angolini
NXP Employee
NXP Employee

mfw_v4lsink default is full screen.

Please gst-inspect mfw_v4lsink in order to see how to control display size.

(and take a look on the command line I placed here: https://community.freescale.com/message/300759#300759)

0 Kudos
10,496 Views
jinuthomas
Contributor II

This is my gst-inspect element properties output

Element Properties:

  name                : The name of the object

                        flags: readable, writable

                        String. Default: null Current: "mfw_gst_v4lsink_info_t0"

  preroll-queue-len   : Number of buffers to queue during preroll

                        flags: readable, writable

                        Unsigned Integer. Range: 0 - 4294967295 Default: 0 Current: 0

  sync                : Sync on the clock

                        flags: readable, writable

                        Boolean. Default: true Current: true

  max-lateness        : Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited)

                        flags: readable, writable

                        Integer64. Range: -1 - 9223372036854775807 Default: -1 Current: 20000000

  qos                 : Generate Quality-of-Service events upstream

                        flags: readable, writable

                        Boolean. Default: false Current: true

  async               : Go asynchronously to PAUSED

                        flags: readable, writable

                        Boolean. Default: true Current: true

  ts-offset           : Timestamp offset in nanoseconds

                        flags: readable, writable

                        Integer64. Range: -9223372036854775808 - 9223372036854775807 Default: 0 Current: 0

  last-buffer         : The last buffer received in the sink

                        flags: readable

                        MiniObject of type "GstBuffer"

  blocksize           : Size in bytes to pull per buffer (0 = default)

                        flags: readable, writable

                        Unsigned Integer. Range: 0 - 4294967295 Default: 4096 Current: 4096

  render-delay        : Additional render delay of the sink in nanoseconds

                        flags: readable, writable

                        Unsigned Integer64. Range: 0 - -1 Default: 0 Current: 0

  show-preroll-frame  : Whether to render video frames during preroll

                        flags: readable, writable

                        Boolean. Default: true Current: true

  disp-width          : gets the width of the image to be displayed

                        flags: readable, writable

                        Integer. Range: 0 - 2147483647 Default: 0 Current: 0

  disp-height         : gets the height of the image to be displayed

                        flags: readable, writable

                        Integer. Range: 0 - 2147483647 Default: 0 Current: 0

  axis-top            : gets the top co-ordinate of the origin of display

                        flags: readable, writable

                        Integer. Range: 0 - 2147483647 Default: 0 Current: 0

  axis-left           : gets the left co-ordinate of the origin of display

                        flags: readable, writable

                        Integer. Range: 0 - 2147483647 Default: 0 Current: 0

  rotate              : gets the angle at which display is to be rotated

                        flags: readable, writable

                        Integer. Range: 0 - 2147483647 Default: 0 Current: 0

  crop-left-by-pixel  : set the input image cropping in the left (width)

                        flags: readable, writable

                        Integer. Range: 0 - 2147483647 Default: 0 Current: 0

  crop-right-by-pixel : set the input image cropping in the right (width)

                        flags: readable, writable

                        Integer. Range: 0 - 2147483647 Default: 0 Current: 0

  crop-top-by-pixel   : set the input image cropping in the top (height)

                        flags: readable, writable

                        Integer. Range: 0 - 2147483647 Default: 0 Current: 0

  crop-bottom-by-pixel: set the input image cropping in the bottom (height)

                        flags: readable, writable

                        Integer. Range: 0 - 2147483647 Default: 0 Current: 0

  tv-out              : set output to TV-OUT

                        flags: readable, writable

                        Boolean. Default: false Current: false

  tv-mode             : set mode to TV-OUT, 0: NTSC, 1: PAL, 2: 720p

                        flags: readable, writable

                        Integer. Range: 0 - 2 Default: 0 Current: 3

  dump-location       : Location of the file to write cropped video YUV stream.Enable it will output image to file instead of V4L device

                        flags: readable, writable

                        String. Default: null Current: null

  setpara             : set parameter of V4L2, 1: Set V4L 2: Set Color

                        flags: readable, writable

                        Integer. Range: 0 - 3 Default: 0 Current: 0

  force-aspect-ratio  : Force Aspect Ratio

                        flags: readable, writable

                        Boolean. Default: false Current: false

  rendered            : Get the total rendered frames

                        flags: readable

                        Integer. Range: 0 - 2147483647 Default: 0 Current: 0

[1;32m[--->FINALIZE v4l_sink

I tried the command

gst-launch v4l2src  ! mfw_v4lsink disp-width=320 disp-height=240


but my image still displays on full screen 800 *480



can you give me an example how i should edit the command to resize the image to 320*240


and also how should i use the crop elements, because when i try crop-top-by-pixel=240  i get an error in the pipeline

0 Kudos
10,496 Views
daiane_angolini
NXP Employee
NXP Employee

Please, try using the latest BSP.

If you are still not able to make get it working, please, start a new discussion (I think this one is starting to get messed)

If you fell like you can mention me or share it to me.

Thanks

0 Kudos
10,496 Views
LeonardoSandova
Specialist I

One more test: Try using the other Freescale video sink

VSALPHA=1; gst-launch v4l2src ! mfw_isink disp-width=320 disp-height=240

Leo

0 Kudos
10,496 Views
jinuthomas
Contributor II

Yes , this worked, I resorted to this after spending a lot of time with mfw_v4lsink.

I can continue my work , with isink so its ok. But for information sake, is the v4lsink not resizing because of a bug in the old bsp. I am using L2.6.35_11.09.01_ER_source

I tried to edit the plugin but failed to do so.

10,496 Views
daiane_angolini
NXP Employee
NXP Employee

I used the following command line (11.09 BSP + mx53QSB) and I was able to resize and determinate where video area starts.

gst-launch playbin2 uri=file:///home/Ice_Age_Test_Video.mp4 video-sink="mfw_v4lsink disp-width=700  disp-height=400 axis-top=100 axis-left=100"

resize.jpg

0 Kudos
10,496 Views
daiane_angolini
NXP Employee
NXP Employee

It´s for imx53qsb and 11.09?

What do you see with this command line?

0 Kudos
10,496 Views
Swamy
Contributor III

I am not using QSB. I am using IMX536 but it is customized to our project. The following will play the video but will not resize the video. Is something wrong in the command?

This is my output:

$ gst-launch filesrc location=/var/youtube.mp4 ! qtdemux ! queue max-size-time=0 ! mfw_vpudecoder ! mfw_v4lsink disp-width=700 disp-height=300

(gst-plugin-scanner:585): GLib-GObject-WARNING **: cannot register existing type `GstRTPMux'

(gst-plugin-scanner:585): GStreamer-CRITICAL **: gst_element_register: assertion `g_type_is_a (type, GST_TYPE_ELEMENT)' failed

(gst-plugin-scanner:585): GLib-GObject-WARNING **: cannot register existing type `GstRtpSsrcDemux'

(gst-plugin-scanner:585): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed

(gst-plugin-scanner:585): GStreamer-CRITICAL **: gst_element_register: assertion `g_type_is_a (type, GST_TYPE_ELEMENT)' failed

MFW_GST_V4LSINK_PLUGIN 2.0.3 build on Sep 13 2012 15:59:37.

Setting pipeline to PAUSED ...

[INFO]  Product Info: i.MX53

VPU Version: firmware 13.4.0; libvpu: 5.1.4

MFW_GST_VPU_DECODER_PLUGIN 2.0.3 build on Sep 13 2012 12:44:14.

Pipeline is PREROLLING ...

>>V4L_SINK: Actually buffer status:

        hardware buffer : 9

        software buffer : 0

Pipeline is PREROLLED ...

Setting pipeline to PLAYING ...

full screen size:800x480

[V4L Update Display]: left=0, top=0, width=696, height=296

New clock: GstSystemClock

^CCaught interrupt -- handling interrupt.

Interrupt: Stopping pipeline ...

Execution ended after 6011361075 ns.

Setting pipeline to PAUSED ...

total time:0:00:06.013819574 ,Render fps:29

Setting pipeline to READY ...

Setting pipeline to NULL ...

Total rendered:180

>>VPU_DEC: State: Ready to Null

Freeing pipeline ...

[--->FINALIZE v4l_sink

[--->FINALIZE vpu_dec


0 Kudos
10,496 Views
daiane_angolini
NXP Employee
NXP Employee

I will give it a try on my QSB. I´m looking for my VGA cable.

Should update until the end of the day

0 Kudos