hexadecimalDinosaur/octoprint-cli

For your 'Potential Features' item 'Webcam Stream'

Opened this issue · 0 comments

Not a problem report, just some input. First, thank you for your work on this project, a helpful add on to OctoPrint!

For your 'Potential Features' item 'Webcam Stream' :

My work is still in progress, however I mashed up a first version of displaying the output of your program on the video streams I have from two webcams on my AnyCubic Kobra printer. I struggled to get the webcam daemon that OctoPrint uses to display video. So moved to VLC's command line tool cvlc. I added the overlay of some of the data out of your program to the two feeds. Two 640 by 480 video feeds at 15 fps keep a Raspberry Pi 3 4 core at about 60% utilization while OctoPrint is printing. I still have work to do. Below is two examples of cvlc displaying your data and the requisite bash scripts generating the data from your octoprint-cli print status command. I am currently running each of the four tasks in individual tmux sessions. Note, you need to install your app, gawk and vlc on your OctoPrint machine. Good hunting!

#put in tmux session
cvlc -v v4l2:///dev/video2:width=640:height=480:chroma=yuyv:fps=15 --sout '#transcode{vcodec=mp2v,acodec=none,fps=15,sfilter=marq{file=bed.txt,size=-2,color=16776960}}:rtp{mux=ts,sdp=rtsp://:8888/live.sdp}'

#put in tmux session
cvlc -v v4l2:///dev/video0:width=640:height=480:chroma=yuyv:fps=15 --sout '#transcode{vcodec=mp2v,acodec=none,fps=15,sfilter=marq{file=endo.txt,size=-2,color=16776960}}:rtp{mux=ts,sdp=rtsp://:8889/live.sdp}'

# put in tmux session
watch -n 5 "octoprint-cli print status | gawk -F':' '/Extruder Temp: /{print strftime(\"%H:%M:%S \"), \$0; exit}' > endo.txt"

# put in tmux session
watch -n 5 "octoprint-cli print status | gawk -F':' '/Progress: /{print strftime(\"%H:%M:%S \"), \$0; exit}' > bed.txt"

cvlc_example_01