View Full Version : RTV2ZEN - Batch file to convert replay mpeg to xvid for zen vision:m
famewolf
02-09-06, 08:27 AM
The file http://rapidshare.de/files/12877388/rtv2zen.zip.html contains a batch file to convert replaytv mpeg's to xvid's that will look good on the zen vision:m but not take alot of space. (I attempted to attach it to this message but kept getting errors) It is based on the rtv2psp batch scripts written by R. Fontenot. I'm sure my version can be improved upon and feel free to make changes/suggestions. The zip contains copies of ffmpeg, the replaytv tools and the cygwin dll's needed by ffmpeg so everything to need to make it work should be included. The converted shows are stored in c:\ZEN_VIDEOS by default. To autosync that folder with your zen vision:m do the following:
Open Windows Media Player.
Go to Tools->Options
Go to the Library Tab and click the 'Monitor Folder...' button
Click the 'Add..' button and navigate to 'C:\ZEN_VIDEOS'.
*What this does is basically add all the videos in C:\ZEN_VIDEOS to your video library.
In Windows Media Players, go to the Library.
Right-Click 'Auto Playlists' and select 'New..'
Name your playlist 'Videos' or something.
Select 'Music in my library' and click the 'Remove' button.
click '+' and choose 'Video in my library'
Under Video in my library, click '+' and choose 'File Type'
Next to File type Contains, click '' and choose 'avi'
Press OK
*What this does is create an automatic playlist of all the .avi files in your video library.
You can now sync this playlist to your Vision:M.
A copy of the batch file follows for those who just want that:
@echo off
rem *******************************************
rem * *
rem * ReplayTV 2 ZEN Video conversion program *
rem * *
rem * v1.0 *
rem * *
rem * Based on RTV2PSP which was created by: *
rem * R. Fontenot, Copyright 2005 *
rem * *
rem * *
rem * For AV Science Forum members *
rem * *
rem *******************************************
set FFMPEG="C:\RTV2ZEN\ffmpeg.exe"
set EVTDUMP=C:\RTV2ZEN\evtdump.exe
set RTVEDIT=C:\RTV2ZEN\rtvedit.exe
set LOGDIR=C:\RTV2ZEN
set ZENVIDEOS=C:\ZEN_Videos
set EDIT=yes
set COUNT=99999
set JOBID=%RANDOM%
for %%i in (%1) do set TITLE=%%~ni
for %%i in (%1) do set FULLPATH=%%~fi
set SOURCE=%FULLPATH:~0,-4%.mpg
set EVTFILE=%FULLPATH:~0,-4%.evt
echo %DATE% %TIME% - %JOBID%: [ **** Start: %TITLE% **** ] >> %LOGDIR%\rtv2zen.log 2>&1
if "%EDIT%" == "yes" (
echo %DATE% %TIME% - %JOBID%: Edit RTV File >> %LOGDIR%\rtv2zen.log 2>&1
%EVTDUMP% "%EVTFILE%" | %RTVEDIT% >> %LOGDIR%\rtv2zen.log 2>&1
set SOURCE=%FULLPATH:~0,-4%1.mpg
)
echo %DATE% %TIME% - %JOBID%: Transcoding RTV File to AVI >> %LOGDIR%\rtv2zen.log 2>&1
%FFMPEG% -y -i "%SOURCE%" -title "%TITLE%" -vcodec mpeg4 -vtag XVID -s 320x240 -b 600 -acodec mp3 -ab 64 -vol 130 -f avi "%ZENVIDEOS%\%TITLE%.AVI"
echo %DATE% %TIME% - %JOBID%: Transcoding RTV File to AVI - Complete >> %LOGDIR%\rtv2zen.log 2>&1
del %LOGDIR%\2pass%JOBID%*.log
if "%EDIT%" == "yes" (
del "%FULLPATH:~0,-4%1.*"
)
echo %DATE% %TIME% - %JOBID%: [ **** Finish: %TITLE% **** ] >> %LOGDIR%\rtv2zen.log 2>&1
I hope someone finds this useful. In the RTV2PSP thread he also states you can go into DVarchive properties and under download tell it to run the bat file...this will cause it to auto convert shows downloaded to the pc through dvarchive.
Suggestion: include your post as a README.txt file and include it in the zip.
roger_richards
02-09-06, 03:54 PM
Just wondering (don't have a Vision:M), if I'm lazy and just want to copy a native ReplayTV mpeg file (downloaded via DVArchive) to the Vision:M, will it play OK? The Vision:M specs state it supports MPEG2 (natively)?
famewolf
02-09-06, 04:06 PM
[QUOTE=roger_richards]Just wondering (don't have a Vision:M), if I'm lazy and just want to copy a native ReplayTV mpeg file (downloaded via DVArchive) to the Vision:M, will it play OK? The Vision:M specs state it supports MPEG2 (natively)?[/QUOTE]
The creative conversion program would not work correctly and said the replaytv mpeg's had no audio (which they do)...I didn't try copying the 2 gig file directly to the player...the batch file I'm using also removes commercials which I don't want to see when viewing on the player.
[QUOTE=icecow]Suggestion: include your post as a README.txt file and include it in the zip.[/QUOTE]
Another Suggestion: Include the README text in the batch file itself.
famewolf
02-10-06, 07:37 AM
[QUOTE=Wrecks]Another Suggestion: Include the README text in the batch file itself.[/QUOTE]
Good suggestions from both you and icecow..will include them when I release next version..just waiting to see if anyone else has suggestions or improvements to the script.
roger_richards
02-10-06, 04:55 PM
[QUOTE=famewolf]The creative conversion program would not work correctly and said the replaytv mpeg's had no audio (which they do)...I didn't try copying the 2 gig file directly to the player...the batch file I'm using also removes commercials which I don't want to see when viewing on the player.[/QUOTE]
My question is with regards to NOT using the Creative conversion program. Just copy the replaytv mpg file to the Vision:M using Windows Explorer and trying to play it WITHOUT conversion.
zabolots
03-20-06, 09:03 AM
Anybody good at linux shell scripts care to port this over? I can do some basic shell scripting on Linux but my attempts at porting this over failed miserably :confused:
famewolf
03-20-06, 02:56 PM
[QUOTE=zabolots]Anybody good at linux shell scripts care to port this over? I can do some basic shell scripting on Linux but my attempts at porting this over failed miserably :confused:[/QUOTE]
The zen vision:m has 0 *let me emphasize this* ZERO support under linux since it is a MTP type device which requires windows media player 10 to be fully functional...so what exactly are you trying to accomplish? If you are trying to convert your replay mpg's to divx under linux for another reason there are plenty of tools that already do this.
zabolots
03-20-06, 04:23 PM
[QUOTE=famewolf]The zen vision:m has 0 *let me emphasize this* ZERO support under linux since it is a MTP type device which requires windows media player 10 to be fully functional...so what exactly are you trying to accomplish? If you are trying to convert your replay mpg's to divx under linux for another reason there are plenty of tools that already do this.[/QUOTE]
I understand that the files must ultimately end up on an XP box to transfer to the Zen. Here's what I'm trying to accomplish:
I run DVArchive on a Linux box. I'd like to be able to schedule a show to download to DVArchive and then, using DVA's "Execute Command" task, have a Linux version of your BAT file strip the commercials and convert to XVID/MPEG4 then use WPUT to upload to a folder on my XP box that is monitored (via WMP10's folder monitoring functionality) and automatically synchronized when my ZVM is connected.
If I can get all that working, it seems like a pretty seamless way to get shows onto the ZVM with very little interaction.
What do you think?
famewolf
03-20-06, 05:48 PM
I understand what you are trying to accomplish...I run Suse 10 Linux on all my machines except one windows laptop which I use to sync the zen vision...I really think you are adding an extra layer that does not need to be there....install dvarchive on the windows machine...only use that copy for shows you want to download to the zen..you can even schedule downloads on the win box direct from the replaytv...setup the command to execute the bat file already written...and have wmp10 monitor the ZEN_VIDEO folder...I already do all this on the win box..you can queue up a couple and in the morning they are on the zen. Why does the dvarchive portion HAVE to be on the linux box? Since it's a java app it runs the same.
If you are determined to run it on the linux box the shell script would be tiny..basically something similar to this:
evtdump $1 > workfile
rtvedit workfile
ffmpeg filename etc.......
---
You don't need all the loop logic because dvarchive is only going to process 1 file...
[QUOTE=zabolots]I understand that the files must ultimately end up on an XP box to transfer to the Zen. Here's what I'm trying to accomplish:
I run DVArchive on a Linux box. I'd like to be able to schedule a show to download to DVArchive and then, using DVA's "Execute Command" task, have a Linux version of your BAT file strip the commercials and convert to XVID/MPEG4 then use WPUT to upload to a folder on my XP box that is monitored (via WMP10's folder monitoring functionality) and automatically synchronized when my ZVM is connected.
If I can get all that working, it seems like a pretty seamless way to get shows onto the ZVM with very little interaction.
What do you think?[/QUOTE]
zabolots
03-21-06, 08:39 AM
Thanks for the suggestion. I hadn't thought about using DVA on the XP box for this. I'll probably go that route.
roger_richards
03-21-06, 03:30 PM
Can anyone confirm if native ReplayTV mpeg files (downloaded via DVArchive) will play (without being transcoded) on the Vision:M?
famewolf
03-21-06, 03:54 PM
[QUOTE=roger_richards]Can anyone confirm if native ReplayTV mpeg files (downloaded via DVArchive) will play (without being transcoded) on the Vision:M?[/QUOTE]
They will not play.
zabolots
03-24-06, 10:42 AM
anybody had any luck with this batch file when passing in multiple files on the command line? For me, when run under these circumstances, only the last file in the list is actually converted since the for loop only covers setting of variables rather than doing the actual work. Therefore, the variable gets set repeatedly for as many files are passed in, then the loop exits and the conversion work begins with the variables having the last value that was set in the loop. Here's a dump of what happens ("@echo off" removed):
G:\>rtv2zen.bat g:\DVArchive\Local_Guide\*.mpg
G:\>set FFMPEG="c:\Documents and Settings\Scott Zabolotzky\My Documents\bin\ffmp
eg.exe"
G:\>set EVTDUMP=c:\RTVTools\bin\win32\evtdump.exe
G:\>set RTVEDIT=c:\RTVTools\bin\win32\rtvedit.exe
G:\>set LOGDIR=C:\wutemp
G:\>set ZENVIDEOS=C:\ZenVideos
G:\>set EDIT=yes
G:\>set VIDSIZE=320x240
G:\>set VBITRATE=600
G:\>set ABITRATE=128
G:\>set COUNT=99999
G:\>set JOBID=31958
G:\>for %i in (g:\DVArchive\Local_Guide\*.mpg) do set TITLE=%~ni
G:\>set TITLE=Recorded Thu 3-23 - Test1
G:\>set TITLE=Recorded Thu 3-23 - Test2
G:\>set TITLE=Recorded Thu 3-23 - Test3
G:\>set TITLE=Recorded Thu 3-23 - Test4
G:\>for %i in (g:\DVArchive\Local_Guide\*.mpg) do set FULLPATH=%~fi
G:\>set FULLPATH=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test1.mpg
G:\>set FULLPATH=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test2.mpg
G:\>set FULLPATH=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test3.mpg
G:\>set FULLPATH=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test4.mpg
G:\>set SOURCE=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test4.mpg
G:\>set EVTFILE=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test4.evt
G:\>echo Fri 03/24/2006 10:36:31.16 - 31958: [ **** Start: Recorded Thu 3-23 - T
est4 **** ] 1>>C:\wutemp\rtv2zen.log 2>&1
G:\>if "yes" == "yes" (
echo Fri 03/24/2006 10:36:31.16 - 31958: Edit RTV File 1>>C:\wutemp\rtv2zen.log
2>&1
c:\RTVTools\bin\win32\evtdump.exe "g:\DVArchive\Local_Guide\Recorded Thu 3-23 -
Test4.evt" | c:\RTVTools\bin\win32\rtvedit.exe 1>>C:\wutemp\rtv2zen.log 2>&1
set SOURCE=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test41.mpg
.
.
.
famewolf
03-24-06, 02:09 PM
[QUOTE=zabolots]anybody had any luck with this batch file when passing in multiple files on the command line? For me, when run under these circumstances, only the last file in the list is actually converted since the for loop only covers setting of variables rather than doing the actual work. Therefore, the variable gets set repeatedly for as many files are passed in, then the loop exits and the conversion work begins with the variables having the last value that was set in the loop. Here's a dump of what happens ("@echo off" removed):
G:\>rtv2zen.bat g:\DVArchive\Local_Guide\*.mpg
G:\>set FFMPEG="c:\Documents and Settings\Scott Zabolotzky\My Documents\bin\ffmp
eg.exe"
G:\>set EVTDUMP=c:\RTVTools\bin\win32\evtdump.exe
G:\>set RTVEDIT=c:\RTVTools\bin\win32\rtvedit.exe
G:\>set LOGDIR=C:\wutemp
G:\>set ZENVIDEOS=C:\ZenVideos
G:\>set EDIT=yes
G:\>set VIDSIZE=320x240
G:\>set VBITRATE=600
G:\>set ABITRATE=128
G:\>set COUNT=99999
G:\>set JOBID=31958
G:\>for %i in (g:\DVArchive\Local_Guide\*.mpg) do set TITLE=%~ni
G:\>set TITLE=Recorded Thu 3-23 - Test1
G:\>set TITLE=Recorded Thu 3-23 - Test2
G:\>set TITLE=Recorded Thu 3-23 - Test3
G:\>set TITLE=Recorded Thu 3-23 - Test4
G:\>for %i in (g:\DVArchive\Local_Guide\*.mpg) do set FULLPATH=%~fi
G:\>set FULLPATH=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test1.mpg
G:\>set FULLPATH=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test2.mpg
G:\>set FULLPATH=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test3.mpg
G:\>set FULLPATH=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test4.mpg
G:\>set SOURCE=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test4.mpg
G:\>set EVTFILE=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test4.evt
G:\>echo Fri 03/24/2006 10:36:31.16 - 31958: [ **** Start: Recorded Thu 3-23 - T
est4 **** ] 1>>C:\wutemp\rtv2zen.log 2>&1
G:\>if "yes" == "yes" (
echo Fri 03/24/2006 10:36:31.16 - 31958: Edit RTV File 1>>C:\wutemp\rtv2zen.log
2>&1
c:\RTVTools\bin\win32\evtdump.exe "g:\DVArchive\Local_Guide\Recorded Thu 3-23 -
Test4.evt" | c:\RTVTools\bin\win32\rtvedit.exe 1>>C:\wutemp\rtv2zen.log 2>&1
set SOURCE=g:\DVArchive\Local_Guide\Recorded Thu 3-23 - Test41.mpg
.
.
.
[/QUOTE]
That is not how the batch file is setup to handle multiple files...if you drag and drop multiple files onto this batch file (icon) in windows it stacks the files one after the other with full paths...example:
rtv2zen c:\dvarchive\local_archive\file1.mpg c:\dvarchive\local_archive\file2.mpg etc.
It does not support wildcards.
zabolots
03-24-06, 04:07 PM
OK, thanks.
zabolots
03-27-06, 01:27 PM
I pretty much have this working but still prefer to have this all take place on my Linux DVArchive machine rather than tying up my main PC to start up DVArchive, then download and convert the shows.
I've made another attempt to convert this to a bash shell script but don't know how to port the following lines over from DOS to bash.
for %%i in (%1) do set TITLE=%%~ni
for %%i in (%1) do set FULLPATH=%%~fi
set SOURCE=%FULLPATH:~0,-4%.mpg
set EVTFILE=%FULLPATH:~0,-4%.evt
I don't even necessarily need the for loop as I'll be setting this up in such a way that only one file will be passed into the script. I just don't know how to cleanly strip away the extension from either the file name ("~ni") or the full path ("~fi") in bash.
If anyone can help out it would be greatly appreciated. I'll certainly post the finished script if I can get it up and running.
Thanks...Scott
SpaceCadet
03-27-06, 04:11 PM
I'm not into Linux myself but a quick Google search yielded relevant information:
http://docsrv.caldera.com:8457/en/AdvBashHowto/
http://docsrv.caldera.com:8457/en/AdvBashHowto/variables.html
http://docsrv.caldera.com:8457/en/AdvBashHowto/internal.html#EX35 (example 3-41)
RFontenot
03-27-06, 10:02 PM
In the original rtv2psp script, the "for" lines were used to manipulate the input filename so even if the end user dragged and dropped the wrong file (ndx, evt, xml, bak) the script would still process the .mpg file. They were not intended to support looping through a list of files.
The shell script below accomplishes the same thing:
#!/bin/sh
FILENAME=`basename "$1"`
DIRPATH=`dirname "$1"`
cd $DIRPATH
FULLPATH=`pwd`/$FILENAME
TITLE=`echo $FILENAME | sed -e 's/....$//g'`
SOURCE=`echo $FULLPATH | sed -e 's/....$/.mpg/g'`
EVTFILE=`echo $FULLPATH | sed -e 's/....$/.evt/g'`
Since DVArchive uses filenames with spaces, you'll need to surround the input filename with quotes if you are running the script from the command line.
scriptname "DVArchive filename.mpg"
RF
zabolots
03-28-06, 11:17 PM
OK, I think I finally have this working as I wanted. My goal was to be able to somehow mark those shows on my RTV units that I wanted to transfer to my Creative Zen Vision:M (ZVM) and have them automatically be downloaded and converted and ready to be transferred to the player the next time I dock it. I also wanted a majority of the work to be done on my Linux DVArchive box rather than on my main PC (even though the file must eventually end up on the WinXP PC to transfer to the ZVM. That led me to "port" the batch file from this thread to a bash script (actually 2 scripts).
Here's how I got it working:
1. Create two categories on the ReplayTV units "Zen High" and "Zen Low". Any shows copied into "Zen High" will be converted for the ZVM using higher quality settings. Any shows copied into "Zen Low" will be converted for the ZVM using lower quality settings.
2. Create a "Copy Shows" task in DVArchive to perodically (I did mine daily at 1am) download files from these categories.
3. Copy the InitiateConversion.bash and RTV2ZEN.bash scripts to the Linux machine with DVArchive and make note of the path where you put them. Edit each file making config changes to suit your needs.
4. Set the Post Download Command by going in to DVArchive and selecting File | DVArchive Properties | Downloads and putting the following text in the Post Download Command field: [FONT=Courier New]/full/path/to/InitiateConversion.bash "%rcat%" "%mpeg%"[/FONT] making sure to use the path from step 3.
At this point, any time a show is downloaded into DVArchive, the InitiateConversion.bash script will be called. It will determine if the show was downloaded from either the "Zen High" or "Zen Low" categories. If the show was not from either of these categories, the script will simply exit. If the show was from either of these categories, it will call the RTV2ZEN.bash script to convert the file with the appropriate compression settings. Once the show has been converted it will optionally delete the original files from the DVArchive data store.
The RTV2ZEN.bash script will optionally edit out commercials using evtdump and rtvedit. It will then convert the file to an XVID file using the appropriate settings. It will then optionally upload the resulting file to the Windows XP host using wput (the WinXP box must be set up to accept inbound FTP uploads).
It seems to be working pretty well for me so far for the small test files I've created in the "Zen High" and "Zen Low" categories. Hopefully somebody else can benefit from it as well.
Here are the scripts:
#!/bin/bash
#InitiateConversion.bash
########################################################################
######### Need to edit these lines to ensure their accuracy ############
########################################################################
#full path to RTV2ZEN.bash conversion script
RTV2ZEN=/opt/RTV2ZEN/RTV2ZEN.bash
#path where initiateconversion.log file should be created
LOGDIR=/tmp
#indicates whether original files should be deleted from DVArchive store
WIPE=yes
########################################################################
TIMESTAMP=`date +"%D %r"`
echo $TIMESTAMP: New file from category "$1" downloaded to DVArchive... >> $LOGDIR/initiateconversion.log 2>&1
if [[ "$1" = "Zen Low" ]]
then
echo $TIMESTAMP: Preparing to convert using low quality... >> $LOGDIR/initiateconversion.log 2>&1
QUAL=low
elif [[ "$1" = "Zen High" ]]
then
echo $TIMESTAMP: Preparing to convert using high quality... >> $LOGDIR/initiateconversion.log 2>&1
QUAL=high
else
echo $TIMESTAMP: Not a Zen download, exiting. >> $LOGDIR/initiateconversion.log 2>&1
exit 1
fi
TEMP=$2
FILENAME=${TEMP/".mpg"/}
#process file...
echo "$TIMESTAMP: Calling \"$RTV2ZEN\" \"$2\" $QUAL" >> $LOGDIR/initiateconversion.log 2>&1
"$RTV2ZEN" "$2" $QUAL
TIMESTAMP=`date +"%D %r"`
if [[ "$WIPE" = "yes" ]]
then
echo "$TIMESTAMP: Wiping original files \"$FILENAME.*\" from DVArchive data store" >> $LOGDIR/initiateconversion.log 2>&1
rm "$FILENAME.evt"
rm "$FILENAME.ndx"
rm "$FILENAME.mpg"
rm "$FILENAME.xml"
else
echo "$TIMESTAMP: Leaving original files \"$FILENAME.*\" in DVArchive data store" >> $LOGDIR/initiateconversion.log 2>&1
fi
#!/bin/bash
#RTV2ZEN.bash
########################################################################
######### Need to edit these lines to ensure their accuracy ############
########################################################################
#path to ffmpeg
FFMPEG=/usr/bin/ffmpeg
#path to evtdump
EVTDUMP=/opt/rtvtools/evtdump
#path to rtvedit
RTVEDIT=/opt/rtvtools/rtvedit
#path where rtv2zen.log file should be created
LOGDIR=/tmp
#path where final AVI files should be created
ZENVIDEOS=/ZenVideos
#indicates whether or not to strip commercials
#yes indicates commercials should be cut using evtdump and rtvedit
#no indicates to just convert the mpg without making any edits
EDIT=yes
#indicates whether or not to use 2-pass encoding
#yes indicates 2-pass mode which takes longer but yields smaller files
#no indicates single pass mode which is quicker but yields larger files
TWOPASS=yes
#indicates whether to upload resulting AVI file to another host with wput
UPLOADRESULT=yes
#full path to wput utility (http://wput.sourceforge.net/)
#only needed if UPLOADRESULT=yes
WPUT=/usr/bin/wput
#ftp URL, passed to wput, indicating where file should be uploaded
#only needed if UPLOADRESULT=yes
FTPURL=ftp://<user>:<pass>@<host>:<port>/path
#indicates whether AVI file should be deleted after it is uploaded
#only needed if UPLOADRESULT=yes
DELETERESULT=no
########################################################################
if [ -z "$1" ]
then
echo Usage: $0 "<filename.mpg> [quality]"
echo " where quality = \"low\" or \"high\"."
echo " Default value if [quality] param is omitted is \"low\""
echo Usage: $0 "<filename.mpg> [quality]" >> $LOGDIR/rtv2zen.log 2>&1
echo " where quality = \"low\" or \"high\"." >> $LOGDIR/rtv2zen.log 2>&1
echo " Default value if [quality] param is omitted is \"low\"" >> $LOGDIR/rtv2zen.log 2>&1
exit 10
elif [ ! -e "$1" ]
then
echo File $1 not found. Please supply full path to $1.
echo File $1 not found. Please supply full path to $1. >> $LOGDIR/rtv2zen.log 2>&1
exit 11
fi
# default to low quality
VIDSIZE=320x240
VBITRATE=1000
ABITRATE=64
QUALITY=low
if [[ "$2" = "high" ]]
then
VIDSIZE=640x480
VBITRATE=2000
ABITRATE=128
QUALITY=high
fi
FULLPATH=$1
TITLE=${FULLPATH##/*/}
TITLE=${TITLE/".mpg"/}
SOURCE=$FULLPATH
EVTFILE=${FULLPATH/".mpg"/}.evt
JOBID=$RANDOM
TIMESTAMP=`date +"%D %r"`
echo "$TIMESTAMP - $JOBID: [ **** Start: $TITLE **** ]" >> $LOGDIR/rtv2zen.log 2>&1
if [[ "$EDIT" = "yes" ]]
then
if [ -e "$EVTFILE" ]
then
echo "$TIMESTAMP - $JOBID: Edit RTV File">> $LOGDIR/rtv2zen.log 2>&1
$EVTDUMP "$EVTFILE" | $RTVEDIT >> $LOGDIR/rtv2zen.log 2>&1
set SOURCE=${FULLPATH/".mpg"/}1.mpg
else
echo Event file "$EVTFILE" could not be found. Skipping RTVEDIT step.
EDIT=no
fi
fi
TIMESTAMP=`date +"%D %r"`
if [[ "$TWOPASS" = "yes" ]]
then
echo "$TIMESTAMP - $JOBID: Transcoding RTV File to $QUALITY quality AVI with two-pass encoding" >> $LOGDIR/rtv2zen.log 2>&1
#pass 1 of 2
echo "$TIMESTAMP - $JOBID: Starting pass 1 of 2..." >> $LOGDIR/rtv2zen.log 2>&1
$FFMPEG -y -i "$SOURCE" -title "$TITLE" -vcodec mpeg4 -vtag XVID -s $VIDSIZE -b $VBITRATE -acodec mp3 -ab $ABITRATE -pass 1 -passlogfile $LOGDIR/2pass$JOBID -f avi "$ZENVIDEOS/$TITLE.AVI"
#pass 2 of 2
TIMESTAMP=`date +"%D %r"`
echo "$TIMESTAMP - $JOBID: Starting pass 2 of 2..." >> $LOGDIR/rtv2zen.log 2>&1
$FFMPEG -y -i "$SOURCE" -title "$TITLE" -vcodec mpeg4 -vtag XVID -s $VIDSIZE -b $VBITRATE -acodec mp3 -ab $ABITRATE -pass 2 -passlogfile $LOGDIR/2pass$JOBID -f avi "$ZENVIDEOS/$TITLE.AVI"
else
echo "$TIMESTAMP - $JOBID: Transcoding RTV File to $QUALITY quality AVI with single pass encoding" >> $LOGDIR/rtv2zen.log 2>&1
#single pass
$FFMPEG -y -i "$SOURCE" -title "$TITLE" -vcodec mpeg4 -vtag XVID -s $VIDSIZE -b $VBITRATE -acodec mp3 -ab $ABITRATE -f avi "$ZENVIDEOS/$TITLE.AVI"
fi
TIMESTAMP=`date +"%D %r"`
echo "$TIMESTAMP - $JOBID: Transcoding RTV File to AVI - Complete" >> $LOGDIR/rtv2zen.log 2>&1
if [[ "$UPLOADRESULT" = "yes" ]]
then
WPUTPARAM=
if [[ "$DELETERESULT" = "yes" ]]
then
WPUTPARAM=-R
fi
echo "$TIMESTAMP - $JOBID: Uploading AVI file to host..." >> $LOGDIR/rtv2zen.log 2>&1
echo "$WPUT $WPUTPARAM \"$ZENVIDEOS/$TITLE.AVI\" \"$FTPURL/$TITLE.AVI\"" >> $LOGDIR/rtv2zen.log 2>&1
$WPUT $WPUTPARAM "$ZENVIDEOS/$TITLE.AVI" "$FTPURL/$TITLE.AVI"
TIMESTAMP=`date +"%D %r"`
echo "$TIMESTAMP - $JOBID: Upload complete." >> $LOGDIR/rtv2zen.log 2>&1
fi
if [[ "$TWOPASS" = "yes" ]]
then
rm $LOGDIR/2pass$JOBID*.log
fi
if [[ "$EDIT" = "yes" ]]
then
if [ -e "${FULLPATH/".mpg"/}1.evt" ]
then
rm "${FULLPATH/".mpg"/}1.evt"
fi
if [ -e "${FULLPATH/".mpg"/}1.ndx" ]
then
rm "${FULLPATH/".mpg"/}1.ndx"
fi
if [ -e "${FULLPATH/".mpg"/}1.mpg" ]
then
rm "${FULLPATH/".mpg"/}1.mpg"
fi
fi
echo "$TIMESTAMP - $JOBID: [ **** Finish: $TITLE **** ]" >> $LOGDIR/rtv2zen.log 2>&1
Any chance we could get a step by step on this process for a Windows Zen newbie? I love this device. I'm a little older and probably not as quick but would enjoy this feature! Thanks to all for posting any information to help us catch up!
famewolf
04-12-06, 10:22 PM
[QUOTE=govt]Any chance we could get a step by step on this process for a Windows Zen newbie? I love this device. I'm a little older and probably not as quick but would enjoy this feature! Thanks to all for posting any information to help us catch up![/QUOTE]
1) Download the zip which contains the bat file and the programs it calls..unzip to a dir.
2) Install dvarchive and configure it so you can download shows from your replaytv to your pc.
3) Under download properties in dvarchive you can tell it to execute the bat file on the mpg it just finished downloading which will convert it and/or edit out commercials.
4) Use your creative zen software to load everything in the zen_video folder.
Works perfect! Exactly what I was looking for. Thanks RFontenot and famewolf!
This makes the Zen a very powerful DVP.
Looks like from the post above, I can run this script on videos which I already have on my computer?
If so, could you give some guidance on what I will need to do to accomplish this?
vBulletin v3.0.6, Copyright ©2000-2010, Jelsoft Enterprises Ltd.