Unable to generate mkv file from raw video

Hi,
I am using IMX296 monochrome image sensor from Vision components connected to the carrier board with Jetson TX2 NX SoM.
My intention is to record a raw video file and then encode it using omxh265enc and then use matroskamux to generate the corresponding mkv file. I used the below command for the same
gst-launch-1.0 filesrc location=cam_video_2.raw blocksize=13369344 ! ‘video/x-raw, width=(int)1536, height=(int)1088, format=(string)GRAY8, framerate=(fraction)60/1’ ! nvvidconv ! ‘video/x-raw(memory:NVMM), width=(int)1536, height=(int)1088, format=(string)I420, framerate=(fraction)60/1’ ! omxh265enc ! matroskamux name=mux ! filesink location=cam_video_2.mkv -e

However the generated mkv file was corrupted and unable to play.

I also tested this pipeline using video source as videotestsrc, then it worked fine and the file was good. What could be the problem occured and how to solve this?

Hi,
Please check if running this command generates valid video file:

gst-launch-1.0 filesrc location=cam_video_2.raw blocksize=13369344 ! 'video/x-raw, width=(int)1536, height=(int)1088, format=(string)GRAY8, framerate=(fraction)60/1' ! videoconvert ! video/x-raw,format=I420 ! nvvidconv ! 'video/x-raw(memory:NVMM), width=(int)1536, height=(int)1088, format=(string)NV12, framerate=(fraction)60/1' ! nvv4l2h265enc ! h265parse ! matroskamux name=mux ! filesink location=cam_video_2.mkv -e

If not please run this command and check video preview:

gst-launch-1.0 filesrc location=cam_video_2.raw blocksize=13369344 ! 'video/x-raw, width=(int)1536, height=(int)1088, format=(string)GRAY8, framerate=(fraction)60/1' ! videoconvert ! video/x-raw,format=I420 ! xvimagesink

Hi @DaneLLL
Thanks for your response. I was not able to get a valid video file from first command. Actually I’m getting the header only.
However, I’m able to view a preview from the second command.

Hi,
Please add videoparse plugin and give it a try.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.