Need help to capture video into file on Stereo camera

I’m trying to record video and save it as a file from my camera. I’ve attached a cpp file from the manufactuerr of the camera. The pipeline works, but it doesn’t do anything when ‘r’ is pressed. Can someone guide me on how to record on the jetson?
videocapture_camera.cpp (2.7 KB)

hello aranis.das,

it’s basically gst pipeline. please try follow to record the video stream with h264.
$ gst-launch-1.0 nvarguscamerasrc sensor-id=0 num-buffers=300 ! 'video/x-raw(memory:NVMM), width=1280, height=720, framerate=30/1' ! nvtee ! omxh264enc bitrate=20000000 ! qtmux ! filesink location=video.mp4

1 Like

Thank you for the response Jerry
I saw the output and every recording seemed the same. I tried to change the pipeline to the maximum of the sensor ( Resolution: 3280 × 2464 (per camera)) but it looked very similar to the 1080p one.
Also, GST_ARGUS showed 1280 x 720, does that mean anything ? :
gst-launch-1.0 nvarguscamerasrc sensor-id=0 num-buffers=1800 ! ‘video/x-raw(memory:NVMM), width=3280, height=2464, framerate=20/1’ ! nvtee ! omxh264enc bitrate=20000000 ! qtmux ! filesink location=video.mp4
nvbuf_utils: Could not get EGL display connection
Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Framerate set to : 20 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
H264: Profile = 66, Level = 40
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected…
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 3264 x 2464 FR = 21.000000 fps Duration = 47619048 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 3264 x 1848 FR = 28.000001 fps Duration = 35714284 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1920 x 1080 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1640 x 1232 FR = 29.999999 fps Duration = 33333334 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: 1280 x 720 FR = 120.000005 fps Duration = 8333333 ; Analog Gain range min 1.000000, max 10.625000; Exposure Range min 13000, max 683709000;

GST_ARGUS: Running with following settings:
Camera index = 0
Camera mode = 0
Output Stream W = 3264 H = 2464
seconds to Run = 0
Frame Rate = 21.000000
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
Got EOS from element “pipeline0”.
Execution ended after 0:01:30.641202019
Setting pipeline to PAUSED …
Setting pipeline to READY …
GST_ARGUS: Cleaning up
CONSUMER: Done Success
GST_ARGUS: Done Success
Setting pipeline to NULL …
Freeing pipeline …

Another thing, the num-buffers parameter specifies the length of the recording, but for some reason it goes over (I set it for 1800 (1 minute) and it recorded 1:30)

hello aranis.das,

did you meant the recorded video always present the 1st frame?
if yes, please examine the output frame-rate, otherwise this is more like the issue on sensor side.

the num-buffers parameter specifies the number of frames it’ll captured.
1:30 should be correct since it’s a 20-fps configuration, i.e. 1800/ 20 = 90 sec.

1 Like

I see. No, but the quality seems to less than 3280 × 2464. Is there a way to maximize quality? I know the resolution was specified in the pipeline, but I’d like to know if theres a way to force it to show max resolution. I am looking for lower fps, higher quality frames for my application.

Also, is it possible to save video from both sensors at the same time (synchronized)? The C++ code I provided did do that, but it didn’t work past 480p.

hello aranis.das,

it depends-on your encode settings, usually due to the bitrate config.
please refer to Encode Examples to revise the pipeline for testing with your use-case.


are these two cameras have hardware FSYNC pin connected?
you may refer to Topic 1070823 for reference, it shows the approaches for dual camera frame synchronization in software level.

1 Like

Thanks for the response. Do you think there’s a better way to record video? I am working on a stereo vision setup, but its not in realtime. So highest resolution with an fps of atleast 5 is what i’m looking for. Is there a more effective way to get input?

what did you meant a better way?
it depends-on your sources content. video record is simply sending the camera stream to encoder and writing into memory.

In terms of quality. I think this will do for my application. Thanks for the help

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