From 1992d5222ff28d13269eb45187351bdef69e3bcd Mon Sep 17 00:00:00 2001 From: Daniel Meyerholt Date: Sun, 6 Feb 2011 16:30:01 +0100 Subject: =?UTF-8?q?*=20patches=20by=20Thomas=20G=C3=BCnther=20=20(stolen=20from=20e-tobi=20deb):=20=20=20-=20maketempdi?= =?UTF-8?q?r=20patch=20to=20create=20temporary=20directory=20=20=20-=20gre?= =?UTF-8?q?ppid2=20patch=20to=20detect=20second=20running=20process=20inst?= =?UTF-8?q?ead=20of=20third=20=20=20-=20fix=20ogm/ac3=20vdrsync=200.1.2.2d?= =?UTF-8?q?ev1=20creates=20bd.mpa,=20not=20bd.ac3=20when=20demuxing=20=20?= =?UTF-8?q?=20-=20preserve=20owner=20of=20queue.vdrrip=20in=20queuehandler?= =?UTF-8?q?.sh=20=20=20-=20fix=20identification=20of=20aspect=20ratio=20(h?= =?UTF-8?q?ttp://vdrportal.de/board/thread.php=3Fthreadid=3D53225=20and=20?= =?UTF-8?q?http://vdrportal.de/board/thread.php=3Fthreadid=3D58775)=20=20?= =?UTF-8?q?=20-=20change=20VDRVERSION=20define=20to=20APIVERSION=20in=20Ma?= =?UTF-8?q?kefile=20=20=20-=20fix=20some=20menus=20for=20vdr>=3D1.3.7=20(f?= =?UTF-8?q?rom=20user=20norad=20at=20vdrportal.de=20and=20thomas)=20*=20pa?= =?UTF-8?q?tch=20by=20Herbert=20Attenberger=20=20?= =?UTF-8?q?and=20user=20micmac=20at=20vdrportal.de=20to=20change=20dvd-par?= =?UTF-8?q?ameter=20to=20-dvd=20if=20the=20mencoder-version=20is=200.XX=20?= =?UTF-8?q?(stolen=20from=20e-tobi=20deb)=20*=20patch=20by=20Stefan=20Wagn?= =?UTF-8?q?er=20to=20change=20mencoder=20parameters=20when=20detecting=20c?= =?UTF-8?q?ropping=20(stolen=20from=20e-tobi=20deb)=20*=20patches=20by=20T?= =?UTF-8?q?obias=20Grimm=20=20(stolen=20from=20e-tobi=20?= =?UTF-8?q?deb)=20=20=20-=20use=20libdvdread's=20NEW=5FIFO=5FREAD=20functi?= =?UTF-8?q?ons=20=20=20-=20fix=20compilation=20for=20gcc4.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/queuehandler.sh | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'scripts/queuehandler.sh') diff --git a/scripts/queuehandler.sh b/scripts/queuehandler.sh index 759b603..c592bd8 100755 --- a/scripts/queuehandler.sh +++ b/scripts/queuehandler.sh @@ -92,6 +92,7 @@ function initialize () { log_error "usage: $scriptname queuefile tempdir" 1 fi + mkdir -p "$tempdir" if [ ! -d "$tempdir" ] then log_error "directory $tempdir doesn't exist, aborting !" 1 @@ -101,7 +102,7 @@ function initialize () { local pids=`pgrep -d" " "$scriptname"` local pid1=`echo "$pids" | cut -d" " -f1` - local pid2=`echo "$pids" | cut -d" " -f3` + local pid2=`echo "$pids" | cut -d" " -f2` if [ "$pid1" != "$pid2" ] then @@ -215,6 +216,17 @@ function pre_check () { mp=$mplayer fi + # change the dvd-parameter to -dvd if the mencoder-version is 0.XX + if [ "$dvd" ] + then + local menc_ver=`$mc -v 2>/dev/null | grep "MEncoder" | sed "s/^MEncoder \(.\).*/\1/"` + if [ "$menc_ver" = "0" ] + then + dvd=`echo "$dvd" | sed "s/^dvd:\/\//-dvd /"` + fi + log_debug "dvd: $dvd" + fi + # check needed tools case "$container" in "avi") @@ -303,8 +315,8 @@ function preview () { shortname="$shortname(preview)" # start the preview in the middle of the movie - local length=`"$mp" -identify -frames 0 "$dir/001.vdr" 2>/dev/null | grep ID_LENGTH | cut -d"=" -f2` - let local ss=length/2 + local length=`"$mp" -vo null -ao null -identify -frames 0 "$dir/001.vdr" 2>/dev/null | grep ID_LENGTH | cut -d"=" -f2` + let local ss=$(echo $length | sed -e s/[.,].*//)/2 previewval="-ss $ss -endpos $previewlength" } @@ -316,6 +328,11 @@ function prepare() { if [ "$error" ]; then return elif [ "$dvd" ]; then return; fi + # Recreate $tempdir if removed by vdr housekeeping + mkdir -p "$tempdir" + if [ ! -d "$tempdir" ]; then return; fi + cd "$tempdir" + case "$container" in "avi") # join all vdr-files to $tempdir/temp.vdr @@ -337,6 +354,11 @@ function prepare() { log_info "demuxing all vdr-files from directory $dir" evecho "demuxing vdr-files" execute "$vdrsync $dir -o $tempdir" + # vdrsync 0.1.2.2 developer version creates bd.mpa + if [ -e "$tempdir/bd.mpa" ] + then + mv "$tempdir/bd.mpa" "$tempdir/bd.ac3" + fi fi ;; *) @@ -443,7 +465,7 @@ function encode () { ;; esac - # set mencoder -vop values + # set mencoder -vf values if [ "$crop_w" = "-1" -a "$crop_h" = "-1" -a "$crop_x" = "-1" -a \ "$crop_y" = "-1" -a "$scale_w" = "-1" -a "$scale_h" = "-1" ] then @@ -453,15 +475,15 @@ function encode () { then local vopopts="scale=$scale_w:$scale_h" else - local vopopts="scale=$scale_w:$scale_h,crop=$crop_w:$crop_h:$crop_x:$crop_y" + local vopopts="crop=$crop_w:$crop_h:$crop_x:$crop_y,scale=$scale_w:$scale_h" fi if [ "$ppvalues" ] then - local vopopts="-vop pp=$ppvalues,$vopopts" + local vopopts="-vf pp=$ppvalues,$vopopts" elif [ "$vopopts" ] then - local vopopts="-vop $vopopts" + local vopopts="-vf $vopopts" fi # encode in two passes @@ -729,8 +751,8 @@ function del_queue () { rm -f "$queuefile" else let lines=lines-1 - tail -n $lines "$queuefile" > /tmp/queuefile.tmp - mv /tmp/queuefile.tmp $queuefile + cp -a "$queuefile" /tmp/queuefile.tmp + tail -n $lines /tmp/queuefile.tmp > "$queuefile" fi if [ "$error" ] @@ -782,7 +804,7 @@ function split () { -ss $splitpos $endpos -o $tempdir/$ofile" # detect length of splitted file and add it to $splitpos - local length=`$mplayer -identify -frames 0 $tempdir/$ofile 2>/dev/null | \ + local length=`$mplayer -vo null -ao null -identify -frames 0 $tempdir/$ofile 2>/dev/null | \ grep ID_LENGTH | cut -d= -f2` let splitpos=splitpos+length-overlap let count=count+1 -- cgit v1.2.3