Recording video with N800
N800 doesn't come with a video recorder program. So I tried to figure out how to record video with it. As the multimedia architecture has the gstreamer as it's building blocks, so I thought it's quite easy to accomplish this, although I only have a few knowledge about gstreamer.
The things you need are gstreamer0.10-tools package (you can compile it yourself) and the osso-xterm terminal. So you're supposed to type the command line described below in the terminal.
This is the basic diagram of doing the recording. We need to split the video stream from camera, one for displaying on the screen and one to be fed to the muxer and saved to file. Another stream is coming from the microphone and also fed to the muxer.
Camera->tee->Screen
|
+-> Video Encoder-+
|
+-> Muxer-> File
|
Microphone ----------------+
So let's figure out the gstreamer elements needed.
First, the video source. Only two sources are relevant for this: gconfv4l2src and v4l2src. It seems that gconfv4l2src is better as it will flip the image vertically when you twist the camera.
Then the audio source. It seems that dsppcmsrc will do this.
Here is the command I used, the output is filtered so only relevant outcomes are displayed.
$ gst-inspect-0.10 |grep src
...
gconf: gconfv4l2src: GConf wrapper for v4l2src video orientation
video4linux2: v4l2src: Video (video4linux2/raw) Source
...
dsppcm: dsppcmsrc: DSP PCM Src
...
Then look for the encoder. It seems that only one encoder available. First I don't know whether this is for audio or video, but apparently it's for video.
$ gst-inspect-0.10 |grep enc
hantro: hantro4200enc: Hantro4200Encoder
Then the muxer. It seems also there is one muxer (with some demuxers) available.
$ gst-inspect-0.10 |grep muxer
...
avi: avimux: Avi muxer
...
Then the screen sink.
$ gst-inspect-0.10 |grep sink
...
xvimagesink: xvimagesink: Video sink
...
So the final diagram would be:
gconfv4l2src->tee->xvimagesink
|
+->hantro4200enc-+
|
+-> avimuxer-> filesink
|
dsppcmsrc ----------------------+
Then let's craft the diagram into some command line:
$ gst-launch-0.10 gconfv4l2src ! video/x-raw-yuv,width=176,height=144 ! tee name=tee ! hantro4200enc ! avimux name=mux ! filesink location=test.avi { dsppcmsrc ! queue ! audio/x-raw-int,channels=1,rate=8000 !audioconvert ! mux. } { tee. ! video/x-raw-yuv ! xvimagesink sync=false }
There I tell gstreamer to capture the video with 176x144 dimension and save it to test.avi.
Run it as user and you will have test.avi file in current directory. Too bad that the internal media player won't play this as it probably doesn't recognize the raw audio data inside the avi file.
Playing it with mplayer I noticed that the encoder is apparently an H.263 video encoder. There's also a glitch I noticed that the audio is out of sync with the video. But probably because I didn't correctly assembly the gstreamer elements.
It could be better if we add some encoding in the audio side so the file could be directly playable. In order to do that, just compile the appropriate plugin and try. And a good idea is to make a decent UI for this.
Arthur Odom:
combinative fetisheer bookdom thyreoepiglottic trumperiness typification montmorilonite glauberite
West Lyon Community School
http://www.faacusa.com/