ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hi Allen!
Have you found the solution? I encountered exactly the same problem... the same ubuntu, the same indigo, my ffmpeg is something like:
ffmpeg version N-76045-g97be5d4 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
libavutil 55. 4.100 / 55. 4.100
libavcodec 57. 6.100 / 57. 6.100
libavformat 57. 4.100 / 57. 4.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 11.100 / 6. 11.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
2 | No.2 Revision |
Hi Allen!
I found that this problem is caused by linking wrong libraries. Try
ldd devel/lib/usb_cam/usb_cam_node
to see which lib is linked.
My ffmpeg was installed by apt-get from a ppa repository, the default location of such packages is /opt. But anyhow cmake didn't find the correct libavcodec and libswscale.
Later I install ffmpeg from source, install those libraries in /usr/local/lib, and manual set variable avcodec_LIBRARIES and INCLUDE_DIRS as:
## pkg-config libraries
# find_package(PkgConfig REQUIRED)
# pkg_check_modules(avcodec libavcodec REQUIRED)
# pkg_check_modules(swscale libswscale REQUIRED)
set(avcodec_LIBRARIES /usr/local/lib/libavcodec.so.57)
set(swscale_LIBRARIES /usr/local/lib/libswscale.so.4)
set(avcodec_INCLUDE_DIRS /usr/local/include/libavcodec)
set(swscale_INCLUDE_DIRS /usr/local/include/libswscale)
And, as the new version ffmpeg has changed some of its variable/function names, I have to modify the code of usb_cam. Lucky, only a little at the begin of usb_cam.cpp:
#define avcodec_alloc_frame av_frame_alloc
#define PIX_FMT_RGB24 AV_PIX_FMT_RGB24
#define PIX_FMT_YUV422P AV_PIX_FMT_YUV422P
Hope it helps!
Have you found the solution? I encountered exactly the same problem... the same ubuntu, the same indigo, my ffmpeg is something like:
ffmpeg version N-76045-g97be5d4 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
libavutil 55. 4.100 / 55. 4.100
libavcodec 57. 6.100 / 57. 6.100
libavformat 57. 4.100 / 57. 4.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 11.100 / 6. 11.100
libavresample 3. 0. 0 / 3. 0. 0
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.100 / 2. 0.100
libpostproc 54. 0.100 / 54. 0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...