PS2 Eyetoy Webcam on Xubuntu 10.10 Recording and Playback
Sunday, January 9th, 2011More fun to be had with your PS2 eyetoy as webcam. This all was tested using the silver eyetoy, but I see no reason why the black one won’t function just the same.
(Remember this is without pulseaudio!)
(a copy of the post I made on Ubuntuforums)
Recording Sound:
First off, define which device is generating the sound from the microphone
Code:
aplay -l
This tells me my eyetoy microphone is card 1, device 0, which translates to plughw:1,0. To record sound from the mic enter this command in a terminal:
Code:
arecord -f cd -t wav -c 2 -D plughw:1,0 foobar.wav
This records a wav file at CD quality.
Video Playback:
Lots of choices here:
Code:
mplayer tv:// -tv device=/dev/video0
Code:
cvlc v4l2:///dev/video0
and the monster that is gstreamer (you’ll need to ensure gstreamer-tools is installed)
Code:
gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! xvimagesink
Capturing Video - Video and Sound:
This proved harder than I thought as vlc, ffmpeg and mencoder flatly refused to do the job with all the command lines I found out on google.
Using gstreamer again, although this is a bit unwieldy:
Capture Video only (no concurrent playback):
Code:
gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! queue ! videorate! 'video/x-raw-yuv,framerate=30/1' ! theoraenc ! queue ! oggmux ! filesink location=output.ogg
Capture Video and Sound (with concurrent playback):
Code:
gst-launch v4l2src ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! tee name=t_vid ! queue ! videoflip method=horizontal-flip ! xvimagesink sync=false t_vid. ! queue ! videorate ! 'video/x-raw-yuv,framerate=30/1' ! queue ! mux. alsasrc device=plughw:1,0 ! audio/x-raw-int,rate=48000,channels=2,depth=16 ! queue ! audioconvert ! queue ! mux. avimux name=mux ! filesink location=output.avi
FFMPEG
Capture Video and Sound (variants on):
Code:
ffmpeg -t 10 -f video4linux2 -s 640x480 -r 15 -i /dev/video0 -f alsa -ac 2 -i plughw:1,0 -aspect 4:3 -s 720x400 -qscale 3 video-with-sound.flv
Code:
ffmpeg -t 10 -f video4linux2 -s 640x480 -r ntsc -i /dev/video0 -f alsa -ac 2 -i plughw:1,0 -qscale 3 video-with-sound.avi
Just video:
Code:
ffmpeg -f alsa video4linux2 -s 720x480 -r 30000/1001 -i /dev/video0 -sameq -aspect 4:3 -f avi -vcodec mjpeg -r 30000/1001 -y output.avi
Enjoy ![]()