gst-plugins-vision icon indicating copy to clipboard operation
gst-plugins-vision copied to clipboard

Compiling for ARM

Open SahanaSrinivas opened this issue 6 years ago • 36 comments

I am using an arm64 borad and i want to use gstreamer to access video from IDS ueye camera. I am very new to these topics. I have tried much but I have problems installing these plugins. Could you please guide me on the installation steps ?

SahanaSrinivas avatar Sep 27 '18 10:09 SahanaSrinivas

You would need to compile the plugin for your architecture. I've only ever used these plugins on Windows/x86_64, but if the IDS uEye library supports ARM it should compile, perhaps with some minor fixes. Unfortunately I have no ARM experience or devices.

joshdoe avatar Oct 05 '18 13:10 joshdoe

While compiling on arm 64 (Nvidia Tx2) I am facing error for orc-0.4. what is the use of this library? Is it mandatory to be used.

BTW, I saw "Currently there is no ARM64/AArch64 support in ORC." at https://gstreamer.freedesktop.org/projects/orc.html

harendracmaps avatar Apr 13 '20 10:04 harendracmaps

ORC is for performance improvement, not strictly necessary, though used in several other GStreamer libraries.

On Mon, Apr 13, 2020, 6:40 AM Harendra Singh [email protected] wrote:

While compiling on arm I am facig error for orc-0.4. what is the use of this library? Is it mandatory to be used.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/joshdoe/gst-plugins-vision/issues/2#issuecomment-612848357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRB567F2LRYBBLJGK7BMTRMLTY5ANCNFSM4FXRMUDQ .

joshdoe avatar Apr 13 '20 11:04 joshdoe

Thanks for response. But it is failing while running cmake cmake -G "Unix Makefiles" ..

-- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 .

-- Checking for module 'orc-0.4' -- No package 'orc-0.4' found CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:367 (message): A required package was not found Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:532 (_pkg_check_modules_internal) cmake/modules/FindOrc.cmake:16 (pkg_check_modules) CMakeLists.txt:49 (find_package)

-- Configuring incomplete, errors occurred! See also "/persistent/gst-plugins-vision/build/CMakeFiles/CMakeOutput.log".

harendracmaps avatar Apr 13 '20 11:04 harendracmaps

idsueyesrc does not use orc acceleration (yet) so for a "dirty" way. edit https://github.com/joshdoe/gst-plugins-vision/blob/ef66205b403c1e48c427035a813b39365886c796/CMakeLists.txt#L49 and remove the REQUIRED word. maybe you would have to skip (all?) other targets. remove lines 128-130 from CMakeLists.txt and replace with add_subdirectory (sys/idsueye)

i didnt test myslef as i dont have your hardware but that should work, also there is probably a cleaner way to compile just one target...

5shekel avatar Apr 13 '20 17:04 5shekel

Yes, Orc shouldn't be required, however it does seem to be supported on ARM, though the FindOrc.cmake file may need to be updated.

I do have an ARM platform that I haven't used for a long time, I might be able to try and get that setup again.

joshdoe avatar Apr 13 '20 17:04 joshdoe

Just tried that, and looks like there are a few plugins that don't gracefully handle Orc being omitted. I'll try and make it optional. For now you can just uncomment the add_subdirectory lines to leave out extractcolor, misb, select, and aptina.

joshdoe avatar Apr 13 '20 17:04 joshdoe

idsueyesrc does not use orc acceleration (yet) so for a "dirty" way. edit

https://github.com/joshdoe/gst-plugins-vision/blob/ef66205b403c1e48c427035a813b39365886c796/CMakeLists.txt#L49

and remove the REQUIRED word. maybe you would have to skip (all?) other targets. remove lines 128-130 from CMakeLists.txt and replace with add_subdirectory (sys/idsueye) i didnt test myslef as i dont have your hardware but that should work, also there is probably a cleaner way to compile just one target...

Thanks! I have already tried by removing REQUIRED and making TRUE -> FLASE in the next line.

EVEN I tried your suggestion "remove lines 128-130 from CMakeLists.txt and replace with add_subdirectory (sys/idsueye)"

Still faced the same issue

-- Checking for module 'orc-0.4' -- No package 'orc-0.4' found CMake Error at /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:367 (message): A required package was not found Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindPkgConfig.cmake:532 (_pkg_check_modules_internal) cmake/modules/FindOrc.cmake:16 (pkg_check_modules) CMakeLists.txt:49 (find_package)

-- Configuring incomplete, errors occurred! See also "/persistent/gst-plugins-vision/build/CMakeFiles/CMakeOutput.log".

