Libavcodec.so: undefined reference to `v4l2_open’

Hi,
This should also work:

  1. Execute configure command by adding -lv4l2 to –extra-libs

ffmpeg-4.2.2$ ./configure --enable-nvv4l2dec --enable-libv4l2 --enable-shared --extra-libs=“-lv4l2 -L/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils” --extra-cflags=“-I /usr/src/jetson_multimedia_api/include/”

  1. Build the package: $ make -j4
  2. Compile the sample with self-built libavcodec.so

ffmpeg-4.2.2$ g++ ffmpeg_test.cpp -Llibavformat/ -lavformat -Llibavcodec/ -lavcodec -o ffmpeg_test

2 Likes