Raspivid and Node Red

Stupid me......I just got it....

The top is "Command" not "Name"

I was looking at the commonality and just treated it as the name and not the command.

Its working now, I just have the command flags for the image size wrong.

Ok, still have a problem but its much clearer now.

I updated the flow too.

It was failing as below but this was because raspivid and raspistill were triggered at the same time.

I fixed that.

Now the problem is that the video file gets overwritten, but the ui_media is caching the file somehow.

How can ui_media get updated?

Command failed: /usr/bin/raspivid -t 30000 -w 640 -h 480 -fps 25 -b 1200000 -p 0,0,640,480 -o /home/pi/.node-red/projects/undefined/ui-media/lib/Media/video.h264
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

[{"id":"1591fded.581fe2","type":"tab","label":"Video Capture","disabled":false,"info":""},{"id":"6e5e2f42.183ba8","type":"exec","z":"1591fded.581fe2","command":"raspistill","addpay":false,"append":"-vs -ex night -w 570 -h 570 -o -","useSpawn":"false","timer":"","oldrc":false,"name":"","x":680,"y":200,"wires":[["4f40679e.837c9"],[],[]]},{"id":"4f40679e.837c9","type":"base64","z":"1591fded.581fe2","name":"","action":"str","property":"payload","x":860,"y":180,"wires":[["c1afb31b.7911"]]},{"id":"c1afb31b.7911","type":"template","z":"1591fded.581fe2","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<img width=\"570px\" height=\"570px\" src=\"data:image/jpg;base64,{{{payload}}}\">","output":"str","x":1000,"y":180,"wires":[["a49e548c.732ac"]]},{"id":"a49e548c.732ac","type":"ui_template","z":"1591fded.581fe2","group":"6080d6c0.890608","name":"","order":4,"width":"17","height":"25","format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1140,"y":180,"wires":[[]]},{"id":"ecb7836.0f9c7","type":"ui_switch","z":"1591fded.581fe2","name":"Camera_Click","label":"","tooltip":"","group":"6080d6c0.890608","order":2,"width":3,"height":"3","passthru":true,"decouple":"false","topic":"Camera_Click","style":"","onvalue":"true","onvalueType":"bool","onicon":"fa-pulse fa-3x fa-camera","oncolor":"green","offvalue":"false","offvalueType":"bool","officon":"fa-photo fa-3x","offcolor":"blue","x":115,"y":200,"wires":[["d21306bb.9751c"]],"l":false},{"id":"40adfa7.cfc1f84","type":"trigger","z":"1591fded.581fe2","op1":"","op2":"false","op1type":"pay","op2type":"bool","duration":"8","extend":false,"units":"s","reset":"","bytopic":"all","name":"Click","x":390,"y":200,"wires":[["ecb7836.0f9c7","994ab145.0b08d"]]},{"id":"d21306bb.9751c","type":"switch","z":"1591fded.581fe2","name":"Camera","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":220,"y":200,"wires":[["40adfa7.cfc1f84"],[]]},{"id":"994ab145.0b08d","type":"switch","z":"1591fded.581fe2","name":"Click","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":200,"wires":[["6e5e2f42.183ba8"]]},{"id":"a7a4a4ec.caa168","type":"ui_media","z":"1591fded.581fe2","group":"2db625cf.759fb2","name":"","width":0,"height":0,"order":2,"category":"Media","file":"video.mp4","layout":"center","showcontrols":true,"loop":false,"onstart":false,"scope":"local","tooltip":"","x":670,"y":340,"wires":[[]]},{"id":"ac7596c1.99aee","type":"exec","z":"1591fded.581fe2","command":"/usr/bin/raspivid","addpay":false,"append":"-t 30000 -w 640 -h 480 -fps 25 -b 1200000 -p 0,0,640,480 -o /home/pi/.node-red/projects/undefined/ui-media/lib/Media/video.h264","useSpawn":"false","timer":"120","oldrc":false,"name":"Raspivid","x":680,"y":280,"wires":[["ee9b8c23.f45c4","ef684484.63d728"],[],[]]},{"id":"ee9b8c23.f45c4","type":"debug","z":"1591fded.581fe2","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1210,"y":240,"wires":[]},{"id":"ef684484.63d728","type":"exec","z":"1591fded.581fe2","command":"/usr/bin/MP4Box","addpay":false,"append":"-add /home/pi/.node-red/projects/undefined/ui-media/lib/Media/video.h264 /home/pi/.node-red/projects/undefined/ui-media/lib/Media/video.mp4","useSpawn":"false","timer":"","oldrc":false,"name":"MP4Box","x":840,"y":300,"wires":[["ee9b8c23.f45c4","236da555.82da52"],[],[]]},{"id":"236da555.82da52","type":"exec","z":"1591fded.581fe2","command":"rm","addpay":false,"append":"/home/pi/.node-red/projects/undefined/ui-media/lib/Media/video.h264 ","useSpawn":"false","timer":"","oldrc":false,"name":"","x":990,"y":320,"wires":[["ee9b8c23.f45c4"],[],[]]},{"id":"6a0790cf.355bf8","type":"ui_switch","z":"1591fded.581fe2","name":"Camera_Click","label":"","tooltip":"","group":"6080d6c0.890608","order":2,"width":3,"height":"3","passthru":true,"decouple":"false","topic":"Camera_Click","style":"","onvalue":"true","onvalueType":"bool","onicon":"fa-pulse fa-3x fa-camera","oncolor":"green","offvalue":"false","offvalueType":"bool","officon":"fa-photo fa-3x","offcolor":"blue","x":115,"y":280,"wires":[["ffeffcc8.e7e78"]],"l":false},{"id":"f115c5ab.b25bf","type":"trigger","z":"1591fded.581fe2","op1":"","op2":"false","op1type":"pay","op2type":"bool","duration":"8","extend":false,"units":"s","reset":"","bytopic":"all","name":"Video","x":390,"y":280,"wires":[["6a0790cf.355bf8","3b463fb6.07949"]]},{"id":"ffeffcc8.e7e78","type":"switch","z":"1591fded.581fe2","name":"Video","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":280,"wires":[["f115c5ab.b25bf"],[]]},{"id":"3b463fb6.07949","type":"switch","z":"1591fded.581fe2","name":"Video","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":530,"y":280,"wires":[["ac7596c1.99aee"]]},{"id":"6080d6c0.890608","type":"ui_group","z":"","name":"Camera","tab":"91b245b1.b4ed7","order":9,"disp":true,"width":"17","collapse":false},{"id":"2db625cf.759fb2","type":"ui_group","z":"","name":"CPU Temperature","tab":"4802b223.98b354","order":1,"disp":true,"width":30,"collapse":false},{"id":"91b245b1.b4ed7","type":"ui_tab","z":"","name":"Pump Control Dashboard","icon":"dashboard","order":3,"disabled":false,"hidden":false},{"id":"4802b223.98b354","type":"ui_tab","z":"","name":"Proelian Server","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

I am not at my computer now, but have you tried googling for those errors?

ENIOSPC error usually means it gas run out of space on the storage card.

Ok, I have most of it working. But there is a problem with the ui_media node.
It seems to have cached the video.
I have no .mp4 files on the system now yet it still portrays the old video.
I overlay where the video is with a newer file, yet the older file is still there.
I need ui_media to trigger a reload should the file change.
Here is the location of the file I overlay.
/home/pi/.node-red/projects/undefined/ui-media/lib/Media/video.mp4

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