harendracmaps avatar Apr 13 '20 17:04 harendracmaps

Just tried that, and looks like there are a few plugins that don't gracefully handle Orc being omitted. I'll try and make it optional. For now you can just uncomment the add_subdirectory lines to leave out extractcolor, misb, select, and aptina.

Sorry but I could not follow you!

harendracmaps avatar Apr 13 '20 17:04 harendracmaps

@harendracmaps try removing that orc line altogether. strange t still complains even after you removed all other targets...

5shekel avatar Apr 13 '20 17:04 5shekel

also try sudo apt search liborc

5shekel avatar Apr 13 '20 17:04 5shekel

also try sudo apt search liborc

Thanks @5shekel ! liborc-0.4-dev library found for arm64. apt-get install liborc-0.4-dev resollved the orc issue but I am facing similar issue for BitFlow.

I want to use pylon module. Is it possible to comment lines from 52 till 110 and include only pylon? I did that and faced issue as follow..

-- Could NOT find PYLON (missing: PYLON_INCLUDE_DIR PYLON_LIBRARIES)


-- The following OPTIONAL packages could NOT be located on your system. -- Consider installing them to enable more features from this software.


Just want to tell you that I have already installed pylon 5.0.12. but still it is complaining.

harendracmaps avatar Apr 13 '20 18:04 harendracmaps

You probably need to edit the FindPylon.cmake, I've only tested it on Windows. You've already installed the Pylon SDK? Find where PylonC.h is installed on your system, hopefully you just need to update PYLON_DIR and the find_library line, as it looks I have it hardcoded for Windows.

joshdoe avatar Apr 13 '20 18:04 joshdoe

I've got Ubuntu 16.04 in a virtual machine now and am fixing things up. I've never cross-compiled, I might try that too.

joshdoe avatar Apr 14 '20 15:04 joshdoe

Thanks @joshdoe ! Waiting for the fixes.

harendracmaps avatar Apr 14 '20 15:04 harendracmaps

@harendracmaps I'm pushing changes to the linux branch for now. Got it building the basic plugins, I'll try Basler Pylon next.

joshdoe avatar Apr 14 '20 16:04 joshdoe

I have made changes for pylon..please let me know how to provide you patch? @joshdoe I tried pasting here but preview is not proper.

harendracmaps avatar Apr 14 '20 18:04 harendracmaps

Making changes now too, I've got it building now, just trying to figure how to route a Basler camera to my virtual machine. Either do a pull request, or attach a patch/diff via Gist or similiar.

joshdoe avatar Apr 14 '20 18:04 joshdoe

https://gist.github.com/harendracmaps/a213d26a8da3ec2546a729cc62aa7b27

Here it is please review and merge it. @joshdoe

Thanks!

harendracmaps avatar Apr 14 '20 18:04 harendracmaps

@harendracmaps I made almost the exact same changes, except I hardcoded /opt/pylon5, I don't seem to have PYLON_ROOT defined. Do you?

joshdoe avatar Apr 14 '20 18:04 joshdoe

yes while installation pylon I added it in my .bashrc.

Also I checked out linux branch and compiled. But it is failing while installing

Install the project... -- Install configuration: "" CMake Error at gst-libs/klv/cmake_install.cmake:36 (file): file INSTALL cannot find "/persistent/gst-plugins-vision/build/gst-libs/klv//libgstklv-1.0-0.pdb". Call Stack (most recent call first): gst-libs/cmake_install.cmake:37 (include) cmake_install.cmake:37 (include)

Makefile:137: recipe for target 'install' failed make: *** [install] Error 1

harendracmaps avatar Apr 14 '20 18:04 harendracmaps

So... KLV, I should make that optional, as it's kind of experimental and only used with Pleora and the KLV plugins right now. Oh wait, that's the pdb file, @5shekel just put up some pull requests to disable PDB on Linux, as it's Microsoft specific. I'll add that next. For now, look here.

BTW, pushed changes to linux branch including the my version of your changes, except I didn't use PYLON_ROOT.

joshdoe avatar Apr 14 '20 18:04 joshdoe

great Thanks @joshdoe! Just noticed it is creating libraries with prefix as "liblib" for example ..liblibgstpylon.so , liblibgstbayerutils.so, liblibgstklv-1.0-0.so

harendracmaps avatar Apr 14 '20 18:04 harendracmaps

@harendracmaps yep, @5shekel pointed out the same thing. Fixed in linux branch.

joshdoe avatar Apr 14 '20 19:04 joshdoe

The libraries are getting installed in the path "/usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/lib/gstreamer-1.0/"

