Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
FFMPEG doesn't have webam support (v4l2) [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
pyritepyro
n00b
n00b


Joined: 12 Nov 2024
Posts: 5

PostPosted: Tue Nov 12, 2024 12:14 am    Post subject: FFMPEG doesn't have webam support (v4l2) [SOLVED] Reply with quote

I've got libv4l2 in my USE flags, and for some reason FFMPEG isn't compiling with support for capturing from v4l2 for my webcam.

Will I need to download source and compile separately or is there something I can do within portage to make this build the way I want it to be able to access the webcam from the command line? I am using a script that I developed on Fedora and Debian which don't have --disable-libv4l2 in the configuration options.


Last edited by pyritepyro on Tue Nov 12, 2024 1:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
Shadow_Fury
Apprentice
Apprentice


Joined: 20 Apr 2021
Posts: 196
Location: 11.435765792823453, 143.05926743686274

PostPosted: Tue Nov 12, 2024 12:27 am    Post subject: Re: FFMPEG doesn't have webam support (v4l2) Reply with quote

pyritepyro wrote:
I've got libv4l2 in my USE flags

libv4l2 is not a use flag for ffmpeg (see here). the closest is "libv4l". double check that you've got the right flag
Back to top
View user's profile Send private message
pyritepyro
n00b
n00b


Joined: 12 Nov 2024
Posts: 5

PostPosted: Tue Nov 12, 2024 12:42 am    Post subject: Re: FFMPEG doesn't have webam support (v4l2) Reply with quote

Shadow_Fury wrote:
pyritepyro wrote:
I've got libv4l2 in my USE flags

libv4l2 is not a use flag for ffmpeg (see here). the closest is "libv4l". double check that you've got the right flag


I did notice that, and had build errors when I tried to set it. That said the underlying software does support the library, and I'm just trying to determine if I need to do a manual build instead of using portage, which would be frankly annoying and probably may bresult in a distro hop since I got this machine explicitly to use for the webcam and installed Gentoo because it's potato spec.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22768

PostPosted: Tue Nov 12, 2024 2:19 am    Post subject: Reply with quote

Welcome to the forums. Going outside Portage is almost certainly the wrong solution. Anything you can fix by doing so can also be fixed within the ebuild framework, and keeping the build within Portage will ease system maintenance over the long term.

Beyond that, you have given us nothing with which we can help you. "Build errors" is vague. When the build failed, Portage should have printed specific instructions on what to share. Please follow them.
Back to top
View user's profile Send private message
pyritepyro
n00b
n00b


Joined: 12 Nov 2024
Posts: 5

PostPosted: Tue Nov 12, 2024 7:23 am    Post subject: Reply with quote

Hu wrote:
Welcome to the forums. Going outside Portage is almost certainly the wrong solution. Anything you can fix by doing so can also be fixed within the ebuild framework, and keeping the build within Portage will ease system maintenance over the long term.

Beyond that, you have given us nothing with which we can help you. "Build errors" is vague. When the build failed, Portage should have printed specific instructions on what to share. Please follow them.


There are no directions. it just tells me it can't meed depenency requirements:

Code:
$ sudo emerge --newuse --deep ffmpeg

 * IMPORTANT: 24 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


 * IMPORTANT: 2 config files in '/etc/portage' need updating.
 * See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS
 * sections of the emerge man page to learn how to update config files.
Calculating dependencies \

!!! Problem resolving dependencies for media-video/ffmpeg
... done!
Dependency resolution took 2.94 s (backtrack: 0/20).


