stevehiner
New member
This is something I've wanted to do for years and I finally took a bit of time and wrote it...
I've found that my tuners will sometimes write out invalid files. The are the right size and contain all the right data but the timecodes will be off. That totally screws up BeyondTV of course. I normally manually open VRD and run QSF on the file to fix it and then BeyondTV is happy. That's no good when my kids complain about a video being messed up and now I've gotta take some time to fix the file.
Enter QuickStreamFix.cmd
_____________________________________________________________________________________
@echo off
SETLOCAL ENABLEEXTENSIONS
rem Script to QuickstreamFix file passed in first arg. For use with BeyondTV's archive feature.
set file=%1
for %%i in (%file%) do if "%%~xi" == ".wmv" GOTO Unsupported
for %%i in (%file%) do if "%%~xi" == ".mp4" GOTO Unsupported
for %%i in (%file%) do if "%%~xi" == ".avi" GOTO Unsupported
for %%i in (%file%) do if not exist "%%~dpi%%~ni.q%%~xi" @echo "%%~dpi%%~ni%%~xi" "%%~dpi%%~ni.q%%~xi" /t1
for %%i in (%file%) do if exist "%%~dpi%%~ni%%~xi.chapters.xml" @echo "%%~dpi%%~ni.q%%~xi.chapters.xml"
for %%i in (%file%) do if not exist "%%~dpi%%~ni.q%%~xi" cscript //nologo "C:\Program Files (x86)\VideoReDoTVSuite\vp.vbs" "%%~dpi%%~ni%%~xi" "%%~dpi%%~ni.q%%~xi" /t1
for %%i in (%file%) do if exist "%%~dpi%%~ni%%~xi.chapters.xml" copy /Y "%%~dpi%%~ni%%~xi.chapters.xml" "%%~dpi%%~ni.q%%~xi.chapters.xml"
Pause
Exit
:Unsupported
@echo Unsupported file type
Pause
Exit
__________________________________________________________________________________
You put this in a .cmd file in your videoredo folder and then open BeyondTV's web admin interface and in the settings under miscellaneous settings you'll find the Archive command. Set it to the path to the cmd file. Now when you look at the details for a video in the UI there will be a new entry called Archive. When you use that BeyondTV will run this cmd file and pass the path to the video file. The cmd file will start VRD and have it QuickStream Fix the file to a new file, adding ".q" to the name so video.mpg will become video.q.mpg. It will also check for BeyondTV's chapter file and make a copy of it for the fixed version so you won't lose your smartskip data. It's possible that we don't want the smartskip data since, in my experience, if the file needs to be fixed by VRD then the commercials in the smartskip data are likely totally wrong.
I'm certainly open to ideas and improvements for this cmd file.
I made it so it rejects common BeyondTV files that VRD doesn't support (well, my version of VRD anyway). It will reject wmv, mp4 and avi files. (I'm overdue for paying to upgrade to get mp4 support)
One thing I'd need to do is improve handling of .tp files. Many of my recordings are .tp and I've noticed that VRD UI doesn't have .tp as an output type but uses .ts instead. This batch file doesn't change the extension and VRD seems to be happy enough saving it as a .tp file but it appears that BTV thinks the resulting tp file is corrupt. I suppose I'll need to make the batch file smart enough to set the output to .ts instead of just reusing the .tp extension. That will make it a fair bit more complicated so I'll save that for another time. Hopefully that will fix the output file for BTV as well.
Note that you'll need to set the correct path to the vp.vbs file in this script. In my next version I'll probably make it smart enough so it'll use the script in the same folder as the cmd file but for now it's hard coded.
Also, because this is the first version I wrote I put a Pause in there so you can see what it is doing. Remove the Pause before the exit if you trust that it does it right every time. You should be able to hit one of the number buttons on the remote to clear the pause without having to grab a keyboard.
What do you think?
I've found that my tuners will sometimes write out invalid files. The are the right size and contain all the right data but the timecodes will be off. That totally screws up BeyondTV of course. I normally manually open VRD and run QSF on the file to fix it and then BeyondTV is happy. That's no good when my kids complain about a video being messed up and now I've gotta take some time to fix the file.
Enter QuickStreamFix.cmd
_____________________________________________________________________________________
@echo off
SETLOCAL ENABLEEXTENSIONS
rem Script to QuickstreamFix file passed in first arg. For use with BeyondTV's archive feature.
set file=%1
for %%i in (%file%) do if "%%~xi" == ".wmv" GOTO Unsupported
for %%i in (%file%) do if "%%~xi" == ".mp4" GOTO Unsupported
for %%i in (%file%) do if "%%~xi" == ".avi" GOTO Unsupported
for %%i in (%file%) do if not exist "%%~dpi%%~ni.q%%~xi" @echo "%%~dpi%%~ni%%~xi" "%%~dpi%%~ni.q%%~xi" /t1
for %%i in (%file%) do if exist "%%~dpi%%~ni%%~xi.chapters.xml" @echo "%%~dpi%%~ni.q%%~xi.chapters.xml"
for %%i in (%file%) do if not exist "%%~dpi%%~ni.q%%~xi" cscript //nologo "C:\Program Files (x86)\VideoReDoTVSuite\vp.vbs" "%%~dpi%%~ni%%~xi" "%%~dpi%%~ni.q%%~xi" /t1
for %%i in (%file%) do if exist "%%~dpi%%~ni%%~xi.chapters.xml" copy /Y "%%~dpi%%~ni%%~xi.chapters.xml" "%%~dpi%%~ni.q%%~xi.chapters.xml"
Pause
Exit
:Unsupported
@echo Unsupported file type
Pause
Exit
__________________________________________________________________________________
You put this in a .cmd file in your videoredo folder and then open BeyondTV's web admin interface and in the settings under miscellaneous settings you'll find the Archive command. Set it to the path to the cmd file. Now when you look at the details for a video in the UI there will be a new entry called Archive. When you use that BeyondTV will run this cmd file and pass the path to the video file. The cmd file will start VRD and have it QuickStream Fix the file to a new file, adding ".q" to the name so video.mpg will become video.q.mpg. It will also check for BeyondTV's chapter file and make a copy of it for the fixed version so you won't lose your smartskip data. It's possible that we don't want the smartskip data since, in my experience, if the file needs to be fixed by VRD then the commercials in the smartskip data are likely totally wrong.
I'm certainly open to ideas and improvements for this cmd file.
I made it so it rejects common BeyondTV files that VRD doesn't support (well, my version of VRD anyway). It will reject wmv, mp4 and avi files. (I'm overdue for paying to upgrade to get mp4 support)
One thing I'd need to do is improve handling of .tp files. Many of my recordings are .tp and I've noticed that VRD UI doesn't have .tp as an output type but uses .ts instead. This batch file doesn't change the extension and VRD seems to be happy enough saving it as a .tp file but it appears that BTV thinks the resulting tp file is corrupt. I suppose I'll need to make the batch file smart enough to set the output to .ts instead of just reusing the .tp extension. That will make it a fair bit more complicated so I'll save that for another time. Hopefully that will fix the output file for BTV as well.
Note that you'll need to set the correct path to the vp.vbs file in this script. In my next version I'll probably make it smart enough so it'll use the script in the same folder as the cmd file but for now it's hard coded.
Also, because this is the first version I wrote I put a Pause in there so you can see what it is doing. Remove the Pause before the exit if you trust that it does it right every time. You should be able to hit one of the number buttons on the remote to clear the pause without having to grab a keyboard.
What do you think?