Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # this scripts has some AV sync issues, I leave this to readers to resolve
- SOURCE=$1
- STARTPOSITION=$2
- DURATION=$3
- rm -f /tmp/transcodefifo
- mkfifo /tmp/transcodefifo
- # the mencoder command for encoding to DVD format is taken from:
- # http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html
- mencoder -really-quiet -ss $STARTPOSITION -endpos $DURATION -autosub -sub-fuzziness 1 \
- -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
- -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 \
- -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 25 \
- $SOURCE -o /tmp/transcodefifo &
- PID=$!
- # catch signals and cleanup
- trap "{ kill -9 $PID ; killall -s 9 cat ; rm /tmp/transcodefifo ; }" SIGHUP SIGINT SIGTERM SIGKILL
- cat /tmp/transcodefifo
- kill -9 $PID
- rm /tmp/transcodefifo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement