Yonder-Dynamics / rover-video-feed

Handles the streaming of video
1 stars 0 forks source link

Create an interface to encode video from a camera #1

Open ahaggart opened 5 years ago

ahaggart commented 5 years ago

Create a framework for encoding raw video from a video device (/dev/video0) and serving it as a streaming video file (mp4, webm, etc).

Difficulty: Hard Skills req: Compiled Language, Video Compression library

ahaggart commented 5 years ago

I've been doing some exploration of this issue. One option is ffmpeg + ffserver, which supports a ton of configuration. I got the setup working on my laptop using this guide, but ran into issues (1) trying to get the onboard systems to use the same setup.

The issues on the TX2 and rPi seem to be due to versioning and OS libraries, which could be resolved by running the programs inside a container.

Most help online for ffserver is severely outdated.

Potential Resources:

ahaggart commented 5 years ago

Another option is VLC which I couldn't get working at all (in a limited amount of time). This thread looks interesting though, and may be worth trying if ffmpeg issues persist.

The VLC implementation is currently working and containerized, which is a promising step towards running it on the onboard computers.

ahaggart commented 5 years ago

There is a noticeable amount of lag (6-10s) due to video buffering on the browser end. There seems to be no way to remedy this using the html5 video player. Reducing this latency may require a more sophisticated stream protocol such as rtsp, a special streaming format, and a custom player.

Links:

ahaggart commented 5 years ago

Another option is to use something similar to our setup last year, which worked really well.

http://wiki.ros.org/ros_web_video

what we used

newer version

They seem to simply consume images from a topic and feed them into ffmpeg. We may be able to roll our own version of these tools or fork them and replace ROS with Redis.

ahaggart commented 5 years ago

Notes from meeting with our faculty adviser, John Graham: Use MJPEG with multipart/x-mixed-replace for low latency streams

example implementation: https://gist.github.com/n3wtron/4624820