RTSP Stream to Image or Mjpeg
use ffmpeg
This is an example of getting pictures from rtsp stream
-
This is not a working project, this is an example!
-
For ip cameras, I recommend using the usual get request for the poster. example for dahua [http:///onvif/media_service/snapshot?channel=0&subtype=0]
-
For this example, I recommend using CUDA, but this will require separate work and will greatly reduce the load on the cpu.
-
I recommend limiting the number of frames when using mjpeg or using gpu.
brew install ffmpeg
apt install libavcodec-dev libavcodec-ffmpeg56 libavformat-dev libavformat-ffmpeg56
- Download source
$ git clone https://github.com/deepch/RTSPtoImage
- CD to Directory
$ cd RTSPtoImage/
- Test Run
$ GO111MODULE=on go run *.go
- Open Browser
open web browser http://127.0.0.1:8083 work chrome, safari, firefox
format:
{
"server": {
"http_port": ":8083"
},
"streams": {
"H264_AAC": {
"url": "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"
}
}
}
Video Codecs Supported: H264
Audio Codecs Supported: no
Deepch - https://github.com/deepch streaming developer
Dmitry - https://github.com/vdalex25 web developer
Examples of working with video on golang
- You can make one-time donations via PayPal. I'll probably buy a coffee tea. 🍵