IP camera: stream and record a fragment

New update. I reinstall the ffmpeg and put sudo ffmpeg as u suggested. I tried two things.

  1. Run the sudo ffmpeg in Node Red flow using Exec node and the video saved only show black screen.
  2. Run the exact same command in Pi terminal and the video saved can be view/play.

Seems that using terminal, the command can be executed and have a good output file but it was a different story when using Exec node.

Any thoughts?

I suspect access rights problem. The user running NR has different rights compared to the user running the terminal

Different users??

Where do you try to save the file? How does access rights for that folder look like?

i use the same user. i save the file to /home/pi directory

how to check the difference between user running NR and user running the terminal?

If it is the same user, there is no difference. User is pi?
How did you instal NR? Using the script?
What version of NR
How is the exec node configured? Show image like this below

I still believe in some kind of access rights issue

yes. user is pi. yes installed using script. this is the exec node configuration - command used is ffmpeg -rtsp_transport tcp -i rtsp://xxx:xxx@192.168.1.236:554//h264Preview_01_main -r 10 -t 10 -vcodec copy -acodec copy /home/pi/video.mp4 -y

Do you see the difference?
Your exec node is not configured the same. Try now with spawn mode as I have it

I assume the payload you are passing in is correct??

you mean try using http link? but ur command doesnt have time in it. i only want to record a fragment of it for example 60 sec only. already tried the spawn mode. same result

the payload is from timestamp to change node to the path of the video to be save - /home/pi/video.mp4

I have no more ideas

is your command work? it saved the entire stream?

Of course for me it works. I do not need sudo in command, it works anyway with various commands, no problems

Sorry, have no more ideas why it is not working for you

for ur command, can set time for it? for example only want to save 60 sec of the stream

done. the video saved successfully. thank youu

Have you checked all three outputs of the exec node, with debug nodes set to show Complete Message? What errors do they show?

Already done that Mr.Colin. Now the issue has been fixed. Basically, need to do several adjustments:

  1. Make sure the ffmpeg installation is correct.
  2. Configuration of exec node - need to untick the append to msg.payload box.
  3. Both spawn & exec modes can be used - no issue.

Good to hear!

need to untick the append to msg.payload box

OK, exellent

if i can ask one more question?