Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gst_element_factory_make ("nvcamerasrc", NULL); returns NULL #85

Closed
SergiyStoyan opened this issue Jun 14, 2018 · 7 comments
Closed

gst_element_factory_make ("nvcamerasrc", NULL); returns NULL #85

SergiyStoyan opened this issue Jun 14, 2018 · 7 comments

Comments

@SergiyStoyan
Copy link

Hi,

I'm developing a kinesis video producer for nvidia TX2 camera. They use their driver nvcamerasrc instead of v4l2src. This driver was tested with gst-launch-1.0 e.g.

gst-launch-1.0 nvcamerasrc fpsRange="60 60" intent=3 ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! omxh264enc control-rate=2 bitrate=6000000 ! h264parse ! flvmux streamable=true ! queue ! filesink location=test2.mkv

It works well.

So I installed amazon-kinesis-video-streams-producer-sdk-cpp package and in kinesis_video_gstreamer_sample_app.cpp in gst_element_factory_make replaced "v4l2src" with "nvcamerasrc". But it cannot create it and returns NULL.

What is the app missing about nvcamerasrc? Can you give an idea why gst-launch-1.0 can see nvcamerasrc but the sample app cannot?
Thank you!

@unicornss
Copy link
Contributor

unicornss commented Jun 14, 2018

Seems like you have gst-launch-1.0 already in the system and cache has been updated during your nvidia plugin install .

Kinesis Video Streams Producer SDK downloads and installs the required dependencies including GStreamer plugins within the subfolder <yoursdkfolderpath>/kinesis-video-native-build/downloads/local/lib and it uses that path ( export LD_LIBRARY_PATH to <yoursdkfolderpath>/kinesis-video-native-build/downloads/local/lib ).

If you could locate the libgstnvcamera.so in your environment, please update either the LD_LIBRARY_PATH= <yoursdkfolderpath>/kinesis-video-native-build/downloads/local/lib:<folder-path-libgstnvcamera.so> or you can copy this libgstnvcamera.so into <yoursdkfolderpath>/kinesis-video-native-build/downloads/local/lib.

You can also set the environment variable GST_PLUGIN_PATH to include both kinesis video stream dynamic libraries and nvidia plugin libraries path.

Let us know if this resolves your issue.

@SergiyStoyan
Copy link
Author

Yes, gst-launch-1.0 was already installed.

#1 I copied libgstnvcamera.so which is located in usr/lib/aarch64-linux-gnu/gstreamer-1.0 to <...>/kinesis-video-native-build/downloads/local/lib

no help

#2 I did
export LD_LIBRARY_PATH=/home/ubuntu/amazon-kinesis-video-streams-producer-sdk-cpp-1.4.1/kinesis-video-native-build/downloads/local/lib:$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra/:/usr/lib/aarch64-linux-gnu/gstreamer-1.0

(where tegra contains nvidia libs)
no help

#3 I did
export GST_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/tegra/:/usr/lib/aarch64-linux-gnu/gstreamer-1.0

where tegra contains nvidia libs

and it worked!

Thank you!

@unicornss
Copy link
Contributor

Closing this issue as it has been resolved.

@SergiyStoyan
Copy link
Author

SergiyStoyan commented Jun 14, 2018

BTW here all the issues I stumbled over while deploying Kinesis SDK to TX2 camera system. Hope it will be helpful for somebody else.

Installation and running amazon-kinesis-video-streams-producer-sdk-cpp1.4.1 ISSUES:

INSTALLATION ISSUES:

#1

'__NR_eventfd' undeclared

remedy:

in install-script to command ./config add no-afalgeng flag:

./config no-afalgeng --prefix=$DOWNLOADS/local/ --openssldir=$DOWNLOADS/local/

#2

checking build system type... ./config.guess: unable to guess system type

remedy:

in install-script after command

cd $DOWNLOADS/m4-1.4.10

add

wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
wget -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'

in order to overwrite the obsolete scripts

#3

curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/cert.pem

remedy:

sudo mkdir -p /etc/ssl
sudo cp /etc/ssl/certs/ca-certificates.crt /etc/ssl/cert.pem

RUNNING APPLICATION ISSUES:

#4

error while loading shared libraries: liblog4cplus-1.2.so.5: cannot open shared object file: No such file or directory

remedy:

export LD_LIBRARY_PATH=/home/ubuntu/amazon-kinesis-video-streams-producer-sdk-cpp-1.4.1/kinesis-video-native-build/downloads/local/lib:$LD_LIBRARY_PATH

#5

gst_element_factory_make ("nvcamerasrc", NULL); returns NULL

remedy:

export GST_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/tegra/:/usr/lib/aarch64-linux-gnu/gstreamer-1.0

@MushMal
Copy link
Contributor

MushMal commented Jun 14, 2018

@sergeystoyan Thanks a lot for reporting these issues! BTW, you could send a PR :)

@yuxiny2586
Copy link

BTW here all the issues I stumbled over while deploying Kinesis SDK to TX2 camera system. Hope it will be helpful for somebody else.

Installation and running amazon-kinesis-video-streams-producer-sdk-cpp1.4.1 ISSUES:

INSTALLATION ISSUES:

#1

'__NR_eventfd' undeclared

remedy:

in install-script to command ./config add no-afalgeng flag:

./config no-afalgeng --prefix=$DOWNLOADS/local/ --openssldir=$DOWNLOADS/local/

#2

checking build system type... ./config.guess: unable to guess system type

remedy:

in install-script after command

cd $DOWNLOADS/m4-1.4.10

add

wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
wget -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'

in order to overwrite the obsolete scripts

#3

curl: (77) error setting certificate verify locations:
CAfile: /etc/ssl/cert.pem

remedy:

sudo mkdir -p /etc/ssl
sudo cp /etc/ssl/certs/ca-certificates.crt /etc/ssl/cert.pem

RUNNING APPLICATION ISSUES:

#4

error while loading shared libraries: liblog4cplus-1.2.so.5: cannot open shared object file: No such file or directory

remedy:

export LD_LIBRARY_PATH=/home/ubuntu/amazon-kinesis-video-streams-producer-sdk-cpp-1.4.1/kinesis-video-native-build/downloads/local/lib:$LD_LIBRARY_PATH

#5

gst_element_factory_make ("nvcamerasrc", NULL); returns NULL

remedy:

export GST_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/tegra/:/usr/lib/aarch64-linux-gnu/gstreamer-1.0

This post was extremely helpful when I was setting up my Jetson Xavier. Thanks a lot @sergeystoyan

@MushMal
Copy link
Contributor

MushMal commented Mar 9, 2020

Folks, this is all fantastic info. We strongly encourage sending pull requests with changes that can get merged into master branch. This information can go into a section in Readme for example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants