<<PackageHeader(mjpeg_server)>> <<TOC(4)>> {{{#!wiki tip This package is EOL, and has been replaced by [[web_video_server]]. }}} == About == || A natural means of interacting with and checking upon the progress of the robot is through video. MJPEGs, or motion JPEGs, are a file format in which each frame of a video stream is separately compressed as a JPEG image. The mjpeg_server is a streaming server that subscribes to requested image topics in ROS and publishes those topics as MJPEG streams via HTTP. While [[rosbridge_server|rosbridge]] is capable of streaming video, as it is just another message type from ROS, the web browser is optimized to efficiently download images in binary format. Thus for increased performance benefits this additional communication channel is used. In order to deal with a user’s specific requirements the video streams can be provided at a desired quality and size to accommodate different connection speeds and interface designs. mjpeg_server is developed as part of the [[http://robotwebtools.org|Robot Web Tools]] effort. || {{attachment:mjpeg_server_1.jpg|MJPEG Stream|width=320}} || == Installation == {{{#!wiki version groovy_and_newer <<Include(mjpeg_server/groovy)>> }}} == Running the Node == In a '''new terminal''', run the mjpeg_server: {{{ rosrun mjpeg_server mjpeg_server }}} By default the server serves streams on port 8080. If this port is already used by another process you will see an appropriate error message. Optionally, you can set a different port on the command line when launching `mjpeg_server`: {{{ rosrun mjpeg_server mjpeg_server _port:=8181 }}} === Accessing the Stream in a Web Browser === The stream can be viewed by any current browser. If the server runs on the local machine you can access the stream using the following URL: {{{ http://localhost:8080/stream?topic=/IMAGE_TOPIC }}} Here, /IMAGE_TOPIC is a ROS topic generated by the [[image_transport]] module, e.g. `/wide_stereo/left/image_color` in case you are using a PR2. === Single image snapshots === Instead of displaying a stream of images, it is also possible to display a single image snapshot. The URL for snapshots is: {{{ http://localhost:8080/snapshot?topic=/IMAGE_TOPIC }}} === Display parameters === The image stream can be configured by several parameters. The parameters are added to the URL according to the URI scheme: {{{ http://localhost:8080/stream?topic=/IMAGE_TOPIC?param1=value1?param2=value2?param3=value3 }}} Currently the following parameters are available: {{{ #!clearsilver CS/NodeAPI param { no_header= True 0.name= width 0.type= integer 0.default= original width 0.desc= The image stream will be resized to a new width and height. This parameter has to be used in conjunction with the height parameter. 1.name= height 1.type= integer 1.default= original height 1.desc= The image stream will be resized to a new width and height. This parameter has to be used in conjunction with the height parameter. 2.name= quality 2.type= integer 2.default= 90 2.desc= The jpeg image quality (1...100). This parameter can be used to reduce the size of the resulting mjpeg stream. 3.name= invert 3.type= none 3.default= 3.desc= Rotates the image by 180 degrees before streaming. } }}} The following example shows a resized version of an image stream: {{attachment:mjpeg_server_2.jpg|reduced size stream displayed in a browser|width=320}} == Support == Please send bug reports to the [[https://github.com/RobotWebTools/mjpeg_server/issues|GitHub Issue Tracker]]. Feel free to contact us at any point with questions and comments. * [[mailto:robot-web-tools@googlegroups.com|robot-web-tools@googlegroups.com]] ## AUTOGENERATED DON'T DELETE ## CategoryPackage