I read a lot of threads here (built OpenCV 3.1 and changed cboot.bin) and finally got my on-board camera working. But now I’ve run into another problem - the camera (or code) is not grabbing frames at the required/specified rate.
I believe this line sets the gst pipeline fps to 120.
But I don’t. The video is 3 seconds long because I’m specifically counting 361 frames, but the actual time elapsed during the recording is much more than 3 seconds, close to 30 seconds. Please see recorded video here - https://drive.google.com/open?id=0Bwew736KYms5WVEtOUMzQnJ1c1E
Can anyone tell me what’s happening here?
Is the TX1 just that slow at iterating through the for-loop?
Or should I be using some sort of CUDA code? Or Nvidia’s argus/libargus?
Will I face this issue even if I move to external CSI-2 cameras? (which is the plan)
$ v4l2-ctl --all
Driver Info (not using libv4l2):
Driver name : tegra-video
Card type : vi-output, ov5693 6-0036
Bus info : platform:54080000.vi:2
Driver version: 4.4.38
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 2: no power)
Format Video Capture:
Width/Height : 1280/720
Pixel Format : 'RG10'
Field : None
Bytes per Line : 2560
Size Image : 1843200
Colorspace : sRGB
Transfer Function : Default
YCbCr Encoding : Default
Quantization : Default
Flags :
Camera Controls
frame_length (int) : min=0 max=32767 step=1 default=1984 value=761 flags=slider
coarse_time (int) : min=2 max=32761 step=1 default=1978 value=755 flags=slider
coarse_time_short (int) : min=2 max=32761 step=1 default=1978 value=755 flags=slider
group_hold (intmenu): min=0 max=1 default=0 value=0
hdr_enable (intmenu): min=0 max=1 default=0 value=0
otp_data (str) : min=0 max=1024 step=2 value='93b2ec0110238540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000057000000000000000000170000000000' flags=read-only, has-payload
fuse_id (str) : min=0 max=16 step=2 value='93b2ec0110238540' flags=read-only, has-payload
gain (int) : min=256 max=4096 step=1 default=256 value=4096 flags=slider
bypass_mode (intmenu): min=0 max=1 default=0 value=1
override_enable (intmenu): min=0 max=1 default=0 value=1
height_align (int) : min=1 max=16 step=1 default=1 value=1
size_align (intmenu): min=0 max=2 default=0 value=0
write_isp_format (bool) : default=0 value=0
I cannot see fps on there. I tried the same command on my laptop and I can see fps details.
I tried to get the fps using
double fps = (double) cap.get(CV_CAP_PROP_FPS);
but the function just returns 0.
I also felt that it might be the write operation that is taking too long. So I moved them to separate threads using C++ and the fps improved to approx 100. Maybe if I raise the clk to max I can get 120.
But the write operation still took a long time. So should I be using a gstreamer pipeline for output as well? Is there documentation for using gstreamer as output pipeline on TX1? Even though for now I’m writing to file, the end goal is to output frames via USB.
You may also use tegrastats for checking the ressource usage.
Not sure how much efficient is your synchronization method. Does it give same results if you launch writer thread only after reader has filled buffers ?