RobotWebTools / web_video_server

HTTP Streaming of ROS Image Topics in Multiple Formats
http://ros.org/wiki/web_video_server
BSD 3-Clause "New" or "Revised" License
280 stars 190 forks source link

Fix vp8 in kinetic add vp9 and h264 support #52

Closed randoms closed 6 years ago

randoms commented 6 years ago

vp8 was tested both on Ubuntu 14.04 and Ubuntu 16.04. It works fine. vp9 and h264 were tested on Ubuntu 16.04. They can work but the latency was about 10 seconds. Most of the code were token from pull request #31

mescarra commented 6 years ago

I get this:

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
   what():  Broken pipe
Aborted

when I try to use type=vp8 or vp9.

randoms commented 6 years ago

Have you tried this pull request? What is your ROS and ffmpeg version?

mescarra commented 6 years ago

Yes, I get that error when patching the code with this pull-request. I was getting the [libvpx @ 0x7f0fb80e5180] Codec type or id mismatches error before, that's why I tried this pull-request.

I'm using ROS Kinetic and FFMPEG 2.8.11 with Ubuntu 16.04

randoms commented 6 years ago

It works fine on my side. Here is my FFMPEG info. I also use ROS Kinetic.

ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --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
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

And here is my output

xiaoqiang@xiaoqiang-desktop:~/Documents/ros$ rosrun web_video_server web_video_server 
[ INFO] [1515721303.797234490]: Waiting For connections on 0.0.0.0:8080
[ INFO] [1515721309.425692466]: Handling Request: /stream_viewer?topic=/camera_node/image_raw&type=vp8
[ INFO] [1515721309.448451219]: Handling Request: /stream?topic=/camera_node/image_raw&type=vp8
[libvpx @ 0x7f56cc0e61e0] v1.5.0

Maybe you can try my fork here

jihoonl commented 6 years ago

@mescarra any updates?

mescarra commented 6 years ago

I did not have time to test your fork.

mjpeg with quality 20 is doing the job for me, for the time being.