Running multimedia_api sample for jetson nano

I try to run a jpeg_encode sample of multimedia_api.
When I built it, I got following messages.
How can I solve it?

Compiling: jpeg_encode_csvparser.cpp
Compiling: jpeg_encode_main.cpp
make[1]: Entering directory ‘/home/eow/jetson_multimedia_api/samples/common/classes’
Compiling: NvElementProfiler.cpp
Compiling: NvElement.cpp
<…>
Compiling: NvV4l2ElementPlane.cpp
Compiling: NvV4l2Element.cpp
make[1]: Leaving directory ‘/home/eow/jetson_multimedia_api/samples/common/classes’
Linking: jpeg_encode
/usr/bin/ld: cannot find -lv4l2
collect2: error: ld returned 1 exit status
Makefile:52: recipe for target ‘jpeg_encode’ failed
make: *** [jpeg_encode] Error 1

Hi,
Suggest you install through SDKManager. The samples are put in

/usr/src/jetson_multimedia_api

and compiled.

1 Like

Dear DaneLLL,

I installed multumedia_api through SDK_manager again,
I received the same error messages like below.

eow@eow-rt:/usr/src/jetson_multimedia_api$ sudo make
Make in samples/00_video_decode
make[1]: Entering directory ‘/usr/src/jetson_multimedia_api/samples/00_video_decode’
Linking: video_decode
/usr/bin/ld: cannot find -lv4l2
collect2: error: ld returned 1 exit status
Makefile:52: recipe for target ‘video_decode’ failed
make[1]: *** [video_decode] Error 1
make[1]: Leaving directory ‘/usr/src/jetson_multimedia_api/samples/00_video_decode’
Makefile:53: recipe for target ‘all’ failed
make: *** [all] Error 1

Hi,
Please manually install the package:

$ sudo apt update

$ sudo apt install v4l-utilslibv4l-dev

Thanks for quick answer,
But I received same error message again.

eow@eow-rt:~$ sudo apt update
[sudo] password for eow:
받기:1 file:/var/cuda-repo-10-0-local-10.0.326 InRelease
무시:1 file:/var/cuda-repo-10-0-local-10.0.326 InRelease
받기:2 file:/var/visionworks-repo InRelease
무시:2 file:/var/visionworks-repo InRelease
<…>
받기:31 http://ports.ubuntu.com/ubuntu-ports bionic-security/universe DEP-11 64x64 Icons [116 kB]
내려받기 1,962 k바이트, 소요시간 10초 (195 k바이트/초)
패키지 목록을 읽는 중입니다… 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다… 완료
299 packages can be upgraded. Run ‘apt list --upgradable’ to see them.

eow@eow-rt:~ sudo apt install v4l-utils 패키지 목록을 읽는 중입니다... 완료 의존성 트리를 만드는 중입니다 상태 정보를 읽는 중입니다... 완료 v4l-utils is already the newest version (1.14.2-1). 다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다: apt-clone archdetect-deb bogl-bterm busybox-static cryptsetup-bin dpkg-repack gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 grub-common kde-window-manager kinit kio kpackagetool5 kwayland-data kwin-common kwin-data kwin-x11 libdebian-installer4 libkdecorations2-5v5 libkdecorations2private5v5 libkf5activities5 libkf5attica5 libkf5completion-data libkf5completion5 libkf5declarative-data libkf5declarative5 libkf5doctools5 libkf5globalaccel-data libkf5globalaccel5 libkf5globalaccelprivate5 libkf5idletime5 libkf5jobwidgets-data libkf5jobwidgets5 libkf5kcmutils-data libkf5kcmutils5 libkf5kiocore5 libkf5kiontlm5 libkf5kiowidgets5 libkf5newstuff-data libkf5newstuff5 libkf5newstuffcore5 libkf5package-data libkf5package5 libkf5plasma5 libkf5quickaddons5 libkf5solid5 libkf5solid5-data libkf5sonnet5-data libkf5sonnetcore5 libkf5sonnetui5 libkf5textwidgets-data libkf5textwidgets5 libkf5waylandclient5 libkf5waylandserver5 libkf5xmlgui-bin libkf5xmlgui-data libkf5xmlgui5 libkscreenlocker5 libkwin4-effect-builtins1 libkwineffects11 libkwinglutils11 libkwinxrenderutils11 libqgsttools-p1 libqt5designer5 libqt5help5 libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediaquick-p5 libqt5multimediawidgets5 libqt5opengl5 libqt5positioning5 libqt5printsupport5 libqt5qml5 libqt5quick5 libqt5quickwidgets5 libqt5sensors5 libqt5sql5 libqt5test5 libqt5webchannel5 libqt5webkit5 libxcb-composite0 libxcb-cursor0 libxcb-damage0 os-prober python3-dbus.mainloop.pyqt5 python3-icu python3-pam python3-pyqt5 python3-pyqt5.qtsvg python3-pyqt5.qtwebkit python3-sip qml-module-org-kde-kquickcontrolsaddons qml-module-qtmultimedia qml-module-qtquick2 rdate tasksel tasksel-data Use 'sudo apt autoremove' to remove them. 0개 업그레이드, 0개 새로 설치, 0개 제거 및 299개 업그레이드 안 함. eow@eow-rt:~ cd /usr/src/
eow@eow-rt:/usr/src$ ls
cudnn_samples_v7 linux-headers-4.9.140-tegra-linux_x86_64 nvidia
jetson_multimedia_api linux-headers-4.9.140-tegra-ubuntu18.04_aarch64 tensorrt
eow@eow-rt:/usr/src$ cd jetson_multimedia_api/

eow@eow-rt:/usr/src/jetson_multimedia_api$ sudo make
Make in samples/00_video_decode
make[1]: Entering directory ‘/usr/src/jetson_multimedia_api/samples/00_video_decode’
Linking: video_decode
/usr/bin/ld: cannot find -lv4l2
collect2: error: ld returned 1 exit status
Makefile:52: recipe for target ‘video_decode’ failed
make[1]: *** [video_decode] Error 1
make[1]: Leaving directory ‘/usr/src/jetson_multimedia_api/samples/00_video_decode’
Makefile:53: recipe for target ‘all’ failed
make: *** [all] Error 1

Hi,
The package should be libv4l-dev
I have corrected it. Sorry for the confusion.

It works well after installing ‘libv4l-dev’
Your comments were very helpful to me.
Thanks.

1 Like