Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#41
Hhmmm... Does your (Bundyo's build, right?) mplayer have pnm output?
Code:
mplayer -vo help
|grep pnm, or post the whole thing, since I'm curious.
From mine:
Code:
MPlayer dev-SVN-r26265-3.4.4 (C) 2000-2008 MPlayer Team
CPU: ARM
Internet Tablet OS version: RX-34+RX-44_2008SE_2.2007.50-2_PR_MR0

Available video output drivers:
        xv      X11/Xv
        x11     X11 ( XImage/Shm )
        xover   General X11 driver for overlay capable video output drivers
        sdl     SDL YUV/RGB/BGR renderer (SDL v1.1.7+ only!)
        fbdev   Framebuffer Device
        fbdev2  Framebuffer Device
        omapfb  Nokia 770 video driver
        caca    libcaca
        null    Null video output
        mpegpes Mpeg-PES file
        yuv4mpeg        yuv4mpeg output for mjpegtools
        png     PNG file
        jpeg    JPEG file
        md5sum  md5sum of each frame
Some kind of plain image format would be nice here; if Bundyo's has it, I might have to keep both binaries on my SD, and swap them out to run them.
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#42
Originally Posted by Benson View Post
Hhmmm... Does your (Bundyo's build, right?) mplayer have pnm output?
Yes, Bundyo's has pnm. Listed as "PPM/PGM/PGMYUV file".

OFFTOPIC: As an aside, I found that, since I have KDE installed, I can move binaries and libs to the /usr/local/bin and /usr/local/lib dirs (on the memory card) and everything still works fine. I keep all of my mplayer binaries in the /usr/local/bin folder with different names (mplayer1, mplayer2 and mplayer26) and then I softlink /usr/bin/mplayer to the one I want to use as my default. I also created a /usr/local/var/cache/apt/archives and softlinked my /var/cache/apt/archives to it. That freed up a lot of space.

Last edited by qole; 2008-04-16 at 21:41.
 
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#43
Yes, that would work too, but I figured I'd go whole hog, since I gotta reflash anyway, and keep a clean system (core apps installed, but not fiddling with) bootable on main memory, a big, all-in-one system on the SD. (And a FAT partition for maemo-mapper maps and such stuff that should be accessible to both, just as a normal mmc2.)

So I guess I go download some more... averaging does help, though; had to try it, even with going through pngs painfully slow.
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#44
Hi everyone!

I have spent some more time trying to figure out gstreamer, and it looks like it IS possible to record fairly high-quality video (with audio) from the tablet, just using the built-in framework. You just have to fiddle with the encoder settings.

It looks like we're stuck with the Hantro 4200 software encoder (news release, skimpy specs), probably because Nokia already had a license for it. You can get a fairly detailed listing of the settings available by typing "gst-inspect hantro4200enc" at the command prompt.

You'll need to go into red pill mode and install, at least, the gstreamer0.10-tools package. If you don't have gstreamer0.10-plugins-good and gstreamer0.10-hantro installed, do that too. But you probably already have that, as I think OS2007 and OS2008 include them by default.

Here's my gstreamer test command line. Copy and paste this on the command line.

Code:
gst-launch gconfv4l2src ! 'video/x-raw-yuv,width=320,height=240,framerate=(fraction)15/1' ! hantro4200enc profile-and-level=5 bit-rate=515 ! queue ! mux.  dsppcmsrc ! 'audio/x-raw-int,rate=8000,channels=1' ! queue ! mux. avimux name=mux ! filesink location=/media/mmc1/gstest.avi

Here's my gstreamer test, explained:

1. Input:
Video Input - gconfv4l2src
  • This source is the Video 4 Linux 2 source, tweaked so that it can tell if you have flipped the N800's camera or not.
Audio Input - dsppcmsrc
  • This source is the name of the N8x0's microphone input.

2. Video codec:
  • As I mentioned above, we've only got Hantro 4200. So I chose the highest bitrate and best MPEG-4 codec available: MP4 Simple Profile, Level 5, 515 kbps

3. Audio codec:
  • There are two audio compression formats available to us, but, because I wanted to avoid any extra CPU use, I didn't compress the audio at all.

3. Output:
  • I used AVIMUX to create a AVI container. As far as I can tell, this is a big weakness of the tablet's GStreamer framework. AVIMUX doesn't allow for uncompressed video, and there is a definite problem with audio-video sync in the final file.
  • This version of the pipeline does NOT include a display of the video on the screen. I'm working on that, it shouldn't be hard, but it may hurt the quality of the recorded output.

Here is a test video that I made via this method and then uploaded directly to YouTube. Yes, it is very goofy. It was intended to test for quality and lip-sync. The quality is great, the lip-sync is NOT.



EDIT: Interestingly, mplayer plays the video without A/V sync issues, however all other media players have sync issues. I'm working on a mencoder command that will fix these problems...

EDIT2: See below for my theory on audio-video sync issues.

Last edited by qole; 2008-04-21 at 17:32.
 

The Following 7 Users Say Thank You to qole For This Useful Post:
Posts: 99 | Thanked: 17 times | Joined on Mar 2008
#45
wow that is good quality video qole
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#46
I think the video and audio are falling out of sync when recording because the camera is generating all of these buffer errors, which results in glitches in the video stream. I can distinctly see little video glitches in the video I uploaded to youtube, and each time there's a glitch, the audio falls farther behind.

Where would I register a bug? I think this is a bug in the camera's V4L2 driver. I would like it fixed!
 
Posts: 99 | Thanked: 17 times | Joined on Mar 2008
#47
Originally Posted by qole View Post
I think the video and audio are falling out of sync when recording because the camera is generating all of these buffer errors, which results in glitches in the video stream. I can distinctly see little video glitches in the video I uploaded to youtube, and each time there's a glitch, the audio falls farther behind.

Where would I register a bug? I think this is a bug in the camera's V4L2 driver. I would like it fixed!
If you disabled the screen while recording would that alleviate some stress on the cpu and give you more fps/less lag?
 
Posts: 156 | Thanked: 44 times | Joined on Dec 2007
#48
Originally Posted by qole View Post
Does it not flip in the standard Nokia camera app? I notice that the built-in apps do the auto-flip, but apps that use generic V4L2 don't flip the video properly.
The sensor is connected via a GPIO pin. So the app has to check it, AFAIK.
 
tso's Avatar
Posts: 4,783 | Thanked: 1,253 times | Joined on Aug 2007 @ norway
#49
note the gconf entry i wrote about earlier...

here is how i think nokia does it. the camera driver does the checking, and when a signal is noticed on whatever sensor it is that register the camera movement, it sets the gconf setting. then the nokia apps read said setting to see if it should flip the incoming data or not...
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#50
Originally Posted by Voltron View Post
If you disabled the screen while recording would that alleviate some stress on the cpu and give you more fps/less lag?
This isn't a lag problem, it doesn't matter how you set the resolution, framerate, whatever. There are errors being generated by the v4l2 camera driver, which results in mangled frames. The "videocamera" app suffers from this (go to YouTube and search on N800 camera test, you'll see that every video has the same problem), and every test I have conducted gets these errors. Mencoder prints error messages each time it happens. The porter of "motion" for the tablets said he had to work around these buffer errors.

As a side note, I don't think I would record with the video being echoed to the screen on the tablet; there just isn't enough CPU.

Originally Posted by tso View Post
note the gconf entry i wrote about earlier...

here is how i think nokia does it. the camera driver does the checking, and when a signal is noticed on whatever sensor it is that register the camera movement, it sets the gconf setting. then the nokia apps read said setting to see if it should flip the incoming data or not...
Maemo GStreamer has two camera sources, v4l2src, which is the camera with no flip capability, and gconfv4l2src, which handles camera flip. Other software, like mencoder, doesn't have this gconf wrapper, so no camera flip for them!
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 15:30.