Install the project... -- Install configuration: "" -- Installing: /usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/../../lib/libgstklv-1.0-0.so -- Installing: /usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/../../lib/gstreamer-1.0/libgstbayerutils.so -- Installing: /usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/../../lib/gstreamer-1.0/libgstextractcolor.so -- Installing: /usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/../../lib/gstreamer-1.0/libgstklv.so -- Set runtime path of "/usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/../../lib/gstreamer-1.0/libgstklv.so" to "" -- Installing: /usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/../../lib/gstreamer-1.0/libgstmisb.so -- Installing: /usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/../../lib/gstreamer-1.0/libgstselect.so -- Installing: /usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/../../lib/gstreamer-1.0/libgstvideoadjust.so -- Installing: /usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/../../lib/gstreamer-1.0/libgstpylon.so -- Set runtime path of "/usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include/../../lib/gstreamer-1.0/libgstpylon.so" to ""

find /usr -name "libgstpylon.so"

/usr/include/gstreamer-1.0;/usr/lib/aarch64-linux-gnu/lib/gstreamer-1.0/libgstpylon.so

harendracmaps avatar Apr 15 '20 03:04 harendracmaps

Yes, I've noticed that, a bad default. You can always change the CMAKE_INSTALL_PREFIX. See #20 also.

joshdoe avatar Apr 15 '20 11:04 joshdoe

i install like this

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/gst/plugins .. 
sudo make install 
#then let gstreamer know path to new plugins
export GST_PLUGIN_PATH=/opt/gst/plugins

you can alternatively set prefix to gstreamer default (for linux see here) output (depends on your system found SDKs)

sudo make install
[  9%] Built target gstklv-1.0-0
[ 18%] Built target gstbayerutils
[ 31%] Built target gstextractcolor
[ 50%] Built target gstklv
[ 68%] Built target gstmisb
[ 77%] Built target gstselect
[ 90%] Built target gstvideoadjust
[100%] Built target gstidsueye
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /opt/gst/plugins/lib/libgstklv-1.0-0.so
-- Up-to-date: /opt/gst/plugins/lib/gstreamer-1.0/libgstbayerutils.so
-- Up-to-date: /opt/gst/plugins/lib/gstreamer-1.0/libgstextractcolor.so
-- Up-to-date: /opt/gst/plugins/lib/gstreamer-1.0/libgstklv.so
-- Up-to-date: /opt/gst/plugins/lib/gstreamer-1.0/libgstmisb.so
-- Up-to-date: /opt/gst/plugins/lib/gstreamer-1.0/libgstselect.so
-- Up-to-date: /opt/gst/plugins/lib/gstreamer-1.0/libgstvideoadjust.so
-- Up-to-date: /opt/gst/plugins/lib/gstreamer-1.0/libgstidsueye.so

5shekel avatar Apr 15 '20 12:04 5shekel

@5shekel and @harendracmaps check #20 for install issue, pushed commit to linux which hopefully makes everyone happy.

joshdoe avatar Apr 15 '20 13:04 joshdoe

@joshdoe and @harendracmaps I downloaded and installed basler pylon viewer 6.1.3 and I changed the path in the Findpylon.cmake file to match the current folders. I also changed set(_PREFIX "/usr/lib/aarch64-linux-gnu") (originally it was "/usr/lib"). after that I did make, and sudo make install: [100%] Built target gstpylon Install the project... -- Install configuration: "" -- Installing: /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstbayerutils.so -- Installing: /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstextractcolor.so -- Installing: /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstmisb.so -- Installing: /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstselect.so -- Installing: /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideoadjust.so -- Installing: /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstpylon.so -- Set runtime path of "/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstpylon.so" to ""

But then when I check using gst-inspect-1.0 my pylon plugin doesn't appear and when I run: "gst-launch-1.0 -v pylonsrc ! videoconvert ! video/x-raw,format=I420 ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000" I get: "WARNING: erroneous pipeline: no element "pylonsrc""

Please help me, I've been working on this for way too long and I can't manage to figure it out. I'm working on a jetson nano. Thanks for your help. Ariel

ariel-elbit avatar Aug 04 '20 06:08 ariel-elbit

@ariel-elbit , have you tried running gst-inspect on the absolute path of the plugin? I'm not familiar with ARM, but I'm guessing you set the prefix to where all the other plugins are located. Bump up the debugging levels with environment variables like GST_DEBUG=*:3

You might be missing a dependency, Pylon modules are already in your library path?

joshdoe avatar Aug 04 '20 07:08 joshdoe