[FFmpeg-user] chwe17/FFmpeg-Cedrus can't open my webcam?

cedric.dewijs at telfort.nl cedric.dewijs at telfort.nl
Mon May 14 16:48:18 EEST 2018


Hi all,
I have a bananapi, running Armbian 5.38. I have done the following steps to compile ffmpeg:
git clone https://github.com/chwe17/FFmpeg-Cedrus.git
cd FFmpeg-Cedrus/
./configure --prefix=/usr --enable-nonfree --enable-gpl --enable-version3 --enable-vdpau --enable-libx264 --enable-libpulse --enable-libv4l2
make -j 2
sudo make install
Now i try to capture and encode video from my webcam:
cedric at bananapi:~$ ffmpeg -i /dev/video0 -c:v cedrus264 -b:v 1000k -vewait 1000 -f h264 test.h264
ffmpeg version git-2018-03-24-e785140 Copyright (c) 2000-2014 the FFmpeg developers
  built on May  4 2018 16:31:39 with gcc 5.4.0 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.5) 20160609
  configuration: --prefix=/usr --enable-nonfree --enable-gpl --enable-version3 --enable-vdpau --enable-libx264 --enable-libpulse --enable-libv4l2
  libavutil      54.  6.100 / 54.  6.100
  libavcodec     56.  0.101 / 56.  0.101
  libavformat    56.  2.100 / 56.  2.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.102 /  5.  0.102
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
/dev/video0: Invalid argument
Then I uninstall and reinstall ffmpeg from armbian, so I can test if my webcam itself is to blame. I see this works correctly, but it does not have the options -c:v cedrus264 and -vewait:
cedric at bananapi:~/new/FFmpeg-Cedrus$ ffmpeg -b:v 1000k -f h264 test.h264 -i /dev/video0 
ffmpeg version 2.8.14-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1597.248143, bitrate: 110592 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x360, 110592 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
File 'test.h264' already exists. Overwrite ? [y/N] y
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x1682dc0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0x1682dc0] profile High 4:2:2, level 3.0, 4:2:2 8-bit
Output #0, h264, to 'test.h264':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (libx264), yuv422p, 640x360, q=-1--1, 1000 kb/s, 30 fps, 30 tbn, 30 tbc
    Metadata:
      encoder         : Lavc56.60.100 libx264
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
^Cav_interleaved_write_frame(): Immediate exit requested
^CReceived > 3 system signals, hard exiting
After that i repeated the test from above with my compiled version:
cedric at bananapi:~/new/FFmpeg-Cedrus$ ./ffmpeg -v debug  -c:v cedrus264 -b:v 1000k -vewait 1000 -f h264 test.h264 -i /dev/video0 
ffmpeg version git-2018-03-24-e785140 Copyright (c) 2000-2014 the FFmpeg developers
  built on May  4 2018 16:31:39 with gcc 5.4.0 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.5) 20160609
  configuration: --prefix=/usr --enable-nonfree --enable-gpl --enable-version3 --enable-vdpau --enable-libx264 --enable-libpulse --enable-libv4l2
  libavutil      54.  6.100 / 54.  6.100
  libavcodec     56.  0.101 / 56.  0.101
  libavformat    56.  2.100 / 56.  2.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.102 /  5.  0.102
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'cedrus264'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1000k'.
Reading option '-vewait' ... matched as AVOption 'vewait' with argument '1000'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'h264'.
Reading option 'test.h264' ... matched as output file.
Reading option '-i' ... matched as input file with argument '/dev/video0'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file /dev/video0.
Successfully parsed a group of options.
Opening an input file: /dev/video0.
[AVIOContext @ 0x214fc80] Statistics: 0 bytes read, 0 seeks
/dev/video0: Invalid argument
Where can I get a version of ffmpeg that uses the h264 hardware encoder for the Allwinner A20 SOC on the bananapi?
Cheers,
Cedric


More information about the ffmpeg-user mailing list