RTSP CAMS with Dasboard NODE-RED

I decided to open a new topic to ask for help with a project I need.

I need to place CCTV security cameras using the RSTP protocol on the NODE-RED dashboard.

I read quite a topic that has here in the forum. But after getting some shared codes there, they don't work anymore because I imagine that the NODES are different or updated.

If anyone could help me I would be grateful.

I read a lot of this topic below and I was not able to apply these settings.

I imagine that node has been replaced by this node:

But I'm not sure which ffmpeg parameters I should use in this node's settings

I've already tested my camera url and it's working perfectly in VLC

I got to test ffmpeg with this command. But I'm lost in the output:

[
"-rtsp_transport tcp -i rtsp://user:pass@192.168.1.129:554/cam/realmonitor?channel=1&subtype=0 -c:v copy -f mp4 -movflags +frag_keyframe+empty_moov+default_base_moof pipe:1"
]

@kevinGodell @BartButenaers @jorymathis13

Could you give me a hand for fetileza.

I can only count on the excellent contribution and brotherhood of this beautiful forum.

I do not own a rtsp camera but here is a working example that streams RedBull TV from the net
If you use this as example and modify it, it should work. The setting for "Secret" I suppose you can use for the password to your camera but I would start to get it working without secret until I would set the password. As example, if you have "belov12345678" as password, put instead the keyword SECRET there and your password in the setting "Secret"

image

