|
2008-09-12
, 23:45
|
Posts: 882 |
Thanked: 1,310 times |
Joined on Mar 2007
|
#2
|
The Following 4 Users Say Thank You to ukki For This Useful Post: | ||
|
2008-09-13
, 00:05
|
Posts: 30 |
Thanked: 7 times |
Joined on Sep 2007
|
#3
|
|
2008-09-13
, 03:49
|
Posts: 183 |
Thanked: 115 times |
Joined on Nov 2007
@ Seattle, WA
|
#4
|
|
2008-09-13
, 09:26
|
|
Posts: 2,535 |
Thanked: 6,681 times |
Joined on Mar 2008
@ UK
|
#5
|
Sure, that works too. But I prefer this way as it doesn't require me to install anything I don't already have, doesn't require me to run a daemon on my desktop comp at all times that keeps track of what media files I have, and is easier to modify if I want to experiment with it since its just a simple shell script.
Use whatever way you like, having multiple different choices is what linux and the free software community is all about.
|
2008-09-13
, 09:37
|
|
Posts: 2,535 |
Thanked: 6,681 times |
Joined on Mar 2008
@ UK
|
#6
|
Sure, that works too. But I prefer this way as it doesn't require me to install anything I don't already have, doesn't require me to run a daemon on my desktop comp at all times that keeps track of what media files I have, and is easier to modify if I want to experiment with it since its just a simple shell script.
Use whatever way you like, having multiple different choices is what linux and the free software community is all about.
|
2008-09-13
, 13:01
|
Posts: 503 |
Thanked: 267 times |
Joined on Jul 2006
@ Helsinki
|
#7
|
"-vf-add dsize=${MAX_XRES}:${MAX_YRES}:2,scale -vf-add expand=${MAX_XRES}:${MAX_YRES}::::${MAX_XRES}/${MAX_YRES} -vf-add crop=${MAX_XRES}:${MAX_YRES}" is the part I'm talking about. What that does is scaling, and if necessary adding black borders and cropping (croping should never remove more than one line of pixels, its for when there is an odd number of lines), to always get the 400x240 resolution, so hardware pixel doubling on the ITs can always be taken advantage of.
The Following 3 Users Say Thank You to Serge For This Useful Post: | ||
|
2008-09-13
, 13:38
|
Posts: 30 |
Thanked: 7 times |
Joined on Sep 2007
|
#8
|
N8x0 does not have pixel doubling support (this was only used in Nokia 770). Instead of it, N8x0 has support in hardware for a single arbitrary upscaled window using high quality bicubic algorithm, which is used for video overlay.
s/shell/Perl/ and you've got mediaserv.
|
2008-09-13
, 15:01
|
|
Posts: 2,535 |
Thanked: 6,681 times |
Joined on Mar 2008
@ UK
|
#9
|
But the bad threads of perl 5 is not really a disadvantage in my opinion, using fork() and having multiple processes rather than threads is both easier to code/debug, more stable, and better performance wise (on linux at least). Personally I'm hoping that software in general turns away from multithreaded apps and goes for more multiprocess apps instead.
|
2008-09-14
, 20:14
|
Posts: 30 |
Thanked: 7 times |
Joined on Sep 2007
|
#10
|
What you need:
* A desktop computer fast enough to encode a movie for IT viewage faster than the movie is played back. A computer newer than 4-5 years or so should be fine for this for most video files. If the source is a HD movie then you may need a relatively fast computer. My two year old computer is too slow to encode from a HD source on the fly, but just barely.
* The desktop needs to run some kind of unix (linux), and have both mencoder (usually comes with mplayer) and netcat installed. The mencoder build needs to be newer than a year or so, since it uses some relatively new features of mencoder.
* Netcat and mplayer installed on the N8x0 device. The netcat from the extras repo doesn't seem to work very well, use this one instead. It was provided by lbt from #maemo.
Put this in a file somewhere in your PATH on your desktop box. For example I keep mine as /usr/local/maemo_stream.sh. Don't forget to chmod 755 it.
Now on the desktop to stream filename.avi run in a terminal:
You may have to lower video and/or audio bitrate if sending the data over a slow connection. The settings I put should work fine on the average home wifi. Also up the cache in the mplayer command on the IT if you're on a slow connection. You can pause the video, but you can skip forwards or backwards. Mencoder will encode at the speed data is read from the FIFO, not as fast as it can go. This is good because it means that neither the desktop box nor the IT will have to cache a large amount of data in memory. The codec used is one that encodes very fast but still provides good quality.
If you find any other problems with it report below. You may have to kill some other processes manually too if something goes wrong.
This should be everything needed to get it working. However I want to take some time to discuss the mencoder options. As you may see my encoding script is quite a bit shorter than the average encoding script for maemo is. However I think mine provides all the same functionality as the longer ones, thanks to some relatively new filters in mencoder. "-vf-add dsize=${MAX_XRES}:${MAX_YRES}:2,scale -vf-add expand=${MAX_XRES}:${MAX_YRES}::::${MAX_XRES}/${MAX_YRES} -vf-add crop=${MAX_XRES}:${MAX_YRES}" is the part I'm talking about. What that does is scaling, and if necessary adding black borders and cropping (croping should never remove more than one line of pixels, its for when there is an odd number of lines), to always get the 400x240 resolution, so hardware pixel doubling on the ITs can always be taken advantage of. No separate analyzing of the source needed, perfect result every time, any source mencoder can read from should work. Very nice quality, and the code is so much shorter than analyzing and calculating this separately as other scripts does. Encoding script authors should take a look at what this does and see if they can use it to cut down the size of their own scripts considerably.
If you find any bugs or have any questions, or just want to add something else, please post below. Once I'm certain all the bugs are worked out I will be posting this on the wiki.
Last edited by TPC; 2008-09-14 at 20:10.