e1z0 / jetson-frigate

Frigate on Jetson Nano research
50 stars 11 forks source link

jetson_ffmpeg build error #4

Open OttPeterR opened 2 years ago

OttPeterR commented 2 years ago

I spun up a fresh jetson image today and tried installing this repo. I've tried with the most recent version of docker (20) and downgraded to 19 because of some known issues. Downgrading got me passed a previous build error so I'm on docker 19.03.6 right now with containerd at 1.5.2 as well. (this issue) but everything else is up to date. I'm far from being a unix package guru, so hopefully the solution is obvious, just not to me at the moment.

OttPeterR@jetson-nano:~/frigate$ sudo make jetson_ffmpeg
docker build --tag blakeblackshear/frigate-ffmpeg:1.0.0-aarch64 --file docker/Dockerfile.ffmpeg.aarch64-jetson .
Sending build context to Docker daemon  1.578MB
Step 1/55 : FROM        balenalib/jetson-nano-ubuntu:latest AS base
 ---> 7ecd0c53e38e
Step 2/55 : WORKDIR     /tmp/workdir
 ---> Using cache
 ---> e09fe58f5084
Step 3/55 : ENV     DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> eb23270a37ea
Step 4/55 : RUN             echo '#!/bin/sh\nsu -c "$*"' > /usr/local/bin/sudo && chmod +x /usr/local/bin/sudo &&         apt-get -yqq update &&         mkdir -p /opt/nvidia/l4t-packages/ &&         touch /opt/nvidia/l4t-packages/.nv-l4t-disable-boot-fw-update-in-preinstall &&         echo "/usr/lib/aarch64-linux-gnu/tegra" > /etc/ld.so.conf.d/aarch64-linux-gnu_GL.conf && ldconfig &&         apt-get -yqq -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install         --no-install-recommends ca-certificates expat libgomp1 cmake git nvidia-l4t-core nvidia-l4t-jetson-multimedia-api wget &&         apt-get autoremove -y &&         apt-get clean -y
 ---> Running in 37914c45a5bf
Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/):
Architecture: ARM v8
OS: Ubuntu focal
Variant: run variant
Default variable(s): UDEV=off
Extra features:
- Easy way to install packages with `install_packages <package-name>` command
- Run anywhere with cross-build feature  (for ARM only)
- Keep the container idling with `balena-idle` command
- Show base image details with `balena-info` command

E: Unable to correct problems, you have held broken packages.

The command '/bin/sh -c echo '#!/bin/sh\nsu -c "$*"' > /usr/local/bin/sudo && chmod +x /usr/local/bin/sudo &&         apt-get -yqq update &&         mkdir -p /opt/nvidia/l4t-packages/ &&         touch /opt/nvidia/l4t-packages/.nv-l4t-disable-boot-fw-update-in-preinstall &&         echo "/usr/lib/aarch64-linux-gnu/tegra" > /etc/ld.so.conf.d/aarch64-linux-gnu_GL.conf && ldconfig &&         apt-get -yqq -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install         --no-install-recommends ca-certificates expat libgomp1 cmake git nvidia-l4t-core nvidia-l4t-jetson-multimedia-api wget &&         apt-get autoremove -y &&         apt-get clean -y' returned a non-zero code: 100
Makefile:39: recipe for target 'jetson_ffmpeg' failed
make: *** [jetson_ffmpeg] Error 100
magnusnordlander commented 2 years ago

This is because balenalib/jetson-nano-ubuntu:latest has been updated to Ubuntu focal instead of bionic. There's also an issue with the URL for freetype 2.5.5. I'm working through installing everything and will submit a PR when I've got it up and running.

dadaloop82 commented 2 years ago

I have the (provisional) solution. Tested on Jetson Nano 2Gb

After "Download docker build files and replace them"

/frigate/docker/Dockerfile.ffmpeg.aarch64-jetson

change row 6 to FROM balenalib/jetson-nano-ubuntu:bionic AS base change row 29 to _FREETYPEVERSION=2.11.0 change row 54 to _ARG FREETYPESHA256SUM="a45c6b403413abd5706f3582f04c8339d26397c4304b78fa552f2215df64101f freetype-2.11.0.tar.gz"

the follow the guide, execute:

follow the guide (https://github.com/e1z0/jetson-frigate)

So it should work.

OttPeterR commented 2 years ago

Following those steps I was able to build successfully, so thats awesome and thanks for the work!

I'm hitting an issue when I launch unfortunately:


[+] Running 2/2                                                                                                 
 ⠿ Network my_frigate_default  Created                                                                     0.1s 
 ⠿ Container frigate           Created                                                                     0.1s 
Attaching to frigate                                                                                            
frigate  | ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers                                   
frigate  |   built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)                                              
frigate  |   configuration: --enable-nvmpi --disable-debug --disable-doc --disable-ffplay --enable-shared --ena$
le-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-$
ibvidstab --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-li
bwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --ena
ble-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/op
t/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-v4l2_m2m --ena
ble-neon --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
frigate  |   libavutil      56. 51.100 / 56. 51.100
frigate  |   libavcodec     58. 91.100 / 58. 91.100
frigate  |   libavformat    58. 45.100 / 58. 45.100
frigate  |   libavdevice    58. 10.100 / 58. 10.100
frigate  |   libavfilter     7. 85.100 /  7. 85.100
frigate  |   libavresample   4.  0.  0 /  4.  0.  0
frigate  |   libswscale      5.  7.100 /  5.  7.100
frigate  |   libswresample   3.  7.100 /  3.  7.100
frigate  |   libpostproc    55.  7.100 / 55.  7.100
frigate  | nvbuf_utils: Could not get EGL display connection
frigate  | Hyper fast Audio and Video encoder
frigate  | usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
frigate  |

With some searching it seems that the EGL error message comes with running in headless mode, which is what I'm doing. I'm not versed in anything Jetson unfortunately so I can be of much help here. But if I could help by testing anything let me know!

cryptoer-satoshi commented 6 months ago

Hello guys would you please help me Step 45/55 : RUN DIR=/tmp/libxcb-proto && mkdir -p ${DIR} && cd ${DIR} && curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && ./configure --prefix="${PREFIX}" && make -j $(nproc) && make -j $(nproc) install && rm -rf ${DIR} ---> Running in 3e8d25d2295f The command '/bin/sh -c DIR=/tmp/libxcb-proto && mkdir -p ${DIR} && cd ${DIR} && curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && ./configure --prefix="${PREFIX}" && make -j $(nproc) && make -j $(nproc) install && rm -rf ${DIR}' returned a non-zero code: 6 make: *** [Makefile:39: jetson_ffmpeg] Error 6