This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5728: jitter in tvp5150 captured video - how deinterlace PAL input video (interlaced 720*288) with gstreamer in AM5728

Part Number: AM5728
Other Parts Discussed in Thread: TVP5150AM1, TMDSEVM572X

Hello 

I have a problem with capturing interlaced video from TVP5150AM1 in TMDSEVM572x and deinterlacing it.

I have used this commands :

root@am57xx-evm:~#    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=-1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)720, height=(int)288, framerate=(fraction)50/1' ! deinterlace ! vpe num-input-buffers=1 ! ducatih264enc inter-interval=1 bitrate=5000 ! h264parse ! ducatih264dec ! vpe ! 'video/x-raw,format=(string)NV12, width=720,height=288' ! waylandsink sync=false

root@am57xx-evm:~#    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=-1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)720, height=(int)288, framerate=(fraction)50/1 , interlaced=false' ! deinterlace ! vpe num-input-buffers=1 ! ducatih264enc inter-interval=1 bitrate=5000 ! h264parse ! ducatih264dec ! vpe ! 'video/x-raw,format=(string)NV12, width=720,height=288' ! waylandsink sync=false

root@am57xx-evm:~#    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=-1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)720, height=(int)288, framerate=(fraction)50/1' ! deinterlace ! vpe num-input-buffers=1 ! ducatih264enc inter-interval=1 bitrate=5000 ! h264parse ! ducatih264dec ! vpe ! 'video/x-raw,format=(string)NV12, width=720,height=576' ! waylandsink sync=false

root@am57xx-evm:~#    gst-launch-1.0 -e v4l2src device=/dev/video1 num-buffers=-1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)720, height=(int)288, framerate=(fraction)50/1 , interlaced=false' ! deinterlace ! vpe num-input-buffers=1 ! ducatih264enc inter-interval=1 bitrate=5000 ! h264parse ! ducatih264dec ! vpe ! 'video/x-raw,format=(string)NV12, width=720,height=576' ! waylandsink sync=false

the number of interrupts gotten is about 50 interrupts per second (50 fps).

root@am57xx-evm:~# cat /proc/interrupts | grep vi
103: 183157     0    CBAR    352    Level vin3
104: 0               0    CBAR    393    Level vin4

I expect that after deinterlacing, the frame rate to  be 25 and the video to be correct without jitter.

in all above examples there is jitter in video. I think the deinterlace element does not work correctly !

does anyone know why it is so that?

BR,

Ali

  • Hi Ali,

    Can you refer to this thread.

    https://e2e.ti.com/support/processors/f/791/t/618455

    We have provided a patch in the thread. Please check if this resolves the issue.

    Thanks

    RamPrasad

  • Hi RamPrasad

    thanks for reply.

    I will check your recommended post and will report the result.

    Regars,

    Ali

  • Hi again

    I saw the post you mentioned.

    in the last response, it is told that we should edit the vip.c as follow :

    diff --git a/drivers/media/platform/ti-vpe/vip.c b/drivers/media/platform/ti-vpe/vip.c

    index bc6e8edaf1c..1accab91410 100644
    --- a/drivers/media/platform/ti-vpe/vip.c
    +++ b/drivers/media/platform/ti-vpe/vip.c
    @@ -2790,6 +2790,8 @@ static int vip_init_stream(struct vip_stream *stream)
    fmt = port->fmt;
    mbus_fmt = &port->mbus_framefmt;

    + memset(&f, 0, sizeof(f));
    +
    /* Properly calculate the sizeimage and bytesperline values. */
    v4l2_fill_pix_format(&f.fmt.pix, mbus_fmt);
    f.fmt.pix.pixelformat = fmt->fourcc;
    --
    2.13.0

    Iin SDK version 06.00.00.07 this was done originally and does not need to change.

    now, what should I do ?

    regards,

    Ali

  • Hi Ali,

    This has been a known issue till now. 

    This is due to protocol incompatibility between opensrc v4l2src plugin and TI provided VIP/VPE driver. The interlace field capture can be arranged in two modes - alternate field mode or the interleaved frame mode. VIP/VPE driver understands only the alternate mode of interlace capture while the v4l2src gstreamer plugin only supports the interleaved frame mode. This prevents successful de-interlacing using the gstreamer pipeline.

    There is one application capturevpedisplay which doesn't show this issue.

    Thanks

    RamPrasad

  • Hi RamPrasad

    thanks for reply.

    OK, this means that we should change the VIP/VPE source code for making it compatible with V4L2src plugin.

    if you have any suggestion, I will appreciate you to tell me.

    BR,

    Ali

  • Hi Ali,

    It needs change in v4l2src source code to make it compatible with gstreamer vpe plugin.

    But it is not planned yet.

    Thanks

    RamPrasad