maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   MPlayer which version is suitable (https://talk.maemo.org/showthread.php?t=2405)

rapthor 2006-07-06 15:30

MPlayer which version is suitable
 
Hi,

can anyone tell me if I can install mplayer on my N770? Do I need a special version? I'm going to see videos streamed through a socket connection. Will that be possible with mplayer installed on a N770?

Thanks.

konttori 2006-07-06 20:51

There was some work on porting mplayer to 770, but I'm not sure what is the state of the port now. Should be easier now that we have eabi and softfloat.

I think it's indeed possible to get mplayer with limited codecs working on 770, but oto, just compiling more codecs would be just as good.

Serge 2006-07-06 23:22

Compiling mplayer for 770 is not difficult. Just tested MPlayer1.0pre8 (the only tweaks are a minor change in the source to workaround internal compiler error and explicit addition of -march=armv5te optimization option). The problem is that it works too slow to be usable:
Code:

AVI file format detected.
VIDEO:  [DIVX]  320x176  24bpp  29.970 fps  323.2 kbps (39.4 kbyte/s)
Clip info:
 Software: MEncoder 1.0pre8-3.4.6
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
It seems there is no Xvideo support for your video card available.
Run 'xvinfo' to verify its Xv support and read DOCS/HTML/en/video.html#xv!
See 'mplayer -vo help' for other (non-xv) video out drivers. Try -vo x11
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
[AO ESD] latency: [server: 0.28s, net: 0.00s] (adjust 0.28s)
AO: [esd] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 320 x 176 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.82:1 - prescaling to correct movie aspect.
VO: [x11] 320x176 => 320x176 Planar YV12
No accelerated colorspace conversion found
SwScaler: using unscaled Planar YV12 -> BGR 16-bit special converter
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
A:  2.9 V:  2.1 A-V:  0.723 ct:  0.001  65/ 65 78%  8% 246.9% 50 0

          ************************************************
          **** Your system is too SLOW to play this!  ****
          ************************************************

Possible reasons, problems, workarounds:
- Most common: broken/buggy _audio_ driver
  - Try -ao sdl or use the OSS emulation of ALSA.
  - Experiment with different values for -autosync, 30 is a good start.
- Slow video output
  - Try a different -vo driver (-vo help for a list) or try -framedrop!
- Slow CPU
  - Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts,
    e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all.
- Broken file
  - Try various combinations of -nobps -ni -forceidx -mc 0.
- Slow media (NFS/SMB mounts, DVD, VCD etc)
  - Try -cache 8192.
- Are you using -cache to play a non-interleaved AVI file?
  - Try -nocache.
Read DOCS/HTML/en/video.html for tuning/speedup tips.
If none of this helps you, read DOCS/HTML/en/bugreports.html.

I found a link that seems to contain information that hardware should support colorspace conversion: http://people.freedesktop.org/~ajax/xdc2006-notes.txt
Code:

What can be done with the hardware?
- Hardware RANDR support
- 2x upscaling - for video and games - cuts screen update memory by 4x!
- YUV->RGB colorspace conversion

And 2x scaling should be also very handy, but what is required to make this all work?

hallgreng 2006-07-07 00:43

I see that you are using X11 for video output.
You may want to try using SDL in stead, it should work much better as the X11 driver tends to be cpu-intensive.

Also, could you post your binary somewhere?

Serge 2006-07-09 13:41

Here is a binary: http://ufo2000.xcomufo.com/files/mpl...9-armel.tar.gz

Also here is some interesting link: http://maemo.org/pipermail/maemo-dev...ay/003957.html

Probably mplayer can be improved by using DSP for audio decoding, enabling pixels doubling for faster video playback and finding a way for enabling hardware accelerated colorspace conversion. But I don't have any time to work on this in the forseeable future. So compiling mplayer is pretty much simple, a harder task is to optimize it and tune for Nokia 770 so that it can become useful :)

Serge 2006-07-09 16:40

Just experimented with mplayer a bit more. Looks like it is really mp3 decoding built in mplayer that is very slow (probably because of floating point use as pointed by Frantisek). I tried to encode video with vorbis audio stream (mplayer has fixed point vorbis decoder) and it works a lot better, actually it is even almost watchable :)