!!! The ebuild selected to satisfy "ffmpeg" has unmet requirements.
- media-video/ffmpeg-6.1.1-r8::gentoo USE="X alsa amr amrenc bs2b bzip2 codec2 cpudetection dav1d encode fdk flite fribidi gcrypt gme gnutls gpl iconv lcms libaribb24 libdrm libilbc libplacebo librtmp libsoxr libtesseract libv4l libxml2 lv2 mp3 network opengl openh264 openssl pic postproc pulseaudio rav1e rubberband sdl snappy sndio soc srt ssh svg svt-av1 theora threads truetype twolame vidstab vorbis vpx vulkan x264 x265 xvid zeromq zimg zlib zvbi -amf (-appkit) -bluray -cdio -chromaprint -chromium (-cuda) -debug -doc -fontconfig -frei0r -glslang -gmp -gsm -hardcoded-tables -iec61883 -ieee1394 -jack -jpeg2k -jpegxl -kvazaar -ladspa -libaom -libass -libcaca -lzma (-mipsdspr1) (-mipsdspr2) (-mipsfpu) -modplug -nvenc -openal -opencl -opus -oss (-qsv) -samba -shaderc -speex -static-libs -test -v4l -vaapi -vdpau -verify-sig (-vmaf) -webp" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="aes mmx mmxext sse sse2 sse3 sse4_1 sse4_2 ssse3 -3dnow -3dnowext -avx -avx2 -fma3 -fma4 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher"

  The following REQUIRED_USE flag constraints are unsatisfied:
    libv4l? ( v4l )

  The above constraints are a subset of the following complete expression:
    chromium? ( opus ) cuda? ( nvenc ) fftools_cws2fws? ( zlib ) glslang? ( vulkan !shaderc ) libv4l? ( v4l ) shaderc? ( vulkan !glslang ) soc? ( libdrm ) test? ( encode ) postproc? ( gpl ) frei0r? ( gpl ) cdio? ( gpl ) rubberband? ( gpl ) vidstab? ( gpl ) samba? ( gpl ) encode? ( x264? ( gpl ) x265? ( gpl ) xvid? ( gpl ) ) arm64? ( cpu_flags_arm_v8 ) cpu_flags_arm_v8? ( cpu_flags_arm_vfpv3 cpu_flags_arm_neon ) cpu_flags_arm_neon? ( cpu_flags_arm_vfp arm? ( cpu_flags_arm_thumb2 ) ) cpu_flags_arm_vfpv3? ( cpu_flags_arm_vfp ) cpu_flags_arm_thumb2? ( cpu_flags_arm_v6 ) cpu_flags_arm_v6? ( arm? ( cpu_flags_arm_thumb ) ) cpu_flags_ppc_vsx? ( cpu_flags_ppc_altivec ) cpu_flags_ppc_vsx2? ( cpu_flags_ppc_vsx ) cpu_flags_x86_avx2? ( cpu_flags_x86_avx ) cpu_flags_x86_fma4? ( cpu_flags_x86_avx ) cpu_flags_x86_fma3? ( cpu_flags_x86_avx ) cpu_flags_x86_xop? ( cpu_flags_x86_avx ) cpu_flags_x86_avx? ( cpu_flags_x86_sse4_2 ) cpu_flags_x86_aes? ( cpu_flags_x86_sse4_2 ) cpu_flags_x86_sse4_2? ( cpu_flags_x86_sse4_1 ) cpu_flags_x86_sse4_1? ( cpu_flags_x86_ssse3 ) cpu_flags_x86_ssse3? ( cpu_flags_x86_sse3 ) cpu_flags_x86_sse3? ( cpu_flags_x86_sse2 ) cpu_flags_x86_sse2? ( cpu_flags_x86_sse ) cpu_flags_x86_sse? ( cpu_flags_x86_mmxext ) cpu_flags_x86_mmxext? ( cpu_flags_x86_mmx ) cpu_flags_x86_3dnowext? ( cpu_flags_x86_3dnow ) cpu_flags_x86_3dnow? ( cpu_flags_x86_mmx )


If I don't include that use flag then ffmpeg builds, but the configure line is:

Code:
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-6.1.1-r8/html --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --nm=x86_64-pc-linux-gnu-nm --strip=x86_64-pc-linux-gnu-strip --ranlib=x86_64-pc-linux-gnu-ranlib --pkg-config=x86_64-pc-linux-gnu-pkg-config --optflags='-march=native -O2 -pipe' --disable-static --disable-libaribcaption --enable-avfilter --disable-stripping --disable-optimizations --disable-libcelt --enable-v4l2-request --enable-libudev --enable-sand --enable-nonfree --enable-version3 --disable-indev=v4l2 --disable-outdev=v4l2 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-version3 --enable-version3 --enable-nonfree --enable-bzlib --enable-runtime-cpudetect --disable-debug --enable-gcrypt --enable-gnutls --disable-gmp --enable-gpl --disable-hardcoded-tables --enable-iconv --enable-libxml2 --disable-lzma --enable-network --disable-opencl --enable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --disable-vaapi --disable-vdpau --enable-vulkan --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --enable-opengl --disable-libv4l2 --enable-libpulse --enable-libdrm --disable-libjack --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-libcodec2 --enable-libdav1d --enable-libfdk-aac --disable-libopenjpeg --disable-libjxl --disable-libbluray --enable-libgme --disable-libgsm --enable-libaribb24 --disable-libmodplug --disable-libopus --disable-libvpl --enable-libilbc --enable-librtmp --enable-libssh --disable-libspeex --enable-libsrt --enable-librsvg --disable-ffnvcodec --enable-libvorbis --enable-libvpx --enable-libzvbi --disable-appkit --enable-libbs2b --disable-chromaprint --disable-cuda-llvm --enable-libflite --disable-fontconfig --disable-frei0r --enable-libfribidi --disable-libglslang --disable-ladspa --enable-lcms2 --disable-libass --enable-libplacebo --enable-libtesseract --enable-lv2 --enable-librubberband --disable-libshaderc --enable-libfreetype --enable-libharfbuzz --enable-libvidstab --disable-libvmaf --enable-libzmq --enable-libzimg --enable-libsoxr --enable-pthreads --disable-amf --enable-libvo-amrwbenc --disable-libkvazaar --disable-libaom --enable-libmp3lame --enable-libopenh264 --enable-librav1e --enable-libsnappy --enable-libsvtav1 --enable-libtheora --enable-libtwolame --disable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --disable-gnutls --enable-version3 --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-vfpv3 --disable-armv8 --disable-dotprod --disable-i8mm --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-vsx --disable-power8 --disable-amd3dnow --disable-amd3dnowext --disable-avx --disable-avx2 --disable-fma3 --disable-fma4 --disable-xop --enable-pic --cpu=host --disable-doc --disable-htmlpages --enable-manpages


