Bug 194734

Summary: multimedia/ffmpeg24 doesn't capture video from webcam
Product: Ports & Packages Reporter: borius
Component: Individual Port(s)Assignee: Hans Petter Selasky <hselasky>
Status: Closed FIXED    
Severity: Affects Some People CC: hselasky, pg, riggs
Priority: --- Flags: borius: maintainer-feedback? (riggs)
Version: Latest   
Hardware: amd64   
OS: Any   

Description borius 2014-11-01 09:11:35 UTC
try to capture video from a USB camera but it won't work. I installed webcamd, ffmpeg24, pwcview. The pwcview successfully got picture from the USB camera but ffmpeg can't do it.

root@:~ # setenv LD_PRELOAD /usr/local/lib/libv4l/v4l1compat.so 
root@:~ # ffmpeg24 -s 320x240 -r 15 -f v4l2 -i /dev/video0 test.avi
ffmpeg version 2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct 31 2014 21:03:33 with FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
  configuration: --disable-libaacplus --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libass --disable-libcdio --disable-libcelt --disable-libfaac --disable-libfdk-aac --enable-ffserver --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-iconv --disable-indev=jack --disable-libmp3lame --disable-libbluray --enable-libv4l2 --disable-libmodplug --disable-openal --disable-indev=openal --enable-libopencv --enable-libopenjpeg --disable-libopus --enable-libpulse --disable-librtmp --enable-libschroedinger --disable-libspeex --enable-libtheora --disable-vaapi --disable-vdpau --enable-libvorbis --disable-libvo-aacenc --disable-libvo-amrwbenc --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg24 --docdir=/usr/local/share/doc/ffmpeg24 --incdir=/usr/local/include/ffmpeg24 --libdir=/usr/local/lib/ffmpeg24 --shlibdir=/usr/local/lib/ffmpeg24 --build-suffix=24 --enable-shared --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-memalign-hack --disable-libstagefright-h264 --disable-libutvideo --disable-libsoxr --cc=cc --extra-cflags='-msse -I/usr/local/include/vorbis -I/usr/local/include' --extra-ldflags='-L/usr/local/lib ' --extra-libs=-pthread --disable-debug --disable-ffplay --disable-outdev=sdl
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[video4linux2,v4l2 @ 0x80dc4e420] The driver changed the time per frame from 1/15 to 1/30
libv4l2: error mmapping buffer 16: Invalid argument
[video4linux2,v4l2 @ 0x80dc4e420] ioctl(VIDIOC_QBUF): Invalid argument
libv4l2: warning v4l2 mmap buffers still mapped on close()
/dev/video0: Invalid argument
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-11-01 09:11:35 UTC
Auto-assigned to maintainer riggs@FreeBSD.org
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2014-11-01 21:38:29 UTC
Hi,
The problem is that the following MMAP constant inside webcamd is too small:
kernel/linux_struct.h:#define   LINUX_VMA_MAX 16
Change it to 128, and ffmpeg will work. It simply runs out of mmap slots.
I'm planning a webcamd update.
--HPS
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2014-11-01 23:04:41 UTC
Hi,

Changes:

- Updated to latest V4L, Linux 3.18 sources
- Adjusted webcamd rc.d script
- Fixed crash with some Wacom tablets
- Fixed usage with ffmpeg

svn --username anonsvn --password anonsvn \
    checkout svn://svn.turbocat.net/i4b/trunk/ports

Please test and report any regression issues to me or freebsd-multimedia.

--HPS
Comment 4 borius 2014-11-02 14:53:34 UTC
I update from svn webcamd than reinsatll it and ffmpeg works fine, capure video with no problems, Thank you!
Comment 5 Thomas Zander freebsd_committer freebsd_triage 2014-11-02 18:00:19 UTC
Great to hear that we have a working patch!

@HPS, thanks for taking care of this one!
Comment 6 pg 2014-11-05 17:25:56 UTC
Hi,
I apply ports from svn://svn.turbocat.net/i4b/trunk/ports and after that ffmpeg can't build:

===>   FreeBSD 10 autotools fix applied to /var/fs/build/usr/ports/multimedia/ffmpeg/work/ffmpeg-2.3.5/configure
ERROR: libv4l2 not found
Comment 7 Thomas Zander freebsd_committer freebsd_triage 2014-11-15 09:01:14 UTC
Is there any patch for ffmpeg24 which needs review?
If not, could we close this bug and take care of the v4l issue?
Please let me know, thanks!
Comment 8 commit-hook freebsd_committer freebsd_triage 2014-11-15 11:28:46 UTC
A commit references this bug:

Author: nox
Date: Sat Nov 15 11:28:30 UTC 2014
New revision: 372594
URL: https://svnweb.freebsd.org/changeset/ports/372594

Log:
  Update to 3.18.0.1 .

  PR:		194734
  Submitted by:	hselasky (maintainer)

Changes:
  head/multimedia/webcamd/Makefile
  head/multimedia/webcamd/distinfo
  head/multimedia/webcamd/files/webcamd.in