install v4l2_codec

114 views
Skip to first unread message

Alex LanS

unread,
May 10, 2023, 10:47:35 AM5/10/23
to baresip
Hello.

I want to install baresip stable version, but cant find info - how install v4l2_codec?
and auloop;vidloop ?
I am doing like this

wget -O re.v3.00.0.tar.gz https://github.com/baresip/re/archive/refs/tags/v3.0.0.zip
unzip re.v3.00.0.tar.gz
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j4
sudo cmake --install build
sudo ldconfig

wget -O baresip.v3.00.0.tar.gz https://github.com/baresip/baresip/archive/refs/tags/v3.0.0.zip
unzip baresip.v3.00.0.tar.gz
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j4
sudo cmake --install build

As i understand - i shold add at cmke with option -DAPP_MODULES="auloop;vidloop" or -DEXTRA_MODULES="v4l2_codec"
If i do this - i got erorr:
=====
CMake Error at CMakeLists.txt:200 (add_subdirectory):
  add_subdirectory given source "modules/v4l2_codec" which is not an existing
  directory.
CMake Error at CMakeLists.txt:201 (set_target_properties):
  set_target_properties Can not find target to add properties to: v4l2_codec
CMake Error at CMakeLists.txt:361 (install):
  install TARGETS given target "v4l2_codec" which does not exist.
=====
CMake Error at CMakeLists.txt:205 (add_subdirectory):
  add_subdirectory given source "/auloop" which is not an existing directory.
CMake Error at CMakeLists.txt:209 (set_target_properties):
  set_target_properties Can not find target to add properties to: auloop
CMake Error at CMakeLists.txt:205 (add_subdirectory):
  add_subdirectory given source "/vidloop" which is not an existing
  directory.
CMake Error at CMakeLists.txt:209 (set_target_properties):
  set_target_properties Can not find target to add properties to: vidloop
CMake Error at CMakeLists.txt:361 (install):
  install TARGETS given target "auloop" which does not exist.
CMake Error at CMakeLists.txt:361 (install):
  install TARGETS given target "vidloop" which does not exist.
-- Configuring incomplete, errors occurred!

Does version 3000 have this iptions?

anygizer

unread,
May 25, 2023, 5:26:55 AM5/25/23
to baresip
Under Debian/Ubunut install "libv4l-dev"

Alex LanS

unread,
May 25, 2023, 5:58:42 AM5/25/23
to baresip
Hello. This is installed - but no vidloop and v4l2_codec.

четверг, 25 мая 2023 г. в 12:26:55 UTC+3, anygizer:

anygizer

unread,
May 25, 2023, 1:42:06 PM5/25/23
to baresip
Okey. I would clone the repo so you get the latest version (also the libre repo), current 3.1.0, works really good, if you dont insist to you use version 3.0.0.

Then install the necessary libraries, for a standard operation for telephone call, audio codecs, etc.

apt-get update && sudo apt-get install -y libasound2-dev libavcodec-dev  libavdevice-dev  libavformat-dev libcodec2-dev libfdk-aac-dev libglib2.0-dev libgstreamer1.0-dev libgtk-3-dev libjack-jackd2-dev libmosquitto-dev libmpg123-dev libopencore-amrnb-dev libopencore-amrwb-dev libopus-dev libpulse-dev libsndfile1-dev libspandsp-dev libssl-dev libvpx-dev libx11-dev libwebrtc-audio-processing-dev

plus, libv4l-dev.

Compile libre first, then baresip.

Alex LanS

unread,
May 29, 2023, 3:35:42 AM5/29/23
to baresip
Sorry, but after all this i gave got error

