Not able to record Video

Hello,

I am trying to record a video from CM3 IO board with gst-launch-1.0
i am able to capture the image with the following command.
sudo gst-launch-1.0 v4l2src num-buffers=1 device=/dev/video0 ! jpegenc ! filesink location=picture.jpg

Can anyone help me in recording the video using python, or from command line as
there is some setup which i am missing.

I have enabled the camera in rsetup, and i see video0 -8 in /dev/ location.
but not able to record the video.

Can anyone guide me in recording a video.
i am using IMX219 camera sensor.

Thank you