mirror of
git://projects.qi-hardware.com/openwrt-packages.git
synced 2024-11-22 08:44:59 +02:00
mplayer: Make alsa work (use larger buffer), and use it instead of OSS This
reduces CPU load during playback, and also makes the audio mixer react much more quickly (note: if mplayer automatic resampling kicks in now, we should add -af-adv force=2 to make it use the fastest resampling filter)
This commit is contained in:
parent
b4bc2ad5f0
commit
030251fdf6
@ -10,7 +10,7 @@ PKG_NAME:=MPlayer
|
||||
PKG_REV:=33333
|
||||
FFMPEG_REV:=d84f191d37b8123203dff250531a4b4c0d5f587a
|
||||
PKG_VERSION:=r$(PKG_REV)
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
FFMPEG_SOURCE_URL:=git://git.videolan.org/ffmpeg.git
|
||||
@ -79,6 +79,8 @@ CONFIGURE_ARGS := --target=mips \
|
||||
--disable-vdpau \
|
||||
--disable-gl \
|
||||
--disable-xf86keysym \
|
||||
--disable-ossaudio \
|
||||
--enable-alsa \
|
||||
--enable-vidix \
|
||||
--disable-vidix-pcidb \
|
||||
--with-vidix-drivers="no" \
|
||||
|
@ -1,11 +1,41 @@
|
||||
this is outdated; mpeg1 support currently disabled (patents?).
|
||||
1. prepare your video files for Ben:
|
||||
|
||||
Use ffmpeg2theora or ffmpeg with vp8, vorbis, mkv
|
||||
Use ffmpeg2theora or ffmpeg with vp8, vorbis, mkv.
|
||||
|
||||
1. prepare your avi files for Ben:
|
||||
When using theora, try to use a video width and height that are a multiple of
|
||||
16. Currently theora decoding displays strange borders, if size is not a
|
||||
multiple of 16.
|
||||
|
||||
for i in $(echo "*.avi"); do /usr/bin/mencoder -o "$i.mpg" -vf scale=320:-2 -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video:vpass=1:vbitrate=200 -ofps 24000/1001 -oac lavc -lavcopts acodec=mp2:abitrate=64 "$i" && /usr/bin/mencoder -o "$i.mpg" -vf scale=320:-2 -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video:vpass=2:vbitrate=200 -ofps 24000/1001 -oac lavc -lavcopts acodec=mp2:abitrate=64 "$i"; done
|
||||
Try to use an audio sampling rate of 44100 for the vorbis audio. If the
|
||||
automatic resampling of the alsa OSS emulation is triggered, quality degrades
|
||||
a lot. Alternatively use 'mplayer -af resample=44100:1:1' on playback.
|
||||
|
||||
For encoding try to use libtheora 1.2 ("ptalarbvorm") which improves visual
|
||||
qality a lot compared to previous versions. Always encode with
|
||||
constant-quality *not* giving a bitrate target.
|
||||
|
||||
Here's an example encoding command:
|
||||
|
||||
ffmpeg2theora -o output.ogv input.avi \
|
||||
-v8 -x320 -y176 \
|
||||
-a0 --channels 2 --samplerate 44100
|
||||
|
||||
Yielding a pretty high visual quality (-v8 i.e. "80%"). Use -v6 for
|
||||
approximately half the bitrate with moderate quality.
|
||||
|
||||
2. play your files with Ben:
|
||||
|
||||
mplayer -vo sdl -ac mad file.mpg
|
||||
mplayer output.ogv
|
||||
|
||||
(Assumptions:
|
||||
|
||||
the following options should be set in your ~/.mplayer/config:
|
||||
|
||||
volume=10
|
||||
vo=cvidix
|
||||
screenw=320
|
||||
screenh=240
|
||||
fs=1
|
||||
ac=tremor
|
||||
quiet=1
|
||||
)
|
||||
|
15
mplayer/patches/020-alsa-buffer.patch
Normal file
15
mplayer/patches/020-alsa-buffer.patch
Normal file
@ -0,0 +1,15 @@
|
||||
Index: MPlayer-r33304/libao2/ao_alsa.c
|
||||
===================================================================
|
||||
--- MPlayer-r33304.orig/libao2/ao_alsa.c 2011-04-27 08:12:35.000000000 +0200
|
||||
+++ MPlayer-r33304/libao2/ao_alsa.c 2011-04-27 08:12:55.000000000 +0200
|
||||
@@ -313,8 +313,8 @@
|
||||
*/
|
||||
static int init(int rate_hz, int channels, int format, int flags)
|
||||
{
|
||||
- unsigned int alsa_buffer_time = 500000; /* 0.5 s */
|
||||
- unsigned int alsa_fragcount = 16;
|
||||
+ unsigned int alsa_buffer_time = 1000000; /* 0.5 s */
|
||||
+ unsigned int alsa_fragcount = 4;
|
||||
int err;
|
||||
int block;
|
||||
strarg_t device;
|
Loading…
Reference in New Issue
Block a user