[MPlayer-users] mencoder with olpc

Dennis Nezic dennisn at dennisn.dyndns.org
Tue May 20 03:07:13 CEST 2008

> On Mon, 19 May 2008 11:41:47 -0400,
> Dennis Nezic <dennisn at dennisn.dyndns.org> wrote:
> Has anyone had any luck recording video from the olpc?
> The most I've managed to get is the first few frames, but only if I
> force -fps to a low value (like 1). At that point, it starts recording
> at ~1.3fps, and after a few seconds starts dropping frames due to
> "video buffer full".
> If I don't specify -fps, it skips *every single* frame.
> (mencoder -tv noaudio -o bla.avi -ovc copy tv://)

Ahh ... it turns out that (one of) the problem(s) was with the lack of
audio information ... ie. in the -tv options, I should have specified
"nosound". Why nosound instead of "alsa" or "alsa:forceaudio", etc?
Well, I still haven't managed to get mencoder to capture an audio
stream from the olpc :\ (although it does work on my other boxes) -- so
I ended up recording audio separately, via "arecord bla.wav".

BUT, that's not all. Even if "nosound" gets explicitly defined,
although it does try to start recording, it *skips every single frame*
-- I know the cpu is slow, but it can't be /that/ slow. To fix this, I
had to manually specify the -fps to 30000/1001 (~29.97).

Then I had to play around with several -ovc video codecs. -ovc x264 and
-ovc xvid, although they may have produced better results, were simply
too much work for the cpu -- it was only able to encode at ~3fps, then
filled the video buffer and screwed up. I ended up using "-ovc lavc"
with "-lavcopts vcodec=mpeg4". (vcodec=libxvid seemed to encode faster,
but I wasn't able to play it back in mplayer :|. vcodec=h263 was also
acceptably fast, but shitty quality.)

Also, recording at the full 640x480 (1.333) was too slow for me, so I
used the 352x288 (1.222) mode. I think this fucks up the aspect, so
I'll have to fix that up later.

And that's that. In summary, to record video, I:

arecord bla.wav    &

mencoder \
   -tv noaudio:width=352 \
   -ovc lavc -lavcopts vcodec=mpeg4 \
   -o bla.avi \
   -fps 30000/1001 \

Also, for improved performance, you should output the encoded data to
ramfs. (AND remember to copy to disk later!)

mount -t ramfs /dev/ram4 /mnt/ram
chmod a+rwx /mnt/ram

Now, all I have to do is combine the 2 streams, fix the video aspect,
and other miscellaneous post-processing, probably in cinelerra.

More information about the MPlayer-users mailing list