Which explicitly disables v4l2 which is the current API for accessing webcam and other capture devices.

As far as I know v4l version 1 is no longer supported by anyone, and I have to wonder why v4l2 is disabled in the configure line for this application, which is why I am even considering moving outside of the ebuild structure as libv4l2 is enabled and built on my system and is working fine in other programs that capture webcam input such as Cheese. I prefer FFMPEG for such capture as it allows for other manipulation at the same time, and because as a command line program I can tie multiple terminals together in tmux to start and stop different recording streams at the same time.

[Administrator edit: added [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3446
Location: Canada

PostPosted: Tue Nov 12, 2024 7:46 am    Post subject: Reply with quote

The error says that if you include libv4l flag, you should also enable v4l flag.

BTW libv4l causes dependence on media-libs/libv4l-1.28.1 which does support v4l2 as far as I see.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22768

PostPosted: Tue Nov 12, 2024 12:05 pm    Post subject: Reply with quote

pyritepyro wrote:
Hu wrote:
Beyond that, you have given us nothing with which we can help you. "Build errors" is vague. When the build failed, Portage should have printed specific instructions on what to share. Please follow them.

There are no directions. it just tells me it can't meed depenency requirements:
That is not a build error, then. A build error would be if the package started to build, then failed. In this case, Portage explicitly refused to build a configuration known not to work. By showing the full output of the failure, you made clear what is happening, and enabled us to help you.
pyritepyro wrote:

If I don't include that use flag then ffmpeg builds, but the configure line is:

Which explicitly disables v4l2 which is the current API for accessing webcam and other capture devices.

As far as I know v4l version 1 is no longer supported by anyone, and I have to wonder why v4l2 is disabled in the configure line for this application

Yes, v4l version 1 is obsolete. However, some people may have no use for v4l version 2, and prefer to have an ffmpeg that completely lacks v4l support over being required to build v4l2 support that they will not use. That is why Portage allows you to set USE=-v4l on this package. You are not one of those people, so you want USE=v4l on this package.
Back to top
View user's profile Send private message
pyritepyro
n00b
n00b


Joined: 12 Nov 2024
Posts: 5

PostPosted: Tue Nov 12, 2024 2:06 pm    Post subject: resolved! Reply with quote

Ok, so the refusal to build had me confused. the v4l and libv4l flags are package specific (as with just libv4l2 in global USE flags other packages built with support without problem.) so it was rather specific. I didn't include the emerge error on my first reply as I was on my phone and didn't think to switch to the computer having the problem to be able to copy and paste. It works as expected now.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3446
Location: Canada

PostPosted: Tue Nov 12, 2024 6:40 pm    Post subject: Re: resolved! Reply with quote

pyritepyro wrote:
Ok, so the refusal to build had me confused. the v4l and libv4l flags are package specific (as with just libv4l2 in global USE flags other packages built with support without problem.) so it was rather specific. I didn't include the emerge error on my first reply as I was on my phone and didn't think to switch to the computer having the problem to be able to copy and paste. It works as expected now.



Gentoo strives to have uniformity for naming USE variables, but you do find from time to time that the same functionality is called differently between the packages, especially when concurrent different versions are concerned.
One example is gtk2 gtk3 and plain gtk USE flags, especially in the past. What gtk meant, gtk2 or gtk3 or both, depended on the package.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum