How to display CCTV camera in dashboard (RTSP)

Hi Csongor(@nygma2004),

Nice that you join the discussion. All ideas and proposals are welcome...

  • Until now I considered the Exec node a bit too generic for doing specific ffmpeg stuff, so I have above only compared all existing Ffmpeg nodes. But I must admit that the code of node-red-contrib-visio-ffmpeg looks very similar to the Exec node, so I assume it is derived from it some time ago ...

    The ffmpeg node checks whether ffmpeg is installed and adds 'ffmpeg' automatically as prefix to the command, but I think that's about it. And the Exec node can already be controlled via msg.kill, by applying the different signals:

    exec_rtsp

    [{"id":"46999a1f.6657d4","type":"exec","z":"18e47039.88483","command":"ffmpeg -f rtsp -i \"rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov\" -f image2pipe pipe:1","addpay":false,"append":"","useSpawn":"true","timer":"","oldrc":false,"name":"Decode RTSP stream","x":1580,"y":1120,"wires":[["47938011.f1a51"],[],[]]},{"id":"996a1c4.7436de","type":"inject","z":"18e47039.88483","name":"Start stream","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1090,"y":1120,"wires":[["46999a1f.6657d4"]]},{"id":"47938011.f1a51","type":"image","z":"18e47039.88483","name":"","width":"200","x":1810,"y":1100,"wires":[]},{"id":"4cf9fc06.acfb84","type":"inject","z":"18e47039.88483","name":"Pause all streams","topic":"","payload":"SIGSTOP","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1110,"y":1160,"wires":[["8e3a27b3.abf538"]]},{"id":"cf50c10.31f664","type":"inject","z":"18e47039.88483","name":"Resume all streams","topic":"","payload":"SIGCONT","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1110,"y":1200,"wires":[["8e3a27b3.abf538"]]},{"id":"8e3a27b3.abf538","type":"change","z":"18e47039.88483","name":"","rules":[{"t":"set","p":"kill","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1330,"y":1160,"wires":[["46999a1f.6657d4"]]},{"id":"a359a2e3.a4f51","type":"inject","z":"18e47039.88483","name":"Stop all streams","topic":"","payload":"SIGTERM","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1100,"y":1240,"wires":[["8e3a27b3.abf538"]]}]
    

    So then I can put my pull request for the Ffmpeg node into the garbage bin. So thank you for that :wink:

  • Had never heard about avconv before. Seems that avconv is started as a fork from ffmpeg in 2011, based on internal conflicts in the team. But some years later it has been replaced by ffmpeg again in Debian. Anyway I have tried both programs on the same rtsp stream, and in my test avconv was slower (20% more CPU usage):

    But perhaps my test is not good, because I should add some extra rtsp stream command arguments?

    P.S. the spikes are not related to this test, since they already exist before the red arrow (where the stream was started): they are produced by other nodes in my Node-RED flow ...

  • When I use the two streaming parameters from you youtube video, I only get 3 messages with buffers. And then the stream stops:

    image

  • And I payed Raspberry foundation for an MPEG hardware license, and now the hardware encoding is enabled:

    vcgencmd codec_enabled MPG2
    MPG2=enabled
    

    But I still get the same error in my output :worried:

Bart

1 Like