Transmit image from an ip camera via streaming (FFmpeg)

0

I have an application written in Node.Js that needs to record the video of the camera in an archival mp4 and also transmit it via streaming to a specific url. For testing and learning purposes, I made a code using the notebook's 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
    
asked by anonymous 07.12.2017 / 20:12

1 answer

1

You need to check the specifications of your IP camera for which output formats / protocols it works. Ffmpeg works with both RTMP and incoming TCP / UDP, so it will depend on the capabilities of your camera.

UDP Entry:

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

RTMP input:

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
    
22.01.2018 / 12:15