IP Camera with Jetson Nano

Has anyone successfully implemented an IP camera with the Jetson Nano?
I have been able to run Imagenet with the Raspberry Pi V2 MIPI camera and also ran external USB camera with Cheese. Would like to run IP camera(s)

Have all the examples running video been via MIPI and USB?

Bert S

Hi,
Please refer to below posts:
http://gstreamer-devel.966125.n4.nabble.com/Streaming-directly-from-an-IP-camera-td4683357.html
[url]https://devtalk.nvidia.com/default/topic/1043770/jetson-tx2/problems-minimizing-latency-and-maximizing-quality-for-rtsp-and-mpeg-ts-/post/5295828/#5295828[/url]

1 Like

Hi Dane,
Thanks for the info, I will work on this over the weekend, will let you know if I am successful

Bert S

Hello,

I should update detectnet-camera.cpp for use a ip camera. It’s possible ? How ? Please

Marco

Hi @Marco972,
The implementation is based on gstreamer, you may check the source code and modify the pipeline to run rtspsrc.
Other users may have similar experience to share with you.

Hi @DaneLL,

I tried unsuccessfully to modify the file “detectnet-camera.cpp” as follows:

/*
* create the camera device
/
// gstCamera
camera = gstCamera::Create(DEFAULT_CAMERA);

    gstCamera* camera = gstCamera::Create("rtspsrc location=rtsp://xxxxxxx:xxxxxxxxxxxxxxxxxxx@190.167.2.30:554//cam/realmonitor?channel=1&subtype=0 ! rtph264depay ! h264parse ! queue ! omxh264dec ! appsink name=mysink");


    if ( !camera )
    {

When I execute “make” ( in directory : …/“build”) I had error :

make
[ 44%] Built target jetson-utils
[ 60%] Built target jetson-inference
[ 63%] Built target imagenet-console
[ 65%] Built target imagenet-camera
[ 68%] Built target detectnet-console
Scanning dependencies of target detectnet-camera
[ 69%] Building CXX object detectnet-camera/CMakeFiles/detectnet-camera.dir/detectnet-camera.cpp.o
/home/jm/jetson-inference/detectnet-camera/detectnet-camera.cpp: In function ‘int main(int, char**)’:
/home/jm/jetson-inference/detectnet-camera/detectnet-camera.cpp:94:217: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive]
xxx@190.167.2.30:554//cam/realmonitor?channel=1&subtype=0 ! rtph264depay ! h264parse ! queue ! omxh264dec ! appsink name=mysink");
^
In file included from /home/jm/jetson-inference/detectnet-camera/detectnet-camera.cpp:23:0:
/home/jm/jetson-inference/build/aarch64/include/gstCamera.h:57:20: note: initializing argument 1 of ‘static gstCamera* gstCamera::Create(int)’
static gstCamera* Create( int v4l2_device=-1 ); // use onboard camera by default (>=0 for V4L2)
^~~~~~
detectnet-camera/CMakeFiles/detectnet-camera.dir/build.make:62: recipe for target ‘detectnet-camera/CMakeFiles/detectnet-camera.dir/detectnet-camera.cpp.o’ failed
make[2]: *** [detectnet-camera/CMakeFiles/detectnet-camera.dir/detectnet-camera.cpp.o] Error 1
CMakeFiles/Makefile2:291: recipe for target ‘detectnet-camera/CMakeFiles/detectnet-camera.dir/all’ failed
make[1]: *** [detectnet-camera/CMakeFiles/detectnet-camera.dir/all] Error 2
Makefile:129: recipe for target ‘all’ failed
make: *** [all] Error 2

Can you help me please? I start in the development. Thanks a lot
Marco

Hi,
The gstreamer pipeline is in gstCamera.cpp. You should modify

bool gstCamera::buildLaunchStr( gstCameraSrc src )

Hi, @DaneLL,

1- I tried to update gstCamera.cpp, but there is a problem. My setting inf file (~line 374) put this pipeline:


ss<<“rtspsrc location=rtsp://xxx:xxxx@xxx.xxx.xx.xxx:554/h264/ch1/main/av_stream ! rtph264depay ! h264parse ! omxh264dec ! appsink name=mysink”;

2- And “make”, “make install” and execute code in virtual env. : bin# ./detectnet-camera multiped

3- I had :


[gstreamer] initialized gstreamer, version 1.14.1.0
[gstreamer] gstCamera attempting to initialize with GST_SOURCE_NVCAMERA
[gstreamer] gstCamera pipeline string:
rtspsrc location=rtsp://xxx:xxx@xxx.xxx.xx.xxx:554//h264Preview_01_main ! rtph264depay ! h264parse ! omxh264dec ! appsink name=mysink

detectnet-camera: successfully initialized video device
width: 1280
height: 720
depth: 12 (bpp)

detectNet – loading detection network model from:
– prototxt networks/multiped-500/deploy.prototxt
– model networks/multiped-500/snapshot_iter_178000.caffemodel
– input_blob ‘data’
– output_cvg ‘coverage’
– output_bbox ‘bboxes’
– mean_pixel 117.000000
– class_labels networks/multiped-500/class_labels.txt
– threshold 0.500000
– batch_size 2

[TRT] TensorRT version 5.0.6

4- I had the message :

detectnet-camera: failed to capture

5- And a TENSOR window appears but the display is stay BLACK . Do you have a solution, please ?

Marco

you should manually set the mDepth to 12

and disable csiCamera check

Hi, @jocover,

Thanks for your reply. It’s OK after the modification.

Thanks a lot.

Marco

Hi All,
Does anyone know how to put configure the ss<< "rtspsrc location=rtsp://
with width and height
as camera.CaptureRGBA() is very very slow on Jetson nano
Thanks in advance

Hi georgesmarkus,
There is certain memcpy in the code. We have optimization in DeepStream SDK 4.0 and suggest you try it.

Hi, @Marco
How do you use ip camera in detail?
I can’t find a way to use it?

Hi Hryy, #13

My modif in gstcamera.cpp file :

####################################################################################################

ss << “appsink name=mysink”;

	mSource = GST_SOURCE_V4L2;
}

*/

