*

Welcome, Guest. Please login or register.

Get your own OLPC - Buy an XO laptop on eBay!
Pages: 1 [2]
Print
Author Topic: Camera via Mplayer  (Read 19859 times)

#15 Re: Camera via Mplayer

joshuajon
Contributor
*
Posts: 35


March 14, 2008, 05:33:12 PM

Motion is cool, but doesn't seem to provide v4l.  Any more ideas?

*update*

Okay, so v4l is a kernel module.  I don't have it, but maybe it's included in some of the newer versions.
« Last Edit: March 14, 2008, 06:39:47 PM by joshuajon » Logged

#16 Re: Camera via Mplayer

markhadman
Senior Contributor
**
Posts: 112


April 01, 2008, 04:24:51 PM

OK, so how does the sugar Record activity grab video? Can we use another method to grab photos/video, without sugar/record/journal?
Logged

#17 Re: Camera via Mplayer

markhadman
Senior Contributor
**
Posts: 112


April 01, 2008, 07:03:44 PM

Actually, it looks like GStreamer is the key

see http://wiki.laptop.org/go/Programming_the_camera

Might not work with Mplayer, but that's not really the point. The point is GStreamer can be used to chain together different devices, plug-ins and files, like this:
Code:
gst-launch-0.10 v4l2src ! ffmpegcolorspace ! pngenc ! filesink location=foo.png
or
Code:
gst-launch-0.10 v4l2src ! ffmpegcolorspace ! ximagesink

IMPORTANT NOTE: those 'pipes' are exclamation marks, NOT the vertical bar that you normally use to pipe shell commands together.

Let's have some fun!
Logged

#18 Re: Camera via Mplayer

scrub
Commenter

Posts: 19


April 01, 2008, 07:59:55 PM

I set up a script to take a picture and display it using qiv (which I installed as root using yum install qiv).  You'll have to make a directory named pics under your olpc home directory, and make a file in there named number.txt with just the number 0 in it. 

My script has:

blah=`cat /home/olpc/pics/number.txt`
blah2=`expr $blah + 1`
gst-launch v4l2src ! ffmpegcolorspace ! pngenc ! filesink location=/home/olpc/pics/pic$blah2.png
echo $blah2 > /home/olpc/pics/number.txt
qiv /home/olpc/pics/pic$blah2.png /home/olpc/pics/*.png

I bound alt-p to run that script, so when I press alt-p the laptop takes a picture and save it to the pics directory with a unique file name, then displays the photo in qiv.

Enjoy!
Scrub
Logged

#19 Re: Camera via Mplayer

brisalta
Senior Contributor
**
Posts: 143


April 01, 2008, 11:35:15 PM

Actually, it looks like GStreamer is the key

see http://wiki.laptop.org/go/Programming_the_camera

Might not work with Mplayer, but that's not really the point. The point is GStreamer can be used to chain together different devices, plug-ins and files, like this:
Code:
gst-launch-0.10 v4l2src ! ffmpegcolorspace ! pngenc ! filesink location=foo.png
or
Code:
gst-launch-0.10 v4l2src ! ffmpegcolorspace ! ximagesink

IMPORTANT NOTE: those 'pipes' are exclamation marks, NOT the vertical bar that you normally use to pipe shell commands together.

Let's have some fun!

 I have been wondering why people have been messing with Mplayer when totem is already installed?  Totem uses gstreamer.  I was actually thinking of doing this with totem and downloading the additional codecs and plugins for it and creating a sugar wrapper
Logged

#20 Re: Camera via Mplayer

markhadman
Senior Contributor
**
Posts: 112


April 02, 2008, 07:25:20 AM

I have been wondering why people have been messing with Mplayer when totem is already installed?  Totem uses gstreamer.  I was actually thinking of doing this with totem and downloading the additional codecs and plugins for it and creating a sugar wrapper
   
I'm not sure people are aware of gstreamer! I hadn't heard of it until yesterday, and it doesn't seem to be particularly well documented yet. any good e-books out there?
Logged

#21 Re: Camera via Mplayer

brisalta
Senior Contributor
**
Posts: 143


April 02, 2008, 08:22:44 AM

I have been wondering why people have been messing with Mplayer when totem is already installed?  Totem uses gstreamer.  I was actually thinking of doing this with totem and downloading the additional codecs and plugins for it and creating a sugar wrapper
   
I'm not sure people are aware of gstreamer! I hadn't heard of it until yesterday, and it doesn't seem to be particularly well documented yet. any good e-books out there?

There is a ton of information on both totem and gstreamer at their web sites. http://www.gnome.org/projects/totem/ has information on totem and gstreamer including how to create debug output.  Also links to the gstreamer website.
Logged
Pages: 1 [2]
Print
Jump to:  

Members
Total Members: 2406
Latest: sembik
Stats
Total Posts: 31943
Total Topics: 3843
Online Today: 28
Online Ever: 238
(April 18, 2011, 09:48:50 PM)
Users Online
Users: 0
Guests: 9
Total: 9