[
    {
        "id": "73f9f5583289fcdb",
        "type": "inject",
        "z": "ef880aa11015039b",
        "name": "stop default",
        "props": [
            {
                "p": "action",
                "v": "{\"command\":\"stop\"}",
                "vt": "json"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payloadType": "str",
        "x": 150,
        "y": 120,
        "wires": [
            [
                "c26d3d93cf6ed2fd"
            ]
        ]
    },
    {
        "id": "ac63916c39321c68",
        "type": "mp4frag",
        "z": "ef880aa11015039b",
        "name": "",
        "outputs": 2,
        "basePath": "237",
        "serveHttp": "true",
        "serveIo": "true",
        "hlsPlaylistSize": "10",
        "hlsPlaylistExtra": "5",
        "autoStart": "false",
        "preBuffer": "3",
        "timeLimit": "600000",
        "repeated": "true",
        "statusData": "playlist",
        "x": 400,
        "y": 180,
        "wires": [
            [],
            []
        ]
    },
    {
        "id": "d1af2aef282c91aa",
        "type": "inject",
        "z": "ef880aa11015039b",
        "name": "start default",
        "props": [
            {
                "p": "action",
                "v": "{\"command\":\"start\"}",
                "vt": "json"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "1",
        "topic": "",
        "payloadType": "str",
        "x": 150,
        "y": 80,
        "wires": [
            [
                "c26d3d93cf6ed2fd"
            ]
        ]
    },
    {
        "id": "9e9240d71abd7eae",
        "type": "comment",
        "z": "ef880aa11015039b",
        "name": "Video sources",
        "info": "",
        "x": 150,
        "y": 40,
        "wires": []
    },
    {
        "id": "c26d3d93cf6ed2fd",
        "type": "ffmpeg",
        "z": "ef880aa11015039b",
        "name": "",
        "outputs": 2,
        "cmdPath": "ffmpeg",
        "cmdArgs": "[\"-loglevel\",\"error\",\"-nostats\",\"-f\",\"hls\",\"-http_multiple\",\"1\",\"-timeout\",\"1\",\"-re\",\"-i\",\"http://rbmn-live.akamaized.net/hls/live/590964/BoRB-AT/master_1660.m3u8\",\"-c:v\",\"copy\",\"-c:a\",\"aac\",\"-f\",\"mp4\",\"-movflags\",\"+frag_keyframe+empty_moov+default_base_moof\",\"pipe:1\"]",
        "cmdOutputs": 1,
        "killSignal": "SIGTERM",
        "credentials": {},
        "x": 380,
        "y": 100,
        "wires": [
            [
                "ac63916c39321c68"
            ],
            [
                "ac63916c39321c68"
            ]
        ]
    }
]

This is what I'm using ffmpeg node, works fine for me

[
    "-loglevel",
    "quiet",
    "-rtsp_transport",
    "tcp",
    "-i",
    "rtsp://password:username@192.168.1.95:554/h264Preview_01_sub",
    "-an",
    "-c:v",
    "copy",
    "-f",
    "mp4",
    "-movflags",
    "+frag_every_frame+empty_moov+default_base_moof",
    "-min_frag_duration",
    "1000000",
    "pipe:1"
]

For the rtsp line use what works for you in Vlc

1 Like

I still couldn't get it to work.

Is there something I'm not getting right?

What detail is missing?

image

[{"id":"7a8c3f95b486b8f9","type":"ffmpeg","z":"5273a6de.b59318","name":"","outputs":3,"cmdPath":"ffmpeg","cmdArgs":"[\"-loglevel\",\"quiet\",\"-rtsp_transport\",\"tcp\",\"-i\",\"rtsp://belov:belov12345678@192.168.1.129:554/cam/realmonitor?channel=1&subtype=0\",\"-an\",\"-c:v\",\"copy\",\"-f\",\"mp4\",\"-movflags\",\"+frag_every_frame+empty_moov+default_base_moof\",\"-min_frag_duration\",\"1000000\",\"pipe:1\"]","cmdOutputs":2,"killSignal":"SIGTERM","x":470,"y":520,"wires":[["4cc7afbbcc802243"],["4cc7afbbcc802243"],["30bbbddd32d43bde"]]},{"id":"5654e6d653ad2b72","type":"inject","z":"5273a6de.b59318","name":"stop","props":[{"p":"action","v":"{\"command\":\"stop\"}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":260,"y":540,"wires":[["7a8c3f95b486b8f9"]]},{"id":"3db9c9f03c8f6cae","type":"inject","z":"5273a6de.b59318","name":"start","props":[{"p":"action","v":"{\"command\":\"start\"}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":260,"y":480,"wires":[["7a8c3f95b486b8f9"]]},{"id":"30bbbddd32d43bde","type":"debug","z":"5273a6de.b59318","name":"stderr","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":700,"y":580,"wires":[]},{"id":"4cc7afbbcc802243","type":"mp4frag","z":"5273a6de.b59318","name":"","outputs":2,"basePath":"ui_mp4frag_01","serveHttp":"true","serveIo":"true","hlsPlaylistSize":"6","hlsPlaylistExtra":"2","autoStart":"false","preBuffer":1,"timeLimit":10000,"repeated":"false","statusData":"playlist","x":750,"y":500,"wires":[["652bde80360a1fe1"],[]]},{"id":"deaad4e4af7c0a2d","type":"comment","z":"5273a6de.b59318","name":"FFMPEG IS NOT INCLUDED WITH THIS NODE. IT MUST BE INSTALLED SEPARATELY.","info":"","x":510,"y":260,"wires":[]},{"id":"31817c6036caea68","type":"comment","z":"5273a6de.b59318","name":"Create sample mp4 video and play it using ui_mp4frag.","info":"","x":400,"y":420,"wires":[]},{"id":"dff2ea4e8e77635b","type":"comment","z":"5273a6de.b59318","name":"ENOENT error indicates that ffmpeg is not installed or its path is incorrect.","info":"","x":460,"y":340,"wires":[]},{"id":"44d0d8918db56d4d","type":"comment","z":"5273a6de.b59318","name":"The correct movflags must be used when generating compatible mp4 video.","info":"","x":460,"y":300,"wires":[]},{"id":"182a05833d08c4a5","type":"comment","z":"5273a6de.b59318","name":"For help, publicly tag me in the Node-RED forum @kevinGodell.","info":"`@kevinGodell`","x":430,"y":380,"wires":[]},{"id":"652bde80360a1fe1","type":"ui_mp4frag","z":"5273a6de.b59318","name":"","group":"46d6d60673638810","order":0,"width":"20","height":"14","readyPoster":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB2aWV3Qm94PSIwIDAgODAwMCA2MDAwIj48dGV4dCBmaWxsPSIjMGYwIiBzdHJva2Utd2lkdGg9IjAiIGR4PSIwIiBkeT0iMCIgZm9udC1mYW1pbHk9IiZxdW90O2UyY3B1d3p4YldsMTo6OlJvYm90byZxdW90OyIgZm9udC1zaXplPSI2MDAiIGZvbnQtd2VpZ2h0PSI3MDAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKCAxMDExLjI0IDMyMDQuODgpIj48dHNwYW4geT0iMCIgc3Ryb2tlLXdpZHRoPSIwIiBmb250LXdlaWdodD0iNzAwIj48IVtDREFUQVsKVmlkZW8gUGxheWJhY2sgUmVhZHkKXV0+PC90c3Bhbj48L3RleHQ+PC9zdmc+Cg==","errorPoster":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB2aWV3Qm94PSIwIDAgODAwMCA2MDAwIj48dGV4dCBmaWxsPSJyZWQiIHN0cm9rZS13aWR0aD0iMCIgZHg9IjAiIGR5PSIwIiBmb250LWZhbWlseT0iJnF1b3Q7ZW42OXdhSUtnN0MxOjo6Um9ib3RvJnF1b3Q7IiBmb250LXNpemU9IjYwMCIgZm9udC13ZWlnaHQ9IjcwMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoIDExODMuOTYgMzIwNC44OCkiPjx0c3BhbiB5PSIwIiBzdHJva2Utd2lkdGg9IjAiIGZvbnQtd2VpZ2h0PSI3MDAiPjwhW0NEQVRBWwpWaWRlbyBQbGF5YmFjayBFcnJvcgpdXT48L3RzcGFuPjwvdGV4dD48L3N2Zz4K","hlsJsConfig":"{\"liveDurationInfinity\":true,\"liveBackBufferLength\":5,\"maxBufferLength\":10,\"manifestLoadingTimeOut\":1000,\"manifestLoadingMaxRetry\":10,\"manifestLoadingRetryDelay\":500}","autoplay":"true","unload":"true","threshold":0.1,"controls":"true","muted":"true","players":["socket.io","hls.js","hls","mp4"],"x":1030,"y":500,"wires":[[]]},{"id":"46d6d60673638810","type":"ui_group","name":"ui_mp4frag_01","tab":"9eb9a9fcd56859ba","order":1,"disp":true,"width":"20","collapse":false,"className":""},{"id":"9eb9a9fcd56859ba","type":"ui_tab","name":"ui_mp4frag","icon":"dashboard","disabled":false,"hidden":false}]

@kevinGodell - Please Help

Seems to be browser issue??? The ui_mp4frag node seems to be happy...

I already switched browsers.

I used the

And

Not all browsers/platforms can play h265 encoded video. There is a site that allows you to enter the codec string and it will check if your browser supports it. Media MIME Support

on mac, when checking chrome:

and then using safari:

For me, this seems that my safari browser could play it, while chrome cannot. I have never tested any windows device to see which can play it. I think the problem arises from some codec patent issue and there might be some legal reason for browsers refusing to support it.

You might have a few options:

  1. go into your camera's settings and set it to output h264 if available
  2. transcode the video using ffmpeg to change from h265 to h264 and have a high cpu load
  3. find another video player that can transcode the video on the client side when reading the hls.m3u8 playlsit
2 Likes

First I want to thank the immense help given in this topic by several people.

And I also feel very flattered when the author of the npm package himself answers my question. I'm your fan.

Thank you very much, thank you very much, thank you very much.

Thank you a thousand times!

For those who in the future go through this problem I will document here how I solved the problem:

I followed my friend @kevinGodell s instructions above:

I changed the camera settings to respond in h264 and it worked perfectly.

[{"id":"7a8c3f95b486b8f9","type":"ffmpeg","z":"5273a6de.b59318","name":"","outputs":3,"cmdPath":"ffmpeg","cmdArgs":"[\"-loglevel\",\"quiet\",\"-rtsp_transport\",\"tcp\",\"-i\",\"rtsp://belov:belov12345678@192.168.1.129:554/cam/realmonitor?channel=1&subtype=0\",\"-an\",\"-c:v\",\"copy\",\"-f\",\"mp4\",\"-movflags\",\"+frag_every_frame+empty_moov+default_base_moof\",\"-min_frag_duration\",\"1000000\",\"pipe:1\"]","cmdOutputs":2,"killSignal":"SIGTERM","x":490,"y":380,"wires":[["4cc7afbbcc802243"],["4cc7afbbcc802243"],["30bbbddd32d43bde"]]},{"id":"5654e6d653ad2b72","type":"inject","z":"5273a6de.b59318","name":"stop","props":[{"p":"action","v":"{\"command\":\"stop\"}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":340,"y":409,"wires":[["7a8c3f95b486b8f9"]]},{"id":"3db9c9f03c8f6cae","type":"inject","z":"5273a6de.b59318","name":"start","props":[{"p":"action","v":"{\"command\":\"start\"}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":340,"y":349,"wires":[["7a8c3f95b486b8f9"]]},{"id":"30bbbddd32d43bde","type":"debug","z":"5273a6de.b59318","name":"stderr","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":690,"y":489,"wires":[]},{"id":"4cc7afbbcc802243","type":"mp4frag","z":"5273a6de.b59318","name":"","outputs":2,"basePath":"teste","serveHttp":"true","serveIo":"true","hlsPlaylistSize":"6","hlsPlaylistExtra":"2","autoStart":"false","preBuffer":1,"timeLimit":10000,"repeated":"false","statusData":"playlist","x":700,"y":349,"wires":[["652bde80360a1fe1","a5523c231a966567"],["4d78cbf46af60d59"]]},{"id":"deaad4e4af7c0a2d","type":"comment","z":"5273a6de.b59318","name":"FFMPEG IS NOT INCLUDED WITH THIS NODE. IT MUST BE INSTALLED SEPARATELY.","info":"","x":590,"y":129,"wires":[]},{"id":"31817c6036caea68","type":"comment","z":"5273a6de.b59318","name":"Create sample mp4 video and play it using ui_mp4frag.","info":"","x":480,"y":289,"wires":[]},{"id":"dff2ea4e8e77635b","type":"comment","z":"5273a6de.b59318","name":"ENOENT error indicates that ffmpeg is not installed or its path is incorrect.","info":"","x":540,"y":209,"wires":[]},{"id":"44d0d8918db56d4d","type":"comment","z":"5273a6de.b59318","name":"The correct movflags must be used when generating compatible mp4 video.","info":"","x":540,"y":169,"wires":[]},{"id":"182a05833d08c4a5","type":"comment","z":"5273a6de.b59318","name":"For help, publicly tag me in the Node-RED forum @kevinGodell.","info":"`@kevinGodell`","x":510,"y":249,"wires":[]},{"id":"652bde80360a1fe1","type":"ui_mp4frag","z":"5273a6de.b59318","name":"","group":"46d6d60673638810","order":1,"width":22,"height":13,"readyPoster":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB2aWV3Qm94PSIwIDAgODAwMCA2MDAwIj48dGV4dCBmaWxsPSIjMGYwIiBzdHJva2Utd2lkdGg9IjAiIGR4PSIwIiBkeT0iMCIgZm9udC1mYW1pbHk9IiZxdW90O2UyY3B1d3p4YldsMTo6OlJvYm90byZxdW90OyIgZm9udC1zaXplPSI2MDAiIGZvbnQtd2VpZ2h0PSI3MDAiIHRyYW5zZm9ybT0idHJhbnNsYXRlKCAxMDExLjI0IDMyMDQuODgpIj48dHNwYW4geT0iMCIgc3Ryb2tlLXdpZHRoPSIwIiBmb250LXdlaWdodD0iNzAwIj48IVtDREFUQVsKVmlkZW8gUGxheWJhY2sgUmVhZHkKXV0+PC90c3Bhbj48L3RleHQ+PC9zdmc+Cg==","errorPoster":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB2aWV3Qm94PSIwIDAgODAwMCA2MDAwIj48dGV4dCBmaWxsPSJyZWQiIHN0cm9rZS13aWR0aD0iMCIgZHg9IjAiIGR5PSIwIiBmb250LWZhbWlseT0iJnF1b3Q7ZW42OXdhSUtnN0MxOjo6Um9ib3RvJnF1b3Q7IiBmb250LXNpemU9IjYwMCIgZm9udC13ZWlnaHQ9IjcwMCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoIDExODMuOTYgMzIwNC44OCkiPjx0c3BhbiB5PSIwIiBzdHJva2Utd2lkdGg9IjAiIGZvbnQtd2VpZ2h0PSI3MDAiPjwhW0NEQVRBWwpWaWRlbyBQbGF5YmFjayBFcnJvcgpdXT48L3RzcGFuPjwvdGV4dD48L3N2Zz4K","hlsJsConfig":"{\"liveDurationInfinity\":true,\"liveBackBufferLength\":5,\"maxBufferLength\":10,\"manifestLoadingTimeOut\":1000,\"manifestLoadingMaxRetry\":10,\"manifestLoadingRetryDelay\":500}","autoplay":"true","unload":"true","threshold":0.1,"controls":"true","muted":"true","players":["socket.io","hls.js","hls","mp4"],"x":1010,"y":289,"wires":[[]]},{"id":"4d78cbf46af60d59","type":"debug","z":"5273a6de.b59318","name":"debug 12","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1060,"y":409,"wires":[]},{"id":"a5523c231a966567","type":"debug","z":"5273a6de.b59318","name":"debug 13","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1020,"y":349,"wires":[]},{"id":"46d6d60673638810","type":"ui_group","name":"ui_mp4frag_01","tab":"9eb9a9fcd56859ba","order":1,"disp":true,"width":22,"collapse":false,"className":""},{"id":"9eb9a9fcd56859ba","type":"ui_tab","name":"ui_mp4frag","icon":"dashboard","disabled":false,"hidden":false}]
1 Like

This is what I call an extremely helpful forum thread.

The post with the question was made at the beginning filled with screens, codes and attempts to work.

Some people contributed so that the code works perfectly.

Almost made it.

Finally, one last change was made, achieving the objective.

And the whole problem has been documented so that in the future someone who goes through this can solve the problem too.

Including myself!! That sometimes years later I need the same thing... Another time and I don't have it.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.