Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge from upstream development branch #4

Open
wants to merge 60 commits into
base: develop-minimum-rate-stream
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
5e63d0e
added verbose flag
rctoris May 7, 2015
9a4d923
changelog updated
rctoris May 7, 2015
29b6b70
0.0.3
rctoris May 7, 2015
42cef64
Added default transport parameter for regular image streamers
Jun 2, 2015
1dee2d1
Switched from passing image transport to passing node handle to strea…
Jun 2, 2015
df215bf
Added ros compressed video streamer type
Jun 5, 2015
66c9c93
Upgrade for change in signature of async_web_server_cpp request handler
Jun 16, 2015
b7ee8aa
Switch to checkout async_web_server_cpp from source
Jun 16, 2015
4a6eb49
Merge pull request #16 from mitchellwills/compressed
rctoris Jun 16, 2015
2d0257b
changelog updated
rctoris Aug 18, 2015
7920314
0.0.4
rctoris Aug 18, 2015
6f72404
More detailed exception message
BennyRe May 20, 2016
e114860
Removed empty line
BennyRe May 20, 2016
d57a222
Merge pull request #23 from iki-wgt/develop
rctoris May 21, 2016
d4fa5a0
update changelog
Oct 13, 2016
c2c29d2
0.0.5
Oct 13, 2016
bd0ee3b
Fixed topic list to display all image topics, fixing Issue #18.
Nov 3, 2016
76b1357
Merge pull request #28 from MasterEric/develop
jihoonl Nov 4, 2016
50b460b
update change log
Jan 17, 2017
6775e5d
0.0.6
Jan 17, 2017
c980076
web_video_server: fix bool function not returning
achim-k Feb 10, 2017
c89f9f4
Merge pull request #33 from achim-k/patch-1
jihoonl Apr 13, 2017
76facbb
fixed misuse of remove_if (#35)
artifactz Jul 27, 2017
3f7ffeb
Update travis configuration to test against kinetic (#44)
jihoonl Nov 20, 2017
a9dff84
Ffmpeg 3 (#43)
russelhowe Nov 20, 2017
9b1e3f6
update changelog
Nov 20, 2017
7ae8712
0.0.7
Nov 20, 2017
80c2fc4
Use trusty instead of xenial. See travis-ci/travis-ci#7260 (#49)
jihoonl Jan 8, 2018
ae74f19
use SteadyTimer for cleaning up inactive streams (#45)
flixr Jan 8, 2018
9a8d433
Revert "use SteadyTimer for cleaning up inactive streams (#45)" (#51)
jihoonl Jan 8, 2018
0933c6e
Fix Build for ubuntu 14.04 (#48)
randoms Jan 8, 2018
1df1f0a
Set image streamer as inactive if topic is not available (#53)
randoms Jan 12, 2018
913ad9e
Add Indigo test matrix in travis configuration (#50)
jihoonl Jan 28, 2018
c3d27c1
Fix vp8 in kinetic add vp9 and h264 support (#52)
randoms Jan 28, 2018
106170a
Merge remote-tracking branch 'upstream/develop' into develop-minimum-…
meyerj Feb 12, 2018
3441527
Fix segfault in libav_streamer destructor (resolves #59) (#60)
jabailey Feb 26, 2018
2dc7312
use SteadyTimer (if available) for cleaning up inactive streams (#63)
flixr Jun 29, 2018
d288606
Avoid queuing of images on slow ethernet connection (#64)
schallerr Jul 1, 2018
85230ea
update changelog
Jul 1, 2018
0077643
0.1.0
Jul 1, 2018
b49f5c7
fixed undeclared CODEC_FLAG_GLOBAL_HEADER (#65)
klintan Jul 16, 2018
97ac8e4
Pkg format 2 (#68)
dirk-thomas Aug 20, 2018
7a45912
fix SteadyTimer check for backported ROS versions (#71)
flixr Oct 10, 2018
4d58229
Add PngStreamer (#74)
Oct 19, 2018
243d0fb
lax rule for topic name (#77)
KazutoMurase Jan 17, 2019
c3d08d4
Add a workaround for MultipartStream constant busy state (#83)
sfalexrog Jan 28, 2019
5a44cdd
Add "default_stream_type" parameter (#84)
sfalexrog Jan 30, 2019
6a54d8a
update changelog
Jan 30, 2019
224f1ab
0.2.0
Jan 30, 2019
fa6cc25
Fall back to mjpeg if ros_compressed is unavailable (#87)
sfalexrog Apr 17, 2019
ef37d0b
Update travis config (#89)
jihoonl May 7, 2019
8e828bb
Restream buffered frames with minimum publish rate (#88)
May 10, 2019
0697d26
update changelog
jihoonl Jun 5, 2019
4ab9568
0.2.1
jihoonl Jun 5, 2019
b82ea3d
fix multipart_stream.cpp HttpHeader values in order to solve DOMExcep…
oka1125 Sep 30, 2019
b3b367d
add a mention of mjpegcanvasjs in the readme (#100)
gaaady May 19, 2020
dfc4bf0
fix vp9 and h264, support for opencv4 and ffmpeg 4 (#103)
randoms Jun 20, 2020
e8eb661
update changelog
jihoonl Jul 23, 2021
c90d142
0.2.2
jihoonl Jul 23, 2021
2ecfd7b
Merge branch 'develop' into merged/develop-minimum-rate-stream
meyerj Oct 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
language:
- cpp
- python
# This config file for Travis CI utilizes ros-industrial/industrial_ci package.
# For more info for the package, see https://github.com/ros-industrial/industrial_ci/blob/master/README.rst

services:
- docker
language: generic
python:
- "2.7"
compiler:
- gcc

notifications:
email:
on_success: always
on_failure: always

env:
matrix:
- ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=ubuntu OS_CODE_NAME=xenial
- ROS_DISTRO=melodic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=ubuntu OS_CODE_NAME=bionic
- ROS_DISTRO=melodic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=stretch

matrix:
allow_failures:
- env: ROS_DISTRO=melodic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=stretch

#- env: ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0
#- env: ROS_DISTRO="melodic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0

branches:
only:
- master
- develop

install:
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
- sudo apt-get update -qq
- sudo apt-get install python-catkin-pkg python-rosdep ros-groovy-catkin ros-hydro-catkin -qq
- sudo rosdep init
- rosdep update
- mkdir -p /tmp/ws/src
- ln -s `pwd` /tmp/ws/src/package
- cd /tmp/ws
- rosdep install --from-paths src --ignore-src --rosdistro hydro -y
- git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .industrial_ci

script:
- source /opt/ros/hydro/setup.bash
- catkin_make
- catkin_make install
- source .industrial_ci/travis.sh
110 changes: 110 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,116 @@
Changelog for package web_video_server
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.2.2 (2021-07-23)
------------------
* fix vp9 and h264, support for opencv4 and ffmpeg 4 (`#103 <https://github.com/RobotWebTools/web_video_server/issues/103>`_)
* add a mention of mjpegcanvasjs in the readme (`#100 <https://github.com/RobotWebTools/web_video_server/issues/100>`_)
* fix multipart_stream.cpp HttpHeader values in order to solve DOMException(cross origin) CORS issue (`#92 <https://github.com/RobotWebTools/web_video_server/issues/92>`_)
* Contributors: Gady, okapi1125, randoms

0.2.1 (2019-06-05)
------------------
* Restream buffered frames with minimum publish rate (`#88 <https://github.com/RobotWebTools/web_video_server/issues/88>`_)
* Restream buffered frames with minimum publish rate
* Implement restreaming for ros_compressed_streamer
* Update travis config (`#89 <https://github.com/RobotWebTools/web_video_server/issues/89>`_)
* Fall back to mjpeg if ros_compressed is unavailable (`#87 <https://github.com/RobotWebTools/web_video_server/issues/87>`_)
* Contributors: Jihoon Lee, Viktor Kunovski, sfalexrog

0.2.0 (2019-01-30)
------------------
* Add "default_stream_type" parameter (`#84 <https://github.com/RobotWebTools/web_video_server/issues/84>`_)
This allows users to specify default stream type in their .launch files. Using a "ros_compressed" stream type sometimes
results in a much lower resource consumption, and having it set as a default is much nicer for end users.
* Add a workaround for MultipartStream constant busy state (`#83 <https://github.com/RobotWebTools/web_video_server/issues/83>`_)
* Add a workaround for MultipartStream constant busy state
* Remove C++11 features
* lax rule for topic name (`#77 <https://github.com/RobotWebTools/web_video_server/issues/77>`_)
* Add PngStreamer (`#74 <https://github.com/RobotWebTools/web_video_server/issues/74>`_)
* fix SteadyTimer check for backported ROS versions (`#71 <https://github.com/RobotWebTools/web_video_server/issues/71>`_)
i.e. on current kinetic
* Pkg format 2 (`#68 <https://github.com/RobotWebTools/web_video_server/issues/68>`_)
* use package format 2
* add missing dependency on sensor_msgs
* fixed undeclared CODEC_FLAG_GLOBAL_HEADER (`#65 <https://github.com/RobotWebTools/web_video_server/issues/65>`_)
* Contributors: Andreas Klintberg, Dirk Thomas, Felix Ruess, Kazuto Murase, Viktor Kunovski, sfalexrog

0.1.0 (2018-07-01)
------------------
* Avoid queuing of images on slow ethernet connection (`#64 <https://github.com/RobotWebTools/web_video_server/issues/64>`_)
* use SteadyTimer (if available) for cleaning up inactive streams (`#63 <https://github.com/RobotWebTools/web_video_server/issues/63>`_)
* use SteadyTimer for cleaning up inactive streams
so that cleanup works correctly even if system time changes
SteadyTimer is available since roscpp 1.13.1
* possibility to use SteadyTimer on older ROS versions
when SteadyTimer has been backported to those...
* Fix segfault in libav_streamer destructor (resolves `#59 <https://github.com/RobotWebTools/web_video_server/issues/59>`_) (`#60 <https://github.com/RobotWebTools/web_video_server/issues/60>`_)
* Fix vp8 in kinetic add vp9 and h264 support (`#52 <https://github.com/RobotWebTools/web_video_server/issues/52>`_)
* fix vp8 in kinetic
* add h264 and vp9 support
* Add Indigo test matrix in travis configuration (`#50 <https://github.com/RobotWebTools/web_video_server/issues/50>`_)
* Set image streamer as inactive if topic is not available (`#53 <https://github.com/RobotWebTools/web_video_server/issues/53>`_)
* Resolves `#38 <https://github.com/RobotWebTools/web_video_server/issues/38>`_
* Fix Build for ubuntu 14.04 (`#48 <https://github.com/RobotWebTools/web_video_server/issues/48>`_)
* fix issue `#47 <https://github.com/RobotWebTools/web_video_server/issues/47>`_
* fix double free
* Revert "use SteadyTimer for cleaning up inactive streams (`#45 <https://github.com/RobotWebTools/web_video_server/issues/45>`_)" (`#51 <https://github.com/RobotWebTools/web_video_server/issues/51>`_)
This reverts commit ae74f19ada22f288a7c7a99ada7a1b9b6037c7ce.
* use SteadyTimer for cleaning up inactive streams (`#45 <https://github.com/RobotWebTools/web_video_server/issues/45>`_)
so that cleanup works correctly even if system time changes
* Use trusty instead of xenial. See `travis-ci/travis-ci#7260 <https://github.com/travis-ci/travis-ci/issues/7260>`_ (`#49 <https://github.com/RobotWebTools/web_video_server/issues/49>`_)
* Also see `RobotWebTools/rosbridge_suite#311 <https://github.com/RobotWebTools/rosbridge_suite/issues/311>`_
* Contributors: Felix Ruess, James Bailey, Jihoon Lee, randoms, schallerr

0.0.7 (2017-11-20)
------------------
* Ffmpeg 3 (`#43 <https://github.com/RobotWebTools/web_video_server/issues/43>`_)
* Correct use of deprecated parameters
codec_context\_->rc_buffer_aggressivity marked as "currently useless", so removed
codec_context\_->frame_skip_threshold access through new priv_data api
* New names for pixel formats
* AVPicture is deprecated, use AVFrame
* Switch to non-deprecated free functions
* Use new encoding api for newer versions
* codec_context is deprecated, use packet flags
* Update travis configuration to test against kinetic (`#44 <https://github.com/RobotWebTools/web_video_server/issues/44>`_)
* fixed misuse of remove_if (`#35 <https://github.com/RobotWebTools/web_video_server/issues/35>`_)
* Merge pull request `#33 <https://github.com/RobotWebTools/web_video_server/issues/33>`_ from achim-k/patch-1
web_video_server: fix bool function not returning
This fix is required when compiling the package with `clang`. Otherwise a SIGILL (Illegal instruction) is triggered.
* Contributors: Hans-Joachim Krauch, Jan, Jihoon Lee, russelhowe

0.0.6 (2017-01-17)
------------------
* Fixed topic list to display all image topics, fixing Issue `#18 <https://github.com/RobotWebTools/web_video_server/issues/18>`_.
* Contributors: Eric

0.0.5 (2016-10-13)
------------------
* Merge pull request `#23 <https://github.com/RobotWebTools/web_video_server/issues/23>`_ from iki-wgt/develop
More information when server creation is failed
* Removed empty line
* More detailed exception message
Programm behavior is not changed since the exception is rethrown.
* Contributors: BennyRe, Russell Toris

0.0.4 (2015-08-18)
------------------
* Merge pull request #16 from mitchellwills/compressed
Adds support for streaming ROS compressed image topics without the need to reencode them
* Switch to checkout async_web_server_cpp from source
* Upgrade for change in signature of async_web_server_cpp request handler
* Added ros compressed video streamer type
This directly passes the ros compressed frame data to the http socket without reencoding it
* Switched from passing image transport to passing node handle to streamer constructors
* Added default transport parameter for regular image streamers
* Contributors: Mitchell Wills, Russell Toris

0.0.3 (2015-05-07)
------------------
* added verbose flag
* Contributors: Russell Toris

0.0.2 (2015-02-20)
------------------
* Merge pull request #10 from mitchellwills/develop
Expand Down
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(web_video_server)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp roslib cv_bridge image_transport async_web_server_cpp)
find_package(catkin REQUIRED COMPONENTS roscpp roslib cv_bridge image_transport async_web_server_cpp sensor_msgs)
find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED COMPONENTS thread)

Expand Down Expand Up @@ -43,7 +43,13 @@ add_executable(${PROJECT_NAME}
src/image_streamer.cpp
src/libav_streamer.cpp
src/vp8_streamer.cpp
src/jpeg_streamers.cpp)
src/h264_streamer.cpp
src/vp9_streamer.cpp
src/multipart_stream.cpp
src/ros_compressed_streamer.cpp
src/jpeg_streamers.cpp
src/png_streamers.cpp
)

## Specify libraries to link a library or executable target against
target_link_libraries(${PROJECT_NAME}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This node combines the capabilities of [ros_web_video](https://github.com/RobotW
For full documentation, see [the ROS wiki](http://ros.org/wiki/web_video_server).

[Doxygen](http://docs.ros.org/indigo/api/web_video_server/html/) files can be found on the ROS wiki.
[mjpegcanvasjs](https://github.com/rctoris/mjpegcanvasjs) can be used to display a MJPEG stream from the ROS web_video_server

This project is released as part of the [Robot Web Tools](http://robotwebtools.org/) effort.

Expand Down
35 changes: 35 additions & 0 deletions include/web_video_server/h264_streamer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef H264_STREAMERS_H_
#define H264_STREAMERS_H_

#include <image_transport/image_transport.h>
#include "web_video_server/libav_streamer.h"
#include "async_web_server_cpp/http_request.hpp"
#include "async_web_server_cpp/http_connection.hpp"

namespace web_video_server
{

class H264Streamer : public LibavStreamer
{
public:
H264Streamer(const async_web_server_cpp::HttpRequest& request, async_web_server_cpp::HttpConnectionPtr connection,
ros::NodeHandle& nh);
~H264Streamer();
protected:
virtual void initializeEncoder();
std::string preset_;
};

class H264StreamerType : public LibavStreamerType
{
public:
H264StreamerType();
virtual boost::shared_ptr<ImageStreamer> create_streamer(const async_web_server_cpp::HttpRequest& request,
async_web_server_cpp::HttpConnectionPtr connection,
ros::NodeHandle& nh);
};

}

#endif

43 changes: 33 additions & 10 deletions include/web_video_server/image_streamer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,60 @@ namespace web_video_server
class ImageStreamer
{
public:
ImageStreamer(const async_web_server_cpp::HttpRequest &request, async_web_server_cpp::HttpConnectionPtr connection,
image_transport::ImageTransport it);
ImageStreamer(const async_web_server_cpp::HttpRequest &request,
async_web_server_cpp::HttpConnectionPtr connection,
ros::NodeHandle& nh);

virtual void start() = 0;
virtual ~ImageStreamer();

void start();
bool isInactive()
{
return inactive_;
}

bool isInactive();
/**
* Restreams the last received image frame if older than max_age.
*/
virtual void restreamFrame(double max_age) = 0;

std::string getTopic()
{
return topic_;
}

protected:
async_web_server_cpp::HttpConnectionPtr connection_;
async_web_server_cpp::HttpRequest request_;
ros::NodeHandle nh_;
bool inactive_;
image_transport::Subscriber image_sub_;
std::string topic_;
};


class ImageTransportImageStreamer : public ImageStreamer
{
public:
ImageTransportImageStreamer(const async_web_server_cpp::HttpRequest &request, async_web_server_cpp::HttpConnectionPtr connection,
ros::NodeHandle& nh);
virtual ~ImageTransportImageStreamer();
virtual void start();

/**
* Restreams the last received image frame if older than max_age.
*/
virtual void restreamFrame(double max_age);
protected:
virtual void sendImage(const cv::Mat &, const ros::WallTime &time) = 0;

virtual void initialize(const cv::Mat &);

async_web_server_cpp::HttpConnectionPtr connection_;
async_web_server_cpp::HttpRequest request_;
bool inactive_;
image_transport::Subscriber image_sub_;
std::string topic_;
int output_width_;
int output_height_;
bool invert_;
std::string default_transport_;

ros::WallTime last_frame;
cv::Mat output_size_image;
boost::mutex send_mutex_;
Expand All @@ -60,7 +83,7 @@ class ImageStreamerType
public:
virtual boost::shared_ptr<ImageStreamer> create_streamer(const async_web_server_cpp::HttpRequest &request,
async_web_server_cpp::HttpConnectionPtr connection,
image_transport::ImageTransport it) = 0;
ros::NodeHandle& nh) = 0;

virtual std::string create_viewer(const async_web_server_cpp::HttpRequest &request) = 0;
};
Expand Down
15 changes: 8 additions & 7 deletions include/web_video_server/jpeg_streamers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@
#define JPEG_STREAMERS_H_

#include <image_transport/image_transport.h>
#include <opencv2/imgcodecs.hpp>
#include "web_video_server/image_streamer.h"
#include "async_web_server_cpp/http_request.hpp"
#include "async_web_server_cpp/http_connection.hpp"
#include "web_video_server/multipart_stream.h"

namespace web_video_server
{

class MjpegStreamer : public ImageStreamer
class MjpegStreamer : public ImageTransportImageStreamer
{
public:
MjpegStreamer(const async_web_server_cpp::HttpRequest &request, async_web_server_cpp::HttpConnectionPtr connection,
image_transport::ImageTransport it);
ros::NodeHandle& nh);
~MjpegStreamer();
protected:
virtual void sendImage(const cv::Mat &, const ros::WallTime &time);

private:
MultipartStream stream_;
int quality_;
};

Expand All @@ -27,17 +30,15 @@ class MjpegStreamerType : public ImageStreamerType
public:
boost::shared_ptr<ImageStreamer> create_streamer(const async_web_server_cpp::HttpRequest &request,
async_web_server_cpp::HttpConnectionPtr connection,
image_transport::ImageTransport it);

ros::NodeHandle& nh);
std::string create_viewer(const async_web_server_cpp::HttpRequest &request);
};

class JpegSnapshotStreamer : public ImageStreamer
class JpegSnapshotStreamer : public ImageTransportImageStreamer
{
public:
JpegSnapshotStreamer(const async_web_server_cpp::HttpRequest &request,
async_web_server_cpp::HttpConnectionPtr connection, image_transport::ImageTransport it);

async_web_server_cpp::HttpConnectionPtr connection, ros::NodeHandle& nh);
~JpegSnapshotStreamer();
protected:
virtual void sendImage(const cv::Mat &, const ros::WallTime &time);
Expand Down
Loading