Advertisement
Guest User

minidlna-transcode hardcode subtitles

a guest
Sep 21st, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.90 KB | None | 0 0
  1. #!/bin/sh
  2. # this scripts has some AV sync issues, I leave this to readers to resolve
  3.  
  4. SOURCE=$1
  5. STARTPOSITION=$2
  6. DURATION=$3
  7.  
  8. rm -f /tmp/transcodefifo
  9. mkfifo /tmp/transcodefifo
  10. # the mencoder command for encoding to DVD format is taken from:
  11. # http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html
  12. mencoder -really-quiet -ss $STARTPOSITION -endpos $DURATION -autosub -sub-fuzziness 1 \
  13.   -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
  14.   -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 \
  15.   -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 \
  16.   $SOURCE -o /tmp/transcodefifo &
  17. PID=$!
  18.  
  19. # catch signals and cleanup
  20. trap "{ kill -9 $PID ; killall -s 9 cat ; rm /tmp/transcodefifo ; }" SIGHUP SIGINT SIGTERM SIGKILL
  21.  
  22. cat /tmp/transcodefifo
  23. kill -9 $PID
  24. rm /tmp/transcodefifo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement