简体   繁体   中英

Streaming from a webcam through Nginx to videojs without flash

Has anyone managed to use ffmpeg to stream from a webcam, and then serve this using nginx to a page running videojs. I can't believe this isn't possible without using flash.

I'd like a pure html5 solution without any flash, and I've tried using rtmp. I can pick up the rtmp stream using vlc, I've got the page with videojs working, but I can't work out how to link it all up. I'm doing this from a rpi3, so have been using the hardware encoder,

ffmpeg -f video4linux2 -i /dev/video0 -c:v h264_omx -c:a copy -b:v 1500k   rtmp://localhost/hls/movie

Here was the rtmp nginx setup, I'd compiled it as a module into nginx( module on git hub );

 rtmp { server { listen 1935; ping 30s; notify_method get; application hls { live on; # sample HLS hls on; hls_path /tmp/hls; } } } 

Thanks

Ok, tried 3 methods, using rasbian stretch on a Pi+ over wireless, with a logitech C270 webcam for use as a baby monitor;

  1. Rtmp
  2. ffserver
  3. motion

Rmtp worked slowly but uses flash, so was unacceptable I couldn't get ffserver to work at all and it's being deprecated ffserver deprecation notice . Motion worked fine, good resolution and frame rate, as well as low latency.

Just adding this to try and stop other people trying other solutions before hitting one that worked for me anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM