Stream image from an ip camera via streaming (Ffmpeg)

Asked

Viewed 250 times

1

I have an application written in Node.Js that needs to record the camera video in an mp4 file and also stream it via streaming to a specific url. For test and learning purposes, I made a code using the laptop webcam as data input, however, I would like to know how to change the original code that is working perfectly to use an IP camera as data input.

RTMP protocol would solve the problem?

Code:

ffmpeg -f dshow -rtbufsize 2048M -i video="Integrated Webcam" -t 300 -codec:v mpeg1video 
meuvideo.mp4 -f mpegts -q:v 5 -codec:v mpeg1video -t 300 http://127.0.0.1:4000/token

1 answer

2

You need to check the specifications of your IP camera which output formats/protocols it works with. ffmpeg works with both RTMP and input TCP/UDP, so it will even depend on your camera’s capabilities.

Input in UDP:

ffmpeg -i udp://localhost:1234 -codec:v mpeg1video meuvideo.mp4 -f mpegts -q:v 5 -codec:v mpeg1video -t 300 http://127.0.0.1:4000/token

Input in RTMP:

ffmpeg -i rtmp://localhost:1234/meuStream -codec:v mpeg1video meuvideo.mp4 -f mpegts -q:v 5 -codec:v mpeg1video -t 300 http://127.0.0.1:4000/token

Browser other questions tagged

You are not signed in. Login or sign up in order to post.