Video is not sync at the pipline start

@Prog @jaski.tx @marcel.tx :

One solution suggested by a user at nxp forum was to use the following:

ioctl VIDIOC_STREAMOFF
//switch the adv_input
ioctl VIDIOC_QBUF
ioctl VIDIOC_STREAMON

Is it possible to run ioctl in terminal?

I tried media-ctl and v4l2-ctl but to no avail.

It seems that the trick is to stop the current stream, clear the buffer and start the stream again.

Any idea how it can be done?