Page 1 of 4

Raspberry Pi camera module

Posted: Monday 9th October 2017 3:44am
by sony
Hello,
Is there an simple example program to use RPi camera module as video streaming like usb webcam?

Thank you for your attention.
Regards

Sony

Re: Raspberry Pi camera module

Posted: Monday 9th October 2017 2:52pm
by cogier
I presume you mean streaming from the pi to a computer using SSH as Matt and I did with his robot (It had a camera on it then!).
2016-08-07 14.11.32.resized.jpg
2016-08-07 14.11.32.resized.jpg (418.62 KiB) Viewed 13355 times

On the Pi create a file (e.g. startvideofeed.sh) with only the following: -

raspivid -o - -t 0 -hf -w 640 -h 360 -fps 25 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554}' :demux=h264

Change permissions:-
sudo chmod +x startvideofeed.sh

Run the file ./startvideofeed.sh

On the main computer open VLC from the 'Media' menu select 'Open Networkstream'. Enter rtsp://192.168.2.111:8554/ (Where 192.168.2.111 is the IP of the Pi)

Re: Raspberry Pi camera module

Posted: Tuesday 10th October 2017 12:10am
by sony
Thank for reply,
I mean streaming video with gambas. I has been tried a webcam with gambas to stram the video.
By use drawingarea I can see the current video via webcam.
Now I want to change the webcam with PiCam.

regards

Sony

Re: Raspberry Pi camera module

Posted: Tuesday 10th October 2017 11:05am
by stevedee
Hi sony, you asked for the code on my blog, so here it is.

As I mentioned, it is not finished (typical!). It will stream video (which I use to set the camera up and check focus) and it will capture at 90fps, but it doesn't do both at the same time.

To stream, this program simply runs the stream.sh script. You also need to install VLC.

The real-time clock stuff won't make any sense. I use it in conjunction with a simple RPi time server, so I can time stamp files.

My original blog post: https://captainbodgit.blogspot.co.uk/20 ... 90fps.html

Re: Raspberry Pi camera module

Posted: Tuesday 10th October 2017 12:38pm
by stevedee
Re: MyWebCam_test on RPi, do you have: /dev/video0 and v4l2 driver?

If the software is a bit old, update:-

sudo rpi-update
sudo apt-get update
sudo apt-get upgrade

Still no /dev/video0?, run: sudo modprobe bcm2835-v4l2

Re: Raspberry Pi camera module

Posted: Wednesday 11th October 2017 3:26am
by sony
Hi Steve,
The program MyWebCam_test has been tested and running. My problem is my webcam device have max frame rate at 30 fps, so I decided to change the webcam with PiCam that have frame rate at 90fps. I just need small program like MyWebCam_test by using PiCam as my reference to develop my idea. My project is shoot the image on moving object with camera device.

Re: Raspberry Pi camera module

Posted: Wednesday 11th October 2017 8:04am
by stevedee
sony wrote: Wednesday 11th October 2017 3:26am ...My project is shoot the image on moving object with camera device.
How are you planning to use 90fps video with your Gambas test program?

Re: Raspberry Pi camera module

Posted: Wednesday 11th October 2017 9:33am
by sony
I use for higher fps to get good image, currently I use 30fps can't copied the the moving object clearly.
I use gray scale video and by using drawingarea I copy an sample area then count the pixel.
How I count? I copied the image, the corner pixel value as reference value. I get all pixel value in the sample area and compare with reference value. Let's say if pixel value > 10 then I add counter until all pixel value compared.

Re: Raspberry Pi camera module

Posted: Friday 13th October 2017 6:25pm
by sony
Hello,
Now I am able to appearing the actual video with command below:

Shell "raspistill -t 0 -p 454,266,350,350 -ex auto -hf -rot 180 -ifx none"

My problem I can not copying the video to Drawingarea as picture.
Please help me to copying the object outside of form1.form

Sony

Re: Raspberry Pi camera module

Posted: Saturday 14th October 2017 10:35am
by sony
hello,
Base on source code from https://github.com/charlie-ogier/PiCam
I made a small program to copied the screen but the object from picamera can not copied.
please help me.

Sony