[ 56%] Building C object modules/avcodec/CMakeFiles/avcodec.dir/avcodec.c.o
In file included from /home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:12:0:
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.h:16:13: warning: ISO C forbids forward references to ‘enum’ types [-Wpedantic]
 extern enum AVHWDeviceType avcodec_hw_type;
             ^~~~~~~~~~~~~~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:50:6: warning: ISO C forbids forward references to ‘enum’ types [-Wpedantic]
 enum AVHWDeviceType avcodec_hw_type = AV_HWDEVICE_TYPE_NONE;
      ^~~~~~~~~~~~~~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:50:6: error: variable ‘avcodec_hw_type’ has initializer but incomplete type
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:50:39: error: ‘AV_HWDEVICE_TYPE_NONE’ undeclared here (not in a function); did you mean ‘AV_PICTURE_TYPE_NONE’?
 enum AVHWDeviceType avcodec_hw_type = AV_HWDEVICE_TYPE_NONE;
                                       ^~~~~~~~~~~~~~~~~~~~~
                                       AV_PICTURE_TYPE_NONE
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c: In function ‘module_init’:
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:158:8: warning: ISO C forbids forward references to ‘enum’ types [-Wpedantic]
   enum AVHWDeviceType type;
        ^~~~~~~~~~~~~~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:158:23: error: storage size of ‘type’ isn’t known
   enum AVHWDeviceType type;
                       ^~~~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:163:10: warning: implicit declaration of function ‘av_hwdevice_find_type_by_name’; did you mean ‘avcodec_find_encoder_by_name’? [-Wimplicit-function-declaration]
   type = av_hwdevice_find_type_by_name(hwaccel);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          avcodec_find_encoder_by_name
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:163:10: warning: nested extern declaration of ‘av_hwdevice_find_type_by_name’ [-Wnested-externs]
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:170:19: warning: implicit declaration of function ‘av_hwdevice_iterate_types’; did you mean ‘avcodec_get_type’? [-Wimplicit-function-declaration]
    while ((type = av_hwdevice_iterate_types(type))
                   ^~~~~~~~~~~~~~~~~~~~~~~~~
                   avcodec_get_type
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:170:19: warning: nested extern declaration of ‘av_hwdevice_iterate_types’ [-Wnested-externs]
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:173:10: warning: implicit declaration of function ‘av_hwdevice_get_type_name’; did you mean ‘avcodec_get_name’? [-Wimplicit-function-declaration]
          av_hwdevice_get_type_name(type));
          ^~~~~~~~~~~~~~~~~~~~~~~~~
          avcodec_get_name
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:173:10: warning: nested extern declaration of ‘av_hwdevice_get_type_name’ [-Wnested-externs]
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:180:10: error: unknown type name ‘AVCodecHWConfig’
    const AVCodecHWConfig *config;
          ^~~~~~~~~~~~~~~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:182:13: warning: implicit declaration of function ‘avcodec_get_hw_config’; did you mean ‘avcodec_get_name’? [-Wimplicit-function-declaration]
    config = avcodec_get_hw_config(avcodec_h264dec, i);
             ^~~~~~~~~~~~~~~~~~~~~
             avcodec_get_name
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:182:13: warning: nested extern declaration of ‘avcodec_get_hw_config’ [-Wnested-externs]
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:182:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
    config = avcodec_get_hw_config(avcodec_h264dec, i);
           ^
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:190:14: error: request for member ‘methods’ in something not a structure or union
    if (config->methods
              ^~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:191:10: error: ‘AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX’ undeclared (first use in this function)
        & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:191:10: note: each undeclared identifier is reported only once for each function it appears in
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:193:14: error: request for member ‘device_type’ in something not a structure or union
        config->device_type == type) {
              ^~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:195:32: error: request for member ‘pix_fmt’ in something not a structure or union
     avcodec_hw_pix_fmt = config->pix_fmt;
                                ^~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:199:36: error: request for member ‘pix_fmt’ in something not a structure or union
          av_get_pix_fmt_name(config->pix_fmt));
                                    ^~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:204:9: warning: implicit declaration of function ‘av_hwdevice_ctx_create’; did you mean ‘av_dict_free’? [-Wimplicit-function-declaration]
   ret = av_hwdevice_ctx_create(&avcodec_hw_device_ctx, type,
         ^~~~~~~~~~~~~~~~~~~~~~
         av_dict_free
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:204:9: warning: nested extern declaration of ‘av_hwdevice_ctx_create’ [-Wnested-externs]
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:212:19: error: ‘avcodec_hw_type’ has an incomplete type ‘enum AVHWDeviceType’
   avcodec_hw_type = type;
                   ^
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:158:23: warning: unused variable ‘type’ [-Wunused-variable]
   enum AVHWDeviceType type;
                       ^~~~
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c: At top level:
/home/pi/baresip-3.1.0/modules/avcodec/avcodec.c:50:21: error: storage size of ‘avcodec_hw_type’ isn’t known
 enum AVHWDeviceType avcodec_hw_type = AV_HWDEVICE_TYPE_NONE;
                     ^~~~~~~~~~~~~~~
modules/avcodec/CMakeFiles/avcodec.dir/build.make:75: recipe for target 'modules/avcodec/CMakeFiles/avcodec.dir/avcodec.c.o' failed
make[2]: *** [modules/avcodec/CMakeFiles/avcodec.dir/avcodec.c.o] Error 1
CMakeFiles/Makefile2:2481: recipe for target 'modules/avcodec/CMakeFiles/avcodec.dir/all' failed
make[1]: *** [modules/avcodec/CMakeFiles/avcodec.dir/all] Error 2
Makefile:155: recipe for target 'all' failed
make: *** [all] Error 2

четверг, 25 мая 2023 г. в 20:42:06 UTC+3, anygizer:

anygizer

unread,
May 29, 2023, 4:40:55 AM5/29/23
to baresip
This looks like an compiler issue, for underlying type, enum is a C++11 language feature I think, I'm not sure.

Alex LanS

unread,
May 29, 2023, 4:54:42 AM5/29/23
to baresip
This is ubuntu 18. I cant use another ubuntu. So may i can update some software. What you think i need update?

root-NanoPi-Duo2:~/baresip-3.1.0# cmake -version
cmake version 3.20.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).
root-NanoPi-Duo2:~/baresip-3.1.0# uname -a
Linux NanoPi-Duo2 3.4.39-h3 #34 SMP PREEMPT Tue Dec 18 15:20:42 CST 2018 armv7l armv7l armv7l GNU/Linux
root-NanoPi-Duo2:~/baresip-3.1.0# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.6 LTS
Release: 18.04
Codename: bionic



