I need to display a ip camera stream in an html video tag, i have figured out how to transcode to a file from the rtsp stream like this
ffmpeg -i "rtsp://user:password@ip" -s 640x480 /tmp/output.mp4
now i need to be able to be able to live stream the rtsp input in a video tag like this
<video id="video" src="http://domain:port/output.mp4" autoplay="autoplay" />
I was trying to do something like this in my server (an ubuntu micro instance on amazon) in order to reproduce the video in the video tag but didn't work
ffmpeg -i "rtsp://user:password@ip" -s 640x480 http://localhost:8080/stream.mp4
instead i got this log
[tcp @ 0x747b40] Connection to tcp://localhost:8080 failed: Connection refused
http://localhost:8080/stream.mp4: Connection refused
i don't really understand what's happening, not sure if it's sending the output to that url or serving the output there and this, i've been checking the ffmpeg man docs but i didn't find any example related to this use case and also other questiones like this one FFmpeg Stream Transcoding which is similar to my last try without success
btw, this is the camera i'm using DS-2CD2020F-I(W) - http://www.hikvision.com/en/Products_accessries_157_i5847.html they offer an httppreview but it's just an img tag source which updates but appears to be unstable
This is my first time trying to do something like this so any insight about how to achieve it will be really usefull and appreciated
Something like this should work to create a live HLS stream from a video camera but the latency will not be good. If latency is important, you may want to look at WebRTC.
You need to locate the output for the generated ts and m3u8 files behind an HTTP server and then you can use this test page to check that it's working.