Over the last 2 days I have been pulling my hair out trying to get my ptz camera to display on dashboard via FFmpeg in exec node and kevinGodell/node-red-contrib-mp4frag and node-red-contrib-ui-mp4frag
I have read every post and trying as many exec node FFmpeg cmd lines as I have seen all without success, the best I get was ..
ffmpeg -i rtsp://192.168.0.67:554/user=admin_password=mkNJWdWL_channel=1_stream=1.sdp?real_stream -an -c:v copy -f mp4 -movflags +frag_keyframe+empty_moov+default_base_moof pipe:1
Which does not output anything (exec node blue pid:*** frag nodes green: reset & unloaded) but I do get a buffer showing up on a debug node connected to the exec node when I stop the flow also I get ..
Command failed: ffmpeg -i rtsp://192.168.0.67:554/user=admin_password=mkNJWdWL_channel=1_stream=0.sdp?real_stream -an -c:v copy -f mp4 -movflags +frag_keyframe+empty_moov+default_base_moof pipe:1
ffmpeg version 4.1.6-1~deb10u1+rpt1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
I'm really struggling here, any help would be most appreciated
My Setup..
rpi 3b with fresh install of latest 2021-01-11-raspios-buster-armhf.img
fresh install of node-red 1.2.7 and dashboard 2.27.0 node v12.20.1
Barts onvif nodes work with all the examples successfully inc image preview and ptz control.
kevinGodell nodes work with all the examples successfully.
if I open ispy I can select add camera and get video, indicated url rtsp://192.168.0.67:554/user=admin_password=mkNJWdWL_channel=1_stream=0.sdp?real_stream
I can open VLC open media add above url in 'network URL:' press play and get video.
Just to make sure your ffmpeg is good, try running the command on the command line first, but change the output to be testvideo.mp4 instead of pipe:1. Stop the command after a few seconds and try to play the video.
Hi krambriw thanks for response hls.js in first position and latest ffmpeg recommendation both have exactly same result as in post 1.
Hi kevinGodell thanks for your response also result as follows ..
Note the resulting testvideo.mp4 file does play when i transferred it to windows and played it.
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://192.168.0.67:554/user=admin_password=mkNJWdWL_channel=1_stream=1.sdp?real_stream':
Metadata:
title : RTSP Session
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p(progressive), 640x360, 12 fps, 12 tbr, 90k tbn, 24 tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Output #0, mp4, to 'testvideo.mp4':
Metadata:
title : RTSP Session
encoder : Lavf58.20.100
Stream #0:0: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 640x360, q=2-31, 12 fps, 12 tbr, 90k tbn, 90k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x1a34c40] Non-monotonous DTS in output stream 0:0; previous: 45000, current: 7500; changing to 45001. This may result in incorrect timestamps in the output file.
[mp4 @ 0x1a34c40] Non-monotonous DTS in output stream 0:0; previous: 45001, current: 15000; changing to 45002. This may result in incorrect timestamps in the output file.
[mp4 @ 0x1a34c40] Non-monotonous DTS in output stream 0:0; previous: 45002, current: 22500; changing to 45003. This may result in incorrect timestamps in the output file.
[mp4 @ 0x1a34c40] Non-monotonous DTS in output stream 0:0; previous: 45003, current: 30000; changing to 45004. This may result in incorrect timestamps in the output file.
[mp4 @ 0x1a34c40] Non-monotonous DTS in output stream 0:0; previous: 45004, current: 37500; changing to 45005. This may result in incorrect timestamps in the output file.
[mp4 @ 0x1a34c40] Non-monotonous DTS in output stream 0:0; previous: 45005, current: 45000; changing to 45006. This may result in incorrect timestamps in the output file.
[rtsp @ 0x19d6270] max delay reached. need to consume packetbitrate= 90.9kbits/s speed=0.951x
[rtsp @ 0x19d6270] RTP: missed 1 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packet
[rtsp @ 0x19d6270] RTP: missed 30 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packet
[rtsp @ 0x19d6270] RTP: missed 2 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packet
[rtsp @ 0x19d6270] RTP: missed 12 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packetbitrate= 76.3kbits/s speed=1.23x
[rtsp @ 0x19d6270] RTP: missed 122 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packet
[rtsp @ 0x19d6270] RTP: missed 1 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packetbitrate= 80.5kbits/s speed=1.14x
[rtsp @ 0x19d6270] RTP: missed 4 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packet
[rtsp @ 0x19d6270] RTP: missed 1 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packetbitrate= 83.3kbits/s speed=1.14x
[rtsp @ 0x19d6270] RTP: missed 2 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packetbitrate= 85.4kbits/s speed=1.13x
[rtsp @ 0x19d6270] RTP: missed 2 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packetbitrate= 83.6kbits/s speed=1.12x
[rtsp @ 0x19d6270] RTP: missed 3 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packet
[rtsp @ 0x19d6270] RTP: missed 1 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packetbitrate= 83.0kbits/s speed=1.14x
[rtsp @ 0x19d6270] RTP: missed 1 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packetbitrate= 82.3kbits/s speed= 1.1x
[rtsp @ 0x19d6270] RTP: missed 11 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packet
[rtsp @ 0x19d6270] RTP: missed 3 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packetbitrate= 82.4kbits/s speed= 1.1x
[rtsp @ 0x19d6270] RTP: missed 1 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packetbitrate= 82.2kbits/s speed=1.09x
[rtsp @ 0x19d6270] RTP: missed 5 packets
[rtsp @ 0x19d6270] max delay reached. need to consume packet
[rtsp @ 0x19d6270] RTP: missed 2 packets
frame= 242 fps= 12 q=-1.0 Lsize= 236kB time=00:00:22.83 bitrate= 84.7kbits/s speed=1.09x
video:229kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.169487%
Yeh they really are great, the reason I wasn't in spawn mode is I tried every thing humanly possible to get it to work, every combination in every node, but for sure the light at the end of the tunnel came with your advice to make a testvideo.mp4 file that proved the ffpeg command was working, that's a great debugging tool for anyone following this.