Here is a script I used for encoding video in this test:
Code:

#!/bin/bash

XRES=320
YRES=240
BITRATE=200

mplayer "$1" -ao pcm:fast:file=tmp.wav -vc null -vo null
oggenc -q1 tmp.wav
mencoder "$1" -nosound -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=$BITRATE -vf scale=$XRES:$YRES -sws 1 -ffourcc DIVX -o tmp.avi
mkvmerge -o "$2" tmp.avi tmp.ogg

Usage: ./encode.sh input_file.avi output_file.mkv

Also tested streaming video from http url, it works fine but seeking is not supported. Mplayer also has its own streaming server, probably it should support seeking and work better, but I did not test it.

So I see a good potential for mplayer :)

edit:
Looks like mplayer can be compiled with libmad which is a fixed point mp3 decoder implementation. So even 'normal' AVI files created by following instructions from https://maemo.org/maemowiki/VideoEncoding could be probably played with mplayer :)

And some more interesting links:
http://n770galaxy.blogspot.com/2006/...-progress.html
http://maemo.org/pipermail/maemo-dev...ry/002457.html
http://maemo.org/pipermail/maemo-dev...ne/004244.html
http://maemo.org/pipermail/maemo-dev...ay/004024.html
http://maemo.org/pipermail/maemo-dev...ry/002859.html

rapthor 2006-07-10 10:12

Quote:

Originally Posted by Serge

I extracted the file to my N770 device but I don't get it started. The device says "Unknown Filetype".

What do I have to do to start mplayer?

Thanks

Serge 2006-07-10 10:26

Quote:

Originally Posted by rapthor
I extracted the file to my N770 device but I don't get it started. The device says "Unknown Filetype".

What do I have to do to start mplayer?

It is not a gui application and also it can't be started from file manager. In order to try it, you can start xterm, enter the directory where you have mplayer extracted and start it with a command line like this:
./mplayer -vo sdl -ao sdl [filename or url]

Adding '-fs' option will start video playback scaled to fullscreen, but it will work even slower.

All in all it is just a test of video decoding capabilities of a single ARM core (with certain optimizations and device features still not used) and not quite enduser ready.

Serge 2006-07-12 00:54

Updated mplayer binary: http://ufo2000.xcomufo.com/files/mpl...2-armel.tar.gz

Changes:
* compiled with libmad (fast decoding of mp3 audio)
* tweaked keybindings, now it is completely usable on Nokia 770 - fullscreen key works, sound volume can be changed, enter key works as pause/resume, so all the keys work more or less the same as in default video player

Installation:
1. Copy this file to device (for example into Documents folder)
2. Start X Terminal
3. Find this file on the device (run 'cd MyDocs/.documents' for Documents folder)
4. Unpack archive: 'tar -xzf mplayer-1.0pre8-20060712-armel.tar.gz'
5. Enter 'MPlayer-1.0pre8' directory: 'cd MPlayer-1.0pre8'
6. Try to play discovery video: './mplayer /home/user/MyDocs/.videos/Discovery.avi'
7. Have fun

Note: if you tried a previous build, also delete old configuration file: 'rm /home/user/.mplayer/config', a new build has a different default configuration file (sdl for video output, esd for audio, framedrop option enabled, enabled libmad library, configured aspect ratio).

A patch with tweaks for mplayer 1.0pre8 is here: http://ufo2000.xcomufo.com/files/mpl...-20060712.diff
Configured with the following options:
./configure --disable-mencoder --disable-alsa --enable-mad --disable-xv --disable-mp3lib --disable-x11 --target=arm-linux

That's all, I'm done now and not going to do anything else :)

Possible future improvement can be some kind of files selection gui that can start mplayer for playing video. And of course performance optimizations for mplayer itself.

aflegg 2006-07-12 08:32

Very cool. Uses about 80% CPU to decode a DVD encoded with the "good" setting.

The only real annoyance is that the screen blanking isn't disabled, but presumably a wrapper script or other form of GUI launcher could fix that by topping and tailing the mplayer invocation.


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

vBulletin® Version 3.8.8