понедельник, 29 мая 2023 г. в 11:40:55 UTC+3, anygizer:

anygizer

unread,
May 30, 2023, 3:36:58 AM5/30/23
to baresip
Ok, youre using some kind of "3rd party" cmake. I would uninstall that, and install cmake from APT package manager.

Try and install: "apt-get update && apt-get install -y cmake build-essential" and install any other dependencies, libraries, binaries, etc.

Alex LanS

unread,
Jun 2, 2023, 1:54:14 AM6/2/23
to baresip
I am installing cmake this way

wget https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3.tar.gz
tar -zxvf cmake-3.26.3.tar.gz
cd cmake-3.26.3
./bootstrap
make
sudo make install

sudo ln -s /usr/local/bin/cmake /usr/bin
sudo ln -s /usr/local/bin/ctest /usr/bin
sudo ln -s /usr/local/bin/cpack /usr/bin

Because ubuntu 16 have old cmake(.

вторник, 30 мая 2023 г. в 10:36:58 UTC+3, anygizer:

Alex LanS

unread,
Jun 2, 2023, 2:02:22 AM6/2/23
to baresip
Sorry, i mean ubuntu 18

пт, 2 черв. 2023 р. о 08:54 Alex LanS <alex...@gmail.com> пише:
--
You received this message because you are subscribed to a topic in the Google Groups "baresip" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/baresip/RXWA_UvUQvQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to baresip+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/baresip/4cc21466-fa3d-42aa-96b9-20ca1cc18862n%40googlegroups.com.

Alex LanS

unread,
May 5, 2025, 3:47:33 PMMay 5
to baresip
Hello. I return to the project.
Rigt now i use latest v3.22.0 version with latest rasp os anr compute module 4.
On this system i use libcamera with "libcamerify baresip" with rasp camera v2 and 3 and "baresip" with usb grandstream camera.
As i understand i can use granstream camera h264 encoder which can do 1080px30fps. Based on coment https://github.com/baresip/baresip/issues/811#issuecomment-541330021  v4l2_codec.so should only be used if you know that your camera has
a build-in H264 encoder.

But o cant find this v4l2_codec nowhere. I create discuss https://github.com/baresip/baresip/issues/3371 
пʼятниця, 2 червня 2023 р. о 09:02:22 UTC+3 Alex LanS пише:
Reply all
Reply to author
Forward
0 new messages