Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] [PATCH] replex support for vdrconvert



I have decided to add support for replex in vdrconvert in order to help solve the demux problem with edited vdr recordings. This patch requires both the latest version of vdrsync developer version (vdrsync-0.1.3pre1.pl) and replex (replex-0.1.3).

If someone could take a look at this, I would really appreciate it. I have tested it on both edited and non-edited vdr recordings and it appears to work (although the audio still drops out on cut marks sometimes). The main problem was trying to get the total amount of frames in the video which is why I used vdrsync to analyze the file before attempting to demux it with replex.

Regards,
C.Y.M.
--- vdrconvert/bin/vdr2dvd.sh.orig	2005-01-01 19:37:45.000000000 -0800
+++ vdrconvert/bin/vdr2dvd.sh	2005-01-02 06:37:39.000000000 -0800
@@ -1016,6 +1016,7 @@
 
 		pushd ${UniqueDir[Number]} >>$STDOUT
 		local pxfiles=""
+		local rxfiles=""
 		[ -f $i/marks.vdr ] && cp $i/marks.vdr ${UniqueDir[Number]}
 		[ -f $i/summary.vdr ] && cp $i/summary.vdr ${UniqueDir[Number]}
 		[ -f $i/index.vdr ] && cp $i/index.vdr ${UniqueDir[Number]}
@@ -1159,6 +1160,61 @@
 
 			echo "${Record[Number]}" > ${UniqueDir[Number]}/Titel.txt
 		      ;;
+		    replex)
+		        local vdrfiles=`$LS $i/[0-9][0-9][0-9].vdr`
+		        for l in $vdrfiles
+			do
+				local len=`$LS -Ls $l|awk '{print $1}'`
+				[ $len -gt 1 ] && local rxfiles="${rxfiles} ${l}"
+			done
+
+			if [ "$VERBOSE" = "yes" ]; then
+				echo "ANALYZING : call vdrsync: $VDRSYNC3 -i $i/"
+			fi
+			nice -n $PRIO $VDRSYNC3 -i $i/ >${LOG[Number]} 2>&1
+			
+		        [ -f "${UniqueDir[Number]}/c0.mpa" ] && nice -n $PRIO rm -f ${UniqueDir[Number]}/c0.mpa
+			[ -f "${UniqueDir[Number]}/c1.mpa" ] && nice -n $PRIO rm -f ${UniqueDir[Number]}/c1.mpa
+			[ -f "${UniqueDir[Number]}/e0.mpv" ] && nice -n $PRIO rm -f ${UniqueDir[Number]}/e0.mpv
+			[ -f "${UniqueDir[Number]}/c0.ac3" ] && nice -n $PRIO rm -f ${UniqueDir[Number]}/c0.ac3
+			
+			if [ "$VERBOSE" = "yes" ]; then
+				echo "INFO  : call Replex: $REPLEX -o ${UniqueDir[Number]} -z $rxfiles"
+			fi
+			nice -n $PRIO $REPLEX -o ${UniqueDir[Number]}/001 -z $rxfiles >>${LOG[Number]} 2>&1
+			local status=$?
+			
+			[ "$DVD_DEBUG" = "yes" ] && cat ${LOG[Number]} >>$LOGFILE
+			
+			if [ $status -ne 0 ]
+			then
+				echo "ERROR : $REPLEX  rc=$status"
+				logger "$0 : ERROR : $REPLEX  rc=$status"
+				ExitClean
+			fi
+
+		        [ -f "${UniqueDir[Number]}/0010.mp2" ] && nice -n $PRIO mv ${UniqueDir[Number]}/0010.mp2 ${UniqueDir[Number]}/0010.mpa
+			[ -f "${UniqueDir[Number]}/0010.ac3" ] && nice -n $PRIO mv ${UniqueDir[Number]}/0010.ac3 ${UniqueDir[Number]}/0010.ac3
+			[ -f "${UniqueDir[Number]}/001.mv2" ] && nice -n $PRIO mv ${UniqueDir[Number]}/001.mv2 ${UniqueDir[Number]}/001.mpv
+
+			# Save aspect ratio
+		        strings ${LOG[Number]}|grep Aspect|awk '{print $3}' >${UniqueDir[Number]}/ASPECT.txt
+		        # Save resolution
+		        local hor=`strings ${LOG[Number]}|grep "Horizontal size"|awk '{print $3}'`
+		        local ver=`strings ${LOG[Number]}|grep "Vertical size"|awk '{print $3}'`
+			echo "Resolution: $hor x $ver"
+		        printf "%sx%s\n" "$hor" "$ver" >${UniqueDir[Number]}/RESOLUTION.txt
+			# Save number of frames
+		        local framelen=`strings ${LOG[Number]}|grep movie_length_cut|cut -f1 -d '='|awk '{print $3}'`
+			echo "Time: $framelen seconds"
+			local framespd=`strings ${LOG[Number]}|grep "Frames per Second"|cut -f1 -d '='|awk '{print $4}'`
+			echo "Framerate: $framespd"
+			framesiz=$(echo "scale=0; $framelen * $framespd" | bc)
+			printf "%.0f\n" $framesiz >${UniqueDir[Number]}/FRAMES.txt
+			printf "Number of Frames: %.0f\n" $framesiz
+			echo "${Record[Number]}" >${UniqueDir[Number]}/Titel.txt
+		      ;;
+		    
 		    *)
 		      echo "No support for Demuxer $DEMUXER"
 		      local status=1
