[MPlayer-users] Encoding video for Droid with subtitles
Krzysztof Duchnowski
amidk75 at gmail.com
Fri Feb 5 23:24:17 CET 2010
Kevin DeKorte pisze:
> I think I figured out the problem. The audio is playing at the right
> speed, the video is just a slide show, and so the subtitles don't show
> up on time. So can you recommend anyway to improve the file?
My script, but audio is corrupted at random durring playback (HTC Magic):
#!/bin/bash
BITRATE="600"
FPS="24000/1001"
FILE="movie.mkv"
[ -e /tmp/video.mp4 ] || mkfifo /tmp/video.y4m
[ -e /tmp/video.mp4 ] || mplayer -fps $(echo "$FPS $FILE")\
-sws 10\
-vf-add hqdn3d,scale=480:-10,harddup\
-correct-pts -endpos 60 -benchmark\
-ass\
-ass-force-style
PlayResX=480,PlayResY=320,MarginV=25,MarginRight=50,MarginLeft=50\
-ass-font-scale 2 -subpos 50\
-sub subtitle.srt\
-vo yuv4mpeg:file=/tmp/video.y4m\
-ao pcm:fast:waveheader:file=/tmp/audio-raw.wav\
1&>/dev/null &
[ -e /tmp/video.mp4 ] || time x264 --profile baseline --tune fastdecode
--keyint 60 --min-keyint 15 --bitrate $(echo $BITRATE)\
--level 3.1 --sar 1:1 --threads 3 --pass 1\
--vbv-maxrate $(echo $[BITRATE*2]) --vbv-bufsize $(echo $BITRATE)\
-o /tmp/video.mp4 /tmp/video.y4m
[ -e /tmp/video.y4m ] && rm /tmp/video.y4m
[ -e /tmp/audio.wav ] || time sox -S --temp /tmp /tmp/audio-raw.wav -c 2
/tmp/audio.wav gain -n -3 gain -h dither -s
[ -e /tmp/audio-raw.wav ] && rm -f /tmp/audio-raw.wav
[ -e /tmp/audio.wav ] && time faac -b 96 -o /tmp/audio.aac /tmp/audio.wav
rm -f /tmp/audio.wav
[ -e /tmp/video.mp4 ] && MP4Box -new film.mp4 -isma -nodrop -add
/tmp/video.mp4 -add /tmp/audio.aac
[ -e /tmp/audio.aac ] && rm -f /tmp/audio.aac
rm -f /tmp/video.mp4
PS: I have TMPFS at "/tmp" so it read/save files in memory (faster)
--
Krzysztof 'DK75' Duchnowski
GetFirefox - http://www.mozilla.com/firefox/
Konfiguracja UTF-8 dla czytników - http://evil.pl/pip/utf/
More information about the MPlayer-users
mailing list