ZitatOriginally posted by wilderigel
This part will only extract subtitles, if they was recorded. reinserting in DVD is an other Part.
I hope this will integratet by someone in vdr-burn-0.1.0 soon.
Check out this patch. It added subs to the the burn-plugin 0.0.009 plugin
Diff
--- vdrburn.sh.orig 2005-11-13 20:49:58.000000000 +0200
+++ vdrburn.sh 2006-01-15 17:56:40.000000000 +0200
@@ -1,7 +1,10 @@
#!/bin/bash
+# VDR's configuration directory
+VDRCONFDIR=/etc/vdr
+
# read user customization if any, otherwise use default values
-BURNSETUPCONF=/etc/vdr/plugins/burn/vdrburnscript.conf
+BURNSETUPCONF=$VDRCONFDIR/plugins/burn/vdrburnscript.conf
if [ "!" -f "$BURNSETUPCONF" ]; then
echo ""
echo "You could customize '$0'"
@@ -24,6 +27,27 @@
# Use cut function of vdrsync (yes|no)
USE_CUT="${USE_CUT:-yes}"
+# Use ProjectX instead of vdrsync
+USE_PROJECTX="${USE_PROJECTX:-no}"
+if [ "$USE_PROJECTX" = "yes" ]; then
+ if [ -z "$JAVA" ]; then
+ if which java-config >/dev/null 2>&1 ; then
+ JAVA=$(java-config -J)
+ elif [ -n "$JAVA_HOME" && -x "$JAVA_HOME/bin/java" ] ; then
+ JAVA="$JAVA_HOME/bin/java"
+ else
+ JAVA=java
+ fi
+ fi
+ if [ -z "$PROJECTX_CLASSPATH" ]; then
+ if which java-config >/dev/null 2>&1 ; then
+ PROJECTX_CLASSPATH=$(java-config -p ProjectX,jakarta-oro-2.0,commons-net)
+ else
+ PROJECTX_CLASSPATH=/usr/share/java/ProjectX.jar:/usr/share/java/oro.jar:/usr/share/java/commons-net.jar
+ fi
+ fi
+fi
+
# Use "tcrequant" or plain "requant" command (yes|no)
USE_TCREQUANT="${USE_TCREQUANT:-yes}"
@@ -62,7 +86,7 @@
if IsExecutable requant; then
USE_TCREQUANT=no
else
- if [ "$USE_TCREQUANT" == "yes" ]; then
+ if [ "$USE_TCREQUANT" = "yes" ]; then
logger "Unable to find valid requant program."
exit 1
fi
@@ -71,7 +95,7 @@
}
DetectRequanter() {
- if [ "$USE_TCREQUANT" == "yes" ]; then
+ if [ "$USE_TCREQUANT" = "yes" ]; then
DetectTcrequant
else
DetectRequant
@@ -101,7 +125,7 @@
USE_TCMPLEX=no
else
# check if we already are the fallback
- if [ "$USE_TCMPLEX" == "yes" ]; then
+ if [ "$USE_TCMPLEX" = "yes" ]; then
logger "Unable to find valid mplex program."
exit 1
fi
@@ -110,7 +134,7 @@
}
DetectMplexer() {
- if [ "$USE_TCMPLEX" == "yes" ]; then
+ if [ "$USE_TCMPLEX" = "yes" ]; then
DetectTcmplex
else
DetectMplex
@@ -153,15 +177,94 @@
# Sync Syntax: TempDir Number FileName
case "${1}" in
SYNC)
- if [ "$USE_CUT" == "yes" ]; then
- CUTCMD="-cut"
+ if [ "$USE_PROJECTX" = "yes" ]; then
+ OUT="$2/VDRSYNC.$3"
+ mkdir -p "$OUT"
+ if [ -d "$4" ]; then
+ INPUT="$4/[0-9]*.vdr"
+ else
+ INPUT=$4
+ fi
+ if [ "$USE_CUT" = "yes" ] && [ -e "$4/marks.vdr" ] && CheckCmd marks2bytepos.pl; then
+ # ProjectX cutmarks generation
+ echo "CollectionPanel.CutMode=0" > "$OUT/cutmarks"
+ # marks2bytepos.pl: http://www.vdrportal.de/board/attachment.php?attachmentid=8392&sid=
+ marks2bytepos.pl "$4" >> "$OUT/cutmarks"
+ CUTCMD="-cut $OUT/cutmarks"
+ fi
+ # ProjectX settings are based on the work of Mikko Tuumanen <http://users.utu.fi/mijutu/digitv/vdr/index.html>
+ echo Application.ActiveDirectory="$4" > "$OUT/X.ini"
+ echo Application.OutputDirectory="$OUT" >> "$OUT/X.ini"
+ echo Application.OutputDirectories.0="$OUT" >> "$OUT/X.ini"
+ echo Application.SaveSettingsOnExit=0 >> "$OUT/X.ini"
+ echo CollectionPanel.CutMode=0 >> "$OUT/X.ini"
+ # Uncomment either DVB (.SON) or teletext (.SRT) subtitles
+ echo SubtitlePanel.SubtitleExportFormat=SON >> "$OUT/X.ini"
+ #echo SubtitlePanel.SubtitleExportFormat=SRT >> "$OUT/X.ini"
+ echo SubtitlePanel.SubpictureColorModel=YLE >> "$OUT/X.ini"
+ echo SubtitlePanel.TtxPage1=777 >> "$OUT/X.ini"
+ echo SubtitlePanel.TtxPage2=150 >> "$OUT/X.ini"
+ echo SubtitlePanel.TtxPage3=149 >> "$OUT/X.ini"
+ if [ -e "$4/info.vdr" ] && [ -e "$VDRCONFDIR/plugins/ttxtsubs/channelsettings.dat" ]; then
+ CHANNEL=`grep '^C' "$4/info.vdr" | sed 's/.*-\([^-]*\)/\1/'`
+ SUBPAGE=`grep $CHANNEL "$VDRCONFDIR/plugins/ttxtsubs/channelsettings.dat" | sed 's/.*,\(.*\)/\1/'`
+ echo SubtitlePanel.TtxPage4=$SUBPAGE >> "$OUT/X.ini"
+ fi
+ ExecCmd $JAVA -Djava.awt.headless=true -cp $PROJECTX_CLASSPATH net.sourceforge.dvb.projectx.common.Start $CUTCMD -ini "$OUT/X.ini" $INPUT
+ SON=$(find "$OUT" -name \*.son)
+ SRT=$(find "$OUT" -name \*.srt)
+ if [ "!" "x$SON" = "x" ]; then
+ # spumux.xml generation is based on son2spumux.sh: http://brigitte.dna.fi/~apm/
+ echo "<subpictures>" > "$OUT/spumux.xml"
+ echo " <stream>" >> "$OUT/spumux.xml"
+ cat "$SON" | tail -n +11 | while read l1
+ do
+ read l2 || exit 1
+ x=`echo $l1 | cut -f2 -d\( | awk '{printf("%d", $1);}'`
+ y=`echo $l1 | cut -f2 -d\( | awk '{printf("%d", $2);}'`
+ t1=`echo $l2 | awk '{t1=substr($2,1,8); t2=substr($2,10,2); printf("%s.%s", t1, t2);}'`
+ t2=`echo $l2 | awk '{t1=substr($3,1,8); t2=substr($3,10,2); printf("%s.%s", t1, t2);}'`
+ i=`echo $l2 | awk '{printf("%s", $NF);}'`
+ echo " <spu start=\"$t1\"" >> "$OUT/spumux.xml"
+ echo " end=\"$t2\"" >> "$OUT/spumux.xml"
+ echo " image=\"$OUT/$i\"" >> "$OUT/spumux.xml"
+ echo " xoffset=\"$x\" yoffset=\"$y\"" >> "$OUT/spumux.xml"
+ echo " transparent=\"000060\" />" >> "$OUT/spumux.xml"
+ done
+ echo " </stream>" >> "$OUT/spumux.xml"
+ echo "</subpictures>" >> "$OUT/spumux.xml"
+ # spumux.xml done
+ elif [ "!" "x$SRT" = "x" ]; then
+ # spumux.xml generation by Wilderigel@VDRPortal
+ echo "<subpictures>" > "$OUT/spumux.xml"
+ echo " <stream>" >> "$OUT/spumux.xml"
+ echo " <textsub filename=\"$SRT\" characterset=\"ISO8859-1\"" >> "$OUT/spumux.xml"
+ echo " fontsize=\"28.0\" font=\"arial.ttf\" horizontal-alignment=\"center\"" >> "$OUT/spumux.xml"
+ echo " vertical-alignment=\"bottom\" left-margin=\"60\" right-margin=\"60\"" >> "$OUT/spumux.xml"
+ echo " top-margin=\"20\" bottom-margin=\"30\" subtitle-fps=\"25\"" >> "$OUT/spumux.xml"
+ echo " movie-fps=\"25\" movie-width=\"720\" movie-height=\"574\"" >> "$OUT/spumux.xml"
+ echo " />" >> "$OUT/spumux.xml"
+ echo " </stream>" >> "$OUT/spumux.xml"
+ echo "</subpictures>" >> "$OUT/spumux.xml"
+ # spumux.xml done
+ fi
+ find "$OUT" -name \*.m2v -exec mv {} "$OUT/vdrsync.mpv" \;
+ NUMBER=0
+ find "$OUT" -name \*.mp2 | while read x ; do
+ mv "$x" "$OUT/vdrsync$NUMBER.mpa"
+ NUMBER=$(($NUMBER+1))
+ done
+ else
+ if [ "$USE_CUT" = "yes" ]; then
+ CUTCMD="-cut"
+ fi
+ ExecCmd vdrsync.pl $CUTCMD -o "$2/VDRSYNC.$3" "$4"
fi
- ExecCmd vdrsync.pl $CUTCMD -o "$2/VDRSYNC.$3" "$4"
;;
# Requant Syntax: TempDir Number Filename Faktor
REQUANT)
- if [ "$USE_TCREQUANT" == "yes" ]; then
+ if [ "$USE_TCREQUANT" = "yes" ]; then
ExecCmd tcrequant -f "$5" -i "$4" -o "$2/VDRSYNC.$3/requant.mpv"
else
ExecCmd requant "$5" < "$4" > "$2/VDRSYNC.$3/requant.mpv"
@@ -171,23 +274,29 @@
# Mplex Syntax: TempDir FileName1 FileName2 FileName3
MPLEX)
- if [ "$USE_TCMPLEX" == "yes" ]; then
+ mkfifo "$2/mplexfifo"
+ if [ "$USE_TCMPLEX" = "yes" ]; then
if [ "$5" != "" ]; then
- ExecCmd $TCMPLEX -i "$3" -p "$4" -s "$5" -m d -o "$2/movie.mpg"
+ ExecCmd $TCMPLEX -i "$3" -p "$4" -s "$5" -m d -o "$2/mplexfifo" &
else
- ExecCmd $TCMPLEX -i "$3" -p "$4" -m d -o "$2/movie.mpg"
+ ExecCmd $TCMPLEX -i "$3" -p "$4" -m d -o "$2/mplexfifo" &
fi
else
if [ "$5" != "" ]; then
- ExecCmd mplex -f 8 -vbr -v 1 -o "$2/movie.mpg" "$3" "$4" "$5"
+ ExecCmd mplex -f 8 -vbr -v 1 -o "$2/mplexfifo" "$3" "$4" "$5" &
else
- ExecCmd mplex -f 8 -vbr -v 1 -o "$2/movie.mpg" "$3" "$4"
+ ExecCmd mplex -f 8 -vbr -v 1 -o "$2/mplexfifo" "$3" "$4" &
fi
fi
+ if [ -f "$2/spumux.xml" ]; then
+ spumux -v 2 "$2/spumux.xml" < "$2/mplexfifo" > "$2/movie.mpg"
+ else
+ cat "$2/mplexfifo" > "$2/movie.mpg"
+ fi
;;
MKMENU)
- if [ "$USE_TCMPLEX" == "yes" ]; then
+ if [ "$USE_TCMPLEX" = "yes" ]; then
Png2Yuv "$2/menu-bg-$3.png" |
mpeg2enc -q 2 -a 2 -n p -f 8 -v 0 -o "$2/menu-bg-$3.m2v" &&
$TCMPLEX -i "$2/menu-bg-$3.m2v" -p "$4/menu-silence.mp2" -m d -o /dev/stdout |
@@ -260,7 +369,7 @@
CheckCmd spumux &&
CheckCmd vdrsync.pl
if [ "$?" -eq 0 ]; then
- if [ "$USE_TCMPLEX" == "yes" ]; then
+ if [ "$USE_TCMPLEX" = "yes" ]; then
CheckCmd $TCMPLEX
else
CheckCmd mplex
Alles anzeigen
I'll try to merge this and see if it works...