-
-
Save Noguai/1adac1feb37e4342fa9f2e092418a311 to your computer and use it in GitHub Desktop.
HLS Webcam Streaming with FFmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /tmp/hls | |
cd /tmp/hls | |
python -m SimpleHTTPServer 8900 & | |
ffmpeg -framerate 24 -video_size 1280x720 -input_format mjpeg -i /dev/video0 -g 12 -sc_threshold 0 -codec h264_omx -f hls -hls_time 0.5 -hls_wrap 3 stream.m3u8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link href="https://vjs.zencdn.net/7.2.3/video-js.css" rel="stylesheet"> | |
</head> | |
<body> | |
<video id='hls-example' class="video-js vjs-default-skin" width="400" height="300" controls> | |
<source type="application/x-mpegURL" src="http://octopi:8900/stream.m3u8"> | |
</video> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.14.1/videojs-contrib-hls.js"></script> | |
<script src="https://vjs.zencdn.net/7.2.3/video.js"></script> | |
<script> | |
var player = videojs('hls-example'); | |
player.play(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment