I am trying to capture a raw 4k image for my AI application using a 4k camera shown here. I want to capture a frame every 5 seconds and store it as a .png file which I will later run through my neural network for detection. I know the ommand to record a 4k video in raw format (.mkv). However I am not able to capture a single image (frame) in 3840x2160 resolution.
There is a sample command which is
gst-launch-1.0 nvarguscamerasrc sensor-id=0 num-buffers=1 ! "video/x-raw(memory:NVMM),format=(string)NV12, width=(int)3840, height=(int)2160" ! nvjpegenc ! filesink location=test.jpg
The above command works but it only stores in jpg which is around 1mb insize. This is not very clear and I want a png format which is more detailed. I tried changing the extension in the filename but it is not working. I am using a jetson xavier nx.
EDIT I have tried to change the encoding by using the following command
gst-launch-1.0 nvarguscamerasrc sensor-id=0 num-buffers=1 ! "video/x-raw(memory:NVMM), format=(string)NV12, width=(int)3840, height=(int)2160" ! pngenc ! filesink location=test1.png
However I am getting the following error
WARNING: erroneous pipeline: could not link nvarguscamerasrc0 to pngenc0, pngenc0 can't handle caps video/x-raw(memory:NVMM), format=(string)NV12, width=(int)3840, height=(int)2160