// Begin update M

ss<<"rtspsrc location=rtsp://user:pwd@192.XXX.XXX.XXX:554//h264Preview_01_main ! rtph264depay ! h264parse ! omxh264dec ! appsink name=mysink";

// gst-launch-1.0 rtspsrc location="rtsp://admin:admin@192.168.155.160:80" ! rtph264depay ! h264parse ! nv_omx_h264dec ! ffmpegcolorspace ! queue ! xvimagesink
// ss<<"protocols = GST_RTSP_LOWER_TRANS_TCP";
// ss<<"playbin location=rtsp://userro:rouser@192.168.1.44:554//h264Preview_01_main uridecodebin0::source::latency=300";

// End update M

mLaunchStr = ss.str();

printf(LOG_GSTREAMER "gstCamera pipeline string:\n");
printf("%s\n", mLaunchStr.c_str());
return true;

}

// Create
gstCamera* gstCamera::Create( uint32_t width, uint32_t height, int v4l2_device )
{

###########################################################################################

Would you mind sharing your entire new gstCamera.cpp? Thank you.

You may try this patch.

Hi andreea.v,

Please open a new topic for your issue. Thanks

Hm, this author seems to have set up a jetson nano based home security system using POE IP cameras. Posting here in case it’s helpful to anyone reading this thread:

This is simple to set up for Python:

You can then grab Numpy arrays for use with your workflow directly from a range of different camera connection types including CSI, USB, RTSP, IP and MJPEG streams.

I have it working with an iPhone using the CameraIP app by David Del Olmo which provides MJPEG and RTSP streams from iOS.

1 Like

Thanks Damian, I am using Foscam FI9821P web IP cam and it works well with RTSP streams using Foscam-libray