Streaming rescaled videos

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

Streaming rescaled videos

1,144 Views
swroch
Contributor I

Hello,

I am trying to stream rescaled, encoded video via ethernet. When I am using this line:

gst-launch-0.10 -vvv mfw_v4lsrc sensor-width=720 sensor-height=576 capture-width=720 capture-height=576 ! mfw_vpuencoder codec-type=std_avc ! video/x-h264,width=720,height=576 ! rtph264pay ! udpsink host=10.64.50.103 port=1234 sync=false async=true

everything goes fine, but video is interlaced. I can rescale it like this:

gst-launch-0.10 -vvv mfw_v4lsrc sensor-width=360 sensor-height=288 capture-width=360 capture-height=288 ! mfw_vpuencoder codec-type=std_avc ! video/x-h264,width=360,height=288 ! rtph264pay ! udpsink host=10.64.50.103 port=1234 sync=false async=true

video goes fine, but it is still interlaced. When I perform this procedure:

*** some .c file ***

...

#define VIDIOC_S_INPUT          _IOWR ('V', 39, int)

int main(int argc, char *argv[])
{
   int fd, status;
   fd = open("/dev/video0", O_RDWR);
   if(fd == -1)

          exit(1);

   status = 1;

    if (ioctl(fd, VIDIOC_S_INPUT, &status) < 0) {
         printf("ioctl failed: %s\n", strerror(errno));
         exit(1);
     }
}
*** end of some .c file ***

video is deinterlaced and streaming it without rescaling is ok. When I try to rescale only messed up video is sent. When I try to display deinterlaced and scaled video on LCD (ex. Using ximagesink) it goes fine.

Do you have any idea how to properly deinterlace and rescale video so encoder is able to handle it? Or maybe you know how to use mfw_deinterlacer plugin because so far according to my experiments and observation it does nothing with video stream.

Tags (1)
0 Kudos
2 Replies

847 Views
swroch
Contributor I

Deinterlace:

We are using tvp5151. Driver is based on driver 5150 (you can download it from internet).

A friend of mine found out (by accident) that if you provide procedure like in the previous post:

*************************

int fd, status;
   fd = open("/dev/video0", O_RDWR);
   if(fd == -1)

          exit(1);

   status = 1;

    if (ioctl(fd, VIDIOC_S_INPUT, &status) < 0) {
         printf("ioctl failed: %s\n", strerror(errno));
         exit(1);
     }

*************************

for some reason it deinterlaces video. I have no idea why and how it works. I went throught documentation and forums - no information about it.

The whole .c file is attached. I have compiled it on my host machine with command:

 - "arm-none-linux-gnueabi-gcc tvp5151_ctl.c -o tvp5151_ctl"

And run the program on target machine with command:

 - "./tvp5151_ctl -i 1"

Streaming rescaled video:

I was using fsl-plugins version 1.9.5. On the freescale webpage there are no files with newer codecs for IMX51· Seems it is not being developed anymore (at least software). So I took fsl-plugins from IMX53 (version 2.0.3), compiled it with spec file form imx53 and it started working.

I have noticed that you can rescale video with mfw_ipucsc plugin but it is not able to handle all resolution. It works fine if I want to rescale my 720x576 video to 320x240, but if for example I want to have 480x560 it gives errors like this:

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_10 = 0x00000001

mxc_ipu mxc_ipu: IPU Error - IPU_INT_STAT_5 = 0x00000001

Answer if you will find out how to rescale video with mfw_ipucsc without errors.

If my post is not clear tell me I will write detailed, long and boring one with instructions step by step how we had made it to work.

0 Kudos

847 Views
LautaroCarmona1
Contributor II

Hello! I'm working with TV Decoder TVP5147 connected to the i.MX51 Processor through the CSI Port, in order to digitalize analog video (and most of it is interlaced video).

We are using gstreamer as well and, as you say, we also noticed that the mfw_deinterlacer is doing nothing.

Sorry I can't help you yet, but could you be more specific on how did you managed to deinterlace the video stream with the procedure you exemplified?

I'll try to do my best to deinterlace and rescale too, and then I'll post any advance here.

Thank you, Lautaro.

0 Kudos