I want to interface USB camera with intel edison and want to have live video streaming over wifi connection on pc. I have followed GitHub tutorial for live video streaming using websocket as per given in below link.
https://github.com/drejkim/edi-cam drejkim/edi-cam · GitHub
At the same time i also want to capture image and store that image of the live video. How to capture image and store image on intel edison and further transmit to pc over wifi again. it would be very helpful if i get some proper guidance.
I am not that much aware of intel edison board.
If you are using FFMPEG to interact with the camera I suggest you to look into https://ffmpeg.org/ffmpeg.html the documentation of this package. Also, take a look at: https://trac.ffmpeg.org/ https://trac.ffmpeg.org/ and http://manpages.ubuntu.com/manpages/oneiric/man1/ffmpeg.1.html FFMPEG man
According to the FFMPEG man you can capture an image with: ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
If what you want is to extract an image from the video you can try with the example: http://blog.roberthallam.org/2010/06/extract-a-single-image-from-a-video-using-ffmpeg/comment-page-1... Extract A Single Image From A Video Using FFMPEG
is there any way to automatically start the video streaming via wifi as soon as i power on my edison. I have to configure it for live streaming by giving some commands.
Can you help me with this.?
I have tried to capture image using ffmpeg, with the help of below code line../ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 -vframes 1 image.jpeg
But i am not sure whether I am capturing image or not. I am not able to find the location where that image has been stored,
Can you tell me where that image is stored.?
I am not sure I am going in right direction or not.
I have to interface usb camera to the intel edison and want live streaming on pc or tablet over wifi.
I also want to capture image when it is required.
What is the best way to do this.?
Please guide me for this.
Yes you can run a script at boot. For this you can create a .sh script and set it as an executable with chmod +x. Then, you have to create a service in /lib/systemd/system with the structure of [Unit] [Service] where you indicates to run the script. Once you have created the service you need to run the commands systemctl start yourservice.service and systemctl enable yourservice.service for make them run after every boot.
For example, if you want to run a python script at boot you need to do something like:
root@edison:~# vi script.sh
In order to make it an executableroot@edison:~# chmod +x script.sh
Then, you must create the service
root@edison:~# vi /lib/systemd/system/blinkpy.service
Description=Blink with Python
Finally, you need to start and enable the service
root@edison:~# systemctl daemon-reload
root@edison:~# systemctl start blinkpy.service
root@edison:~# systemctl enable blinkpy.service
After you used ./ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 -vframes 1 image.jpeg are you getting a message in the Terminal Console? Have you checked with ls / ? I think you can also try with use ./ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 -vframes 1 /home/root/image.jpeg.
Are you able to see video0 in /dev?
Were you able to run the server from the tutorial in https://github.com/drejkim/edi-cam drejkim/edi-cam · GitHub ?
thanks for your reply.
yes, i am able to see video0 in /dev, but i tried the other command also you said which mention the location of image, but i couldn't find any file with image.jpeg.
when should i run this command, i run this command after i start streaming the video but i am not getting any result.
one more query is, can guide me how can i start this live streaming followed in https://github.com/drejkim/edi-cam drejkim/edi-cam · GitHub at boot startup.
Like when i power on my edison it should directly start streaming live video on laptop through wifi. So, the other thing is it also should get connected to available wifi.?
While you are streaming try to run the command ffmpeg -i /dev/video0 /home/root/picture1.jpg then you should have a file called picture1.jpg in /home/root
If you want to run the server at boot, you need to do the same thing I did in but with the server. You may need to include Environment=NODE_PATH=/usr/lib/node_modules while setting [Service] in your service.
It's working now. I created a script file which runs my camera at boot startup.
One more query is, can you look on this https://github.com/drejkim/edi-cam drejkim/edi-cam · GitHub tutorial. The problem is i want to stream live video on any of the devices which are connected through wi-fi network. But I can only stream the video in my laptop through which i had configured my edison. when I click that link http://myedison.local:8080 http://myedison.local:8080 from other laptops which are already connected through the same wifi. It shows that the web page is not available.
Can you suggest me where i have to change in my code..
I'm streaming video successfully from my edison as given on this link https://github.com/drejkim/edi-cam drejkim/edi-cam · GitHub
but when I try to run the following command from ssh while streaming as u suggested, it gives me the following errors:-
./ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 -vframes 1 image.jpeg
-sh: No such file or directory
ffmpeg -s 320x240 -f video4linux2 -i /dev/video0 -vframes 1 image.jpeg
-sh: ffmpeg: command not found
ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
-sh: ffmpeg: command not found
I've already installed ffmpeg and I can stream video also. Then why this error shows "ffmpeg: command not found?"
I cannot take picture while streaming video with this command.
how can i solve this ??
Hi Malay_soni, I ran the tutorial edi-cam, I tested with an Edison running version 146 and I was able to use 4 different PCs as clients at the same time while using the same network
Are you having an error message while trying to see the stream on the other devices/PCs? Or is it that is not loading?
If the problem is that the devices are not loading the stream, it could be a problem with the network and not with the code itself.
Hi email@example.com , the message "ffmpeg: command not found" is due to a proble m while searching the command/package/library. How did you installed ffmpeg? Did you install the latest version?
Great..!!! Thanks for your the guidance.
I don't think there is any network problem. I will look into it and let you know.
Hi, i managed to follow through the instructions on https://github.com/drejkim/edi-cam GitHub - drejkim/edi-cam: Video streaming on Intel Edison , my webcam is Logitech C270 however when i node server.js it only display
HTTP server listening on port 8080
WebSocket server listening on port 8084
Listening for video stream on port 8082
"Stream Connected: 127.0.0.1:52995 size: 320x240"
There is a missing line of
Can you suggest where did i go wrong?
Which image are you running?
Are you getting the correct outputs after running find /lib/modules/* -name 'uvc', lsmod | grep uvc and ls -l /dev/video0?
On the edi-camedi-cam/web/client/index.html you need to put the IP address of the board and not the hostname.
Also, on the web browser you need to type the IPaddres:8080 in order to have access to the camera.
However, now it only shows "Loading" instead only viewing my real-time footage of webcam.
Any idea where did i went wrong this time?
Yes I'm getting the correct outputs for the three commands.
Also, when i type in the following command:
It shows me a output of :159.devkit for my version of image.
Check the file edi-cam/web/client/index.html and be sure that you have placed the correct IP address of your board in the 34th line for the wsUrl variable.
I got the same behavior but I checked again the IP address of my board with ifconfig noticing that the IP address had changed. Let me know if this is happening to you too.