Active Topics

 


Reply
Thread Tools
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#51
A quick follow up. I have been unable to re-encode the GStreamer output with MEncoder in any way that fixes the A/V sync. Like I said, MPlayer can play the original file without losing the sync (much) but once I run it through MEncoder, no player can play the transcoded file in sync.

So I want some way of getting MPlayer's A/V sync magic used in a transcoding solution that lets all players play the transcoded file the same way that MPlayer plays the original file. Some kind of "MPlayer-repair" solution.

I have not been able to figure this out, however. Nothing I have tried has been successful.

Last edited by qole; 2008-05-03 at 22:33.
 
Posts: 178 | Thanked: 40 times | Joined on Aug 2007 @ UK
#52
Stupid question maybe but are you transcoding with the same fps? Another possibly stoopid idea: do any of the encoding options support "key frames" and do they play any role in keeping a/v in sync?
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#53
Originally Posted by muki View Post
Stupid question maybe but are you transcoding with the same fps?
Yes.

Originally Posted by muki View Post
Another possibly stoopid idea: do any of the encoding options support "key frames" and do they play any role in keeping a/v in sync?
Yes, there are ways of setting key frames. I'm not sure what role they have in keeping a/v in sync. I turn on all of MEncoder's a/v sync-related command-line switches, and it is supposed to have all sorts of built-in stuff for keeping a/v sync.

It just seems weird to me that MPlayer obviously knows how the A/V should be synced, and yet MEncoder doesn't honour that knowledge when transcoding.

You can all try this at home, folks!

Record a video clip (with lots of clear a/v sync stuff, like snapping your fingers, etc.) using the videocamera app. Play it on the tablet in MPlayer. Send it to your desktop and play it with various media players, including MPlayer. You will notice that MPlayer keeps pretty good A/V sync, while all the others, if they can play the file at all (most can't, including current versions of VLC and Windows Media Player) can't sync the A/V. And if you upload it to YouTube, the sync comes out awful.

Then, use MEncoder (available for almost all OSes) to transcode it. Try all and any settings that you may find useful. If you figure out how to fix the A/V sync, you will be praised by everyone trying to record video from their tablet, including a bunch of people who would probably love to be able to video-blog from their tablet.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!

Last edited by qole; 2008-05-04 at 08:05.
 
Posts: 178 | Thanked: 40 times | Joined on Aug 2007 @ UK
#54
qole, I have found this site very helpful in the past: VideoHelp.com
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#55
Ok, a promising idea from VideoHelp:

First, use MPlayer to dump the video and audio out to uncompressed files:
Code:
mplayer recorded.avi -vo yuv4mpeg:file=vout.yuv -ao pcm:file=aout.wav
Second, use the encoder of your choice (mencoder in my case) to transcode and mux the files back together. MEncoder notices the missing frames this time, and interprets this as variable fps. The a/v sync is much better in the output file. Not great; just better.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#56
Videocamera plays back its recorded videos better than mplayer. Why don't you ask that guy to see his code.

Or is that cheating?
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#57
Originally Posted by daperl View Post
Videocamera plays back its recorded videos better than mplayer. Why don't you ask that guy to see his code.

Or is that cheating?
Well, it's a Nokia guy messing with the official Nokia camera app. For some reason, they're not very forthcoming with this kind of code. Note that they have no source for download.

It's not really his code, anyway. Videocamera just uses GStreamer pipes to do all the heavy lifting. Maybe I should figure out a way to get GStreamer to transcode the video! I'll look into that.
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#58
Originally Posted by qole View Post
Well, it's a Nokia guy messing with the official Nokia camera app. For some reason, they're not very forthcoming with this kind of code. Note that they have no source for download.

It's not really his code, anyway. Videocamera just uses GStreamer pipes to do all the heavy lifting. Maybe I should figure out a way to get GStreamer to transcode the video! I'll look into that.
I did notice about the source code. Otherwise, I would have sent you a solution. And even though I'm too lazy, why not check the Maemo Python stuff for something worth stealing. Can't you hear it: "Go, qole, Go!"

What I didn't notice was whether or not videocamera has the gstreamer dependencies that your demo above has. Maybe doing an nm on videocamera would reveal something interesting.

But I still say try to contact "videocamera guy;" I'm sure he would love to reveal some of his secrets. Kinda like you!

By the way: I dig this thread.
 
Banned | Posts: 82 | Thanked: 3 times | Joined on Feb 2008 @ Israel
#59
Originally Posted by qole View Post
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.
alright,so where i can find the gstreamer0.10-tools package? i go into red pill mode but i just see some plugins,how i install that thing qole?
 
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#60
Ok, just in case you missed it, tz1 has gotten the built-in cam working with Flash, and zeez pointed to some online interactive games that use the webcam to let you wave your hands to pop bubbles and bounce balls around. Pretty cool stuff!
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
Reply


 
Forum Jump


All times are GMT. The time now is 05:16.