Wednesday, March 12, 2008

Watching system log

sudo tail -f /var/log/syslog

Monday, March 10, 2008

desktop .mplayer/config

# Write your default config options here!
channels=6
monitoraspect=16:9
stop-xscreensaver=yes
ontop=yes
alang=en
ao=pulse
zoom=yes

mediacenter .mplayer/config

# Write your default config options here!
channels=6
monitoraspect=16:9
stop-xscreensaver=yes
ontop=yes
fs=yes
alang=en
ao=alsa:device=plug=test
mixer-channel="SoftVol"
#ao="oss:/dev/dsp"
# channels 6 (# of channels) : 3 (# of paths) : 4 (audio chann) : 2 (speaker)
# 0-left front, 1- right front, 2- center
#
#sound channels
#0 - Front Left
#4 - Center
#1 - Front Right
#3 - Rear Right
#2 - Rear Left
#5 - LFE
#
#af="channels=6:3:0:0:1:1:4:2","channels=2"
zoom=yes
vf=scale=1920:1080

mediacenter .asoundrc

pcm.dmix51 {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0666
slave {
pcm "hw:0,0"
channels 6
period_time 0
period_size 1024
buffer_size 8192
rate 48000
}
}

ctl.dmix51 {
type hw
card 0
}

pcm.stereo {
type plug
slave.pcm "dmix51"
ttable.0.0 1
ttable.1.1 1
}

pcm.!default {
type route
slave.pcm "dmix51"
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.4.2 1
ttable.3.1 1
ttable.2.0 1
ttable.5.5 1
}

pcm.duplicate {
type plug
slave.pcm "dmix51"
slave.channels 6
route_policy duplicate
}

pcm.test {
type softvol
slave {
pcm surround71
}
control {
name "SoftVol"
card 0
}
}

#upmixing:
pcm.ch51dup {
type route
slave.pcm test
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
}

Desktop .asoundrc

#pcm.ch51 {
# type plug
# slave.pcm "surround51"
# slave.channels 6
#}

pcm.dmix51 {
type dmix
ipc_key 1024
slave {
pcm "hw:0,0"
channels 6
period_time 0
period_size 1024
buffer_size 8192
rate 48000
}
}

ctl.dmix51 {
type hw
card 0
}

#pcm.!default {
# type dmix
# ipc_key 1024
# slave {
# pcm "hw:0,0"
# channels 6
# period_time 0
# period_size 1024
# buffer_size 8192
# rate 48000
# }
#}

pcm.!default {
type plug
slave.pcm "dmix51"
}

pcm.dsp0 {
type plug
slave.pcm "dmix51"
}

#upmixing:
pcm.ch51dup {
type route
slave.pcm "dmix51"
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
}

Encoding dvd movies with mencoder and x264, fixing sync issues

Keep having issues with audio sync (A-V sync) on movies where I change the fps to 240000/1001. So far this process seems to work:

mkfifo audiodump.pcm

mencoder dvd://1 -oac copy -ovc copy -ofps 24000/1001 -vf pullup,softskip,harddup -aid 128 -channels 6 -o movie.vob

faac -q 100 -I 1,6 -P -R 48000 -C 6 -X audiodump.pcm -o audio.mp4 & mplayer movie.vob -vc dummy -vo null -ao pcm:nowaveheader:fast -channels 6

mencoder movie.vob -o /dev/null -ofps 24000/1001 -vf crop=720:352:0:62,harddup -ovc x264 -x264encopts bitrate=1800:frameref=6:analyse=all:me=umh:subme=7:trellis=2:bframes=1:subq=7:brdo:mixed_refs:weight_b:bime:no_fast_pskip:direct_pred=auto:mixed_refs:nr=200:threads=auto:turbo=2:pass=1 -oac copy -of rawvideo

mencoder movie.vob -o movie.264 -ofps 24000/1001 -vf crop=720:352:0:62,harddup -ovc x264 -x264encopts bitrate=1800:frameref=6:analyse=all:me=umh:subme=7:trellis=2:bframes=1:subq=7:brdo:mixed_refs:weight_b:bime:no_fast_pskip:direct_pred=auto:mixed_refs:nr=200:threads=auto:pass=2 -oac copy -of rawvideo

MP4Box -add audio.mp4 -add movie.264 -fps 23.976 movie.mp4

sleep 5
rm audiodump.pcm
rm audio.mp4