Reply
Thread Tools
Posts: 16 | Thanked: 0 times | Joined on Oct 2006
#1
Ok. I'm working on getting the most out of video playback on the N800. Been looking at existing solutions for N770 (VideoEncoding), so thanks to all who worked on that, got a lot of info there. Just wanted to share where I'm at the moment and maybe get some tips on how to improve it.

My view on the N800 for video playback is that recode to optimal video format will always be best. The goal for me is to get an automatic service on my server to recode tv shows I tape through a video tuner, and put them on a UPnP server that is reachable by N800.

For now I'm looking at using the internal player in N800, I have tried mplayer, but for now the internal seems better. It scales/smoothes the playback better, and there is much less shearing. This may change later. But for now the internal works.

My first observation was that the demo video (NokiaN93.avi) included in N800 was not working optimal. It does choke at certain points. After looking at it on my PC, I noticed that the video bitstream peaks at these points up to and over 900kbit/s. Seem to have read somewhere that around 800kbit/s peak and 420kbit/s avarage is optimal.

After that I looked at several of the sample converters. But since the N800 is more powerful than N770 I am now always looking to convert to 1/2 of the native resolution of N800. Meaning either 400 in width or 240 in height depending on source material. And the internal player in N800 always wants sizes devided by 16.

I've been working on several sample videos, but to give an sample of where I am at I took the Apple QuickTime trailer of Open Season in 480p (43MB / actual: 848x448 / 23.976(24000/1001) fps). And recoded it with mencoder as optimal as I know now.

The command line(s) I ended up with was this (2-pass):
  • mencoder.exe open_season-rev_h480p.mov -o Trailer_OpenSeason_N800.avi -srate 44100 -oac lavc -lavcopts acodec=mp3:abitrate=128 -ovc lavc -lavcopts vcodec=mpeg4:v4mv:mbd=2:trell:vrc_buf_size=350:vrc _maxrate=750:vbitrate=420:vpass=1:turbo -ofps 24000/1001 -ffourcc DIVX -noidx -force-avi-aspect 400/224 -quiet -vf scale=400:224
  • mencoder.exe open_season-rev_h480p.mov -o Trailer_OpenSeason_N800.avi -srate 44100 -oac lavc -lavcopts acodec=mp3:abitrate=128 -ovc lavc -lavcopts vcodec=mpeg4:v4mv:mbd=2:trell:vrc_buf_size=350:vrc _maxrate=750:vbitrate=420:vpass=2 -ofps 24000/1001 -ffourcc DIVX -noidx -force-avi-aspect 400/224 -quiet -vf scale=400:224
From that I ended up with the following 9MB 420kbit/s (128kbit MP3 Stereo) file:
  • Download Trailer_OpenSeason_N800.zip (removed for now)
(note: I'll leave this file up for one day, then remove it, don't want my hosting to choke )

And for me, this result is absolutely workable. I have tried other TV material. And it seems to work without problems at these settings. Although, haven't tried 30fps yet. Will test that later. The important point seems to be to limit the peak video bitrates. I can't remember seeing this in existing solutions. And I had problems without it.

So for now I'm setting the parameters like this:
  • vrc_buf_size=350
  • vrc_maxrate=750
  • vbitrate=420
Here is where I need some help. I've tried to find out what the vrc_buf_size is for. It is required if you use vrc_maxrate. But what does it really tell/do ? Is it some optimal encoding in file that matches the buffer of some playback device ? Or is it only a buffer used by the encoder when doing its work ? Would really like to know. And also, any feedback on other rates that work better would be good.

So feedback on:
  • What is vrc_buf_size for ?
  • What is the perfect combination of vrc_buf_size / vrc_maxrate / vbitrate for N800 ?
PS: I am looking to make a command line exe utility that converts my material. Does the scale / size / fps and all that. But will not give any date. If/when, I'll release it here.

EDIT: Changed direct download of .avi sample to ZIP'ed file with .avi. Got some problems when testing it on my N800 after download. The ZIP should ensure correct file (CRC).

Last edited by sveinan; 2007-02-02 at 16:40.
 
aflegg's Avatar
Posts: 1,463 | Thanked: 81 times | Joined on Oct 2005 @ UK
#2
Interesting research.

I'd be happy to apply such a patch to 770-encode, it seems pointless to re-invent the wheel when we already have a tool which handles scale, size, fps, aspect ratio etc.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Now known as
Jaffa
 
Posts: 16 | Thanked: 0 times | Joined on Oct 2006
#3
@aflegg

Please do. Your 770-encode.pl script kick-started me with info on paremeters. Probably ripped most info from there

Agree on not doing the work twice. But I do have one extra requirement I'm not sure is possible through Perl scripting. I need the mencoder.exe process starting going down one step down in priority (CPU). Or else it is too agressive on the CPU, I've got a lot of processes going on my home server (Windows XP). And I do now how to do this with Win32 programming.
 
aflegg's Avatar
Posts: 1,463 | Thanked: 81 times | Joined on Oct 2005 @ UK
#4
Looks like its doable:

http://techtasks.com/code/viewbookcode/567

Do you know Perl? If so, section looking at $^O (like it already does in one place) to reduce the priority would be welcome too ;-)
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Now known as
Jaffa
 
Posts: 23 | Thanked: 1 time | Joined on Jan 2007 @ Austin, TX
#5
WOW, that turned out very nice. Now if I could get streaming video (live tv from Orb) to look close to that, the N800 would be perfect for me.
 
Posts: 16 | Thanked: 0 times | Joined on Oct 2006
#6
@aflegg

Good find. I'll take a look at it and see if I can get it to work. Don't use Perl often, but as any programmer, you get into it and make it work. Will post any result, and we'll see if we can make a Nx00-encode.pl.
 
aflegg's Avatar
Posts: 1,463 | Thanked: 81 times | Joined on Oct 2005 @ UK
#7
Excellent. Let me know if you have any questions :-)
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Now known as
Jaffa
 
Posts: 16 | Thanked: 0 times | Joined on Oct 2006
#8
Typical. Got too much work. Don't know if I'll get the time to implement all. Well, at least I testet out a new preset for the 770-encode.pl script that matches best what I found out. Please include it if you want aflegg. It's not much, but it includes the few vrc changes.

Only 2 places I changed. Here is the first (addition in bold/underline text):

Code:
%PRESET = (
    smallest => { abitrate => 32, vbitrate => 80, width => 240 },
    small    => { abitrate => 96, vbitrate => 96, width => 240 },
    average  => { abitrate => 96, vbitrate => 200, width => 320 },
    good     => { abitrate => 128, vbitrate => 240, width => 320 },
    best     => { abitrate => 128, vbitrate => 400, width => 352, fps => 25 },
    n800best => { abitrate => 128, vbitrate => 420, width => 400, height => 240, fps => 25, vrcbufsize => 350, vrcmaxrate => 750 },
    mplayer  => { abitrate => 128, vbitrate => 420, width => 400, height => 240, fps => 30 },
);
Second (addition in bold/underline text):

Code:
push @params, '-ovc', 'lavc',
              '-lavcopts', 'vcodec=mpeg4:vbitrate='.$preset->{vbitrate};
$params[-1] .= ':vrc_buf_size='.$preset->{vrcbufsize} if defined($preset->{vrcbufsize});
$params[-1] .= ':vrc_maxrate='.$preset->{vrcmaxrate} if defined($preset->{vrcmaxrate});
$params[-1] .= ':tcplx_mask=0.1:scplx_mask=0.1:mbd=1' if defined($options{"experimental"});
You do what you want with it. Not much. But it seems to work ok on my N800 at least.
 
aflegg's Avatar
Posts: 1,463 | Thanked: 81 times | Joined on Oct 2005 @ UK
#9
Can someone try these settings on a 770? With my understanding of what they do, it shouldn't cause any problems, so introducing them as standard for all presets could make the most sense.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Now known as
Jaffa
 
Posts: 150 | Thanked: 3 times | Joined on Jan 2007
#10
@sveinan:

I think it's very interesting that you "only" use the internal media player of the N800 and still got good movie performance. I checked out the mplayer thread for some times and I realize that the internal media player only uses the DSP of the cpu to the decode the movie! There is a whole ARM11 core with FPU @330mh wich is not used when you play the movie with the builtin player. Unfortunetly, mplayer is not yet optimized for the n800 hardware...so there should be a GREAT performance boost in the future...
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 18:19.