@@ -1277,6 +1333,10 @@
 					j="001"
 					jj="mpa"
 					;;
+				    replex)
+				        j="0010"
+					jj="mpa"
+					;;
 				    *)
 					;;
 				esac
@@ -1300,6 +1360,10 @@
 					j="001-01"
 					jj="mpa"
 					;;
+				    replex)
+				        j="0011"
+					jj="mpa"
+					;;
 				    *)
 					;;
 				esac
@@ -1322,6 +1386,10 @@
 					j="001"
 					jj="ac3"
 					;;
+				    replex)
+				        j="001"
+					jj="ac3"
+					;;
 				    *)
 					;;
 				esac
@@ -1336,6 +1404,8 @@
 					;;
 				    pva)
 					;;
+				    replex)
+				        ;;
 				    *)
 					;;
 				esac
--- vdrconvert/bin/vdrconvert.sh.orig	2005-01-01 18:03:48.000000000 -0800
+++ vdrconvert/bin/vdrconvert.sh	2005-01-02 03:02:27.000000000 -0800
@@ -48,11 +48,13 @@
 [ -z "$SVDRPSEND" ]         && export SVDRPSEND=svdrpsend.pl
 [ -z "$VDRSYNC" ]           && export VDRSYNC=$VDRCONVERTBINDIR/vdrsync-0.1.2.2.pl
 [ -z "$VDRSYNC2" ]          && export VDRSYNC2=$VDRCONVERTBINDIR/vdrsync-0.1.2.2-dev2.pl
+[ -z "$VDRSYNC3" ]          && export VDRSYNC3=$VDRCONVERTBINDIR/vdrsync-0.1.3pre1.pl
 # Default demux
 [ -z "$DEMUXER" ]           && DEMUXER="vdrsync"
 [ -z "$TCMPLEX" ]           && export TCMPLEX=tcmplex
 [ -z "$DVBMPLEX" ]          && export DVBMPLEX=dvb-mplex
 [ -z "$MPLEX" ]             && export MPLEX=mplex
+[ -z "$REPLEX" ]	    && export REPLEX=replex
 [ -z "$MP2ENC" ]            && export MP2ENC=mp2enc
 [ -z "$TCMPLEX_PANTELTJE" ] && export TCMPLEX_PANTELTJE=tcmplex-panteltje
 [ -z "$MKISOFS" ]           && export MKISOFS=mkisofs

Home | Main Index | Thread Index