Need help setting up camera pipeline (jetson nano)

Hello!
So I’m building my app from scratch, occasionally checking with deepstream-app and other examples.

I’ve managed to initialize the pipelene and figure out all the Caps issues.
However, there are still some issues. I could not deal with them all at once, so I reduced the pipeline to
nvarguscamerasrc → nvv4l2h264enc → fakesink

The issue is that I get EOS immediately after startup.
I set the capture length to capture 5 seconds, start the app, receive the EOS, then app waits 5 seconds and terminates ‘successfully’.

The camera seems to start ok

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 4 
   Output Stream W = 1280 H = 720 
   seconds to Run    = 5 
   Frame Rate = 120.000005 
GST_ARGUS: PowerService: requested_clock_Hz=627200000
GST_ARGUS: Setup Complete, Starting captures for 5 seconds
GST_ARGUS: Starting repeat capture requests.

But then I get

WARN          v4l2bufferpool gstv4l2bufferpool.c:1518:gst_v4l2_buffer_pool_dqbuf:<encoder:pool:src> Driver should never set v4l2_buffer.field to ANY
WARN          v4l2bufferpool gstv4l2bufferpool.c:1463:gst_v4l2_buffer_pool_dqbuf:<encoder:pool:sink> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
WARN          v4l2bufferpool gstv4l2bufferpool.c:1463:gst_v4l2_buffer_pool_dqbuf:<encoder:pool:sink> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0

And then a buuunch of

WARN          v4l2bufferpool gstv4l2bufferpool.c:1463:gst_v4l2_buffer_pool_dqbuf:<encoder:pool:sink> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0

which I assume happens due to camera not being actually captured.

The pipeline is set up like this:

g_object_set(G_OBJECT(Source), "num-buffers", 120, NULL);
g_object_set(G_OBJECT(Source), "gainrange", "8 8", NULL);
g_object_set(G_OBJECT(Source), "ispdigitalgainrange", "1 1", NULL);
g_object_set(G_OBJECT(Source), "exposuretimerange", "1600000 1600000", NULL);

GstCaps *Caps = gst_caps_new_simple(
    "video/x-raw",
    "format", G_TYPE_STRING, "NV12",
    "width", G_TYPE_INT, 1280,
    "height", G_TYPE_INT, 720,
    "framerate", GST_TYPE_FRACTION, 120, 1,
    NULL
);

GstCapsFeatures *Feature = gst_caps_features_new("memory:NVMM", NULL);
gst_caps_set_features(Caps, 0, Feature);

gst_bin_add_many(GST_BIN(Pipeline), Source, H264Encoder, FakeSink, NULL);

g_object_set(G_OBJECT(Source), "bufapi-version", TRUE, NULL);
g_object_set(G_OBJECT(Source), "maxperf", TRUE, NULL);
g_object_set(G_OBJECT(Source), "timeout", 5, NULL);
g_object_set(G_OBJECT(H264Encoder), "bufapi-version", TRUE, NULL);
g_object_set(G_OBJECT(H264Encoder), "maxperf-enable", TRUE, NULL);

assert(gst_element_link_filtered(Source, H264Encoder, Caps));
assert(gst_element_link_many(H264Encoder, FakeSink, NULL));

What am I doing wrong?

Edit: When I’m specifying num_buffers instead of timeout, I seem to not get EOS until the app actually terminates. But I still get the warnings.

Edit2:
So I attached the mp4->file chain to the pipeline, and it actually wrote the file from camera…
And timeout also worked, however value ‘5’ only produced a file that was ~1 second. Maybe that’s because of 120fps capture rate… Which explains why I got EOS so fast.

Anyways this seems to be working, my only question is, I guess, if I should do anything about those warnings. And what do they mean.

Thanks! Sorry about a wall of text and the frantic nature of my messages, we’re on a strict deadline here =)

Hi,
The print is harmless. For 120fps, you may configure ‘num-buffers=1200’ which can last 1200/120=10 seconds.

Yes, I did it with num-buffers and it works perfectly now, was just worried about the warnings. Thanks!