Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support


Go Back   Australian Media Center Community > Windows 7 Media Center > Windows 7: Media Center & OS

Community Information

Help to write a batch file to convert recorded TV to DVR-MS
this thread has 20 replies and has been viewed 6240 times
Reply
 
Thread Tools
Old 2nd April 2009, 05:03 PM   #1 (permalink)
MC Mentor
 
aanda6's Avatar
Status aanda6 is Offline:
Location Berwick
ActivityPosts: 747
Reputation & Thanks Support Rating:
aanda6 aanda6 aanda6
Points Earned: 268

aanda6 has been thanked 89 times in 64 posts
aanda6's
Media Center
Help to write a batch file to convert recorded TV to DVR-MS

As Windows 7 build 7048 and above now include a built in convertor to convert .wtv to .dvr-ms I want to run a batch file that scans my recorded tv folder and automatically runs this file then deletes the original so I can then use life extender to remove commercials.

My questions are:
Is this scenario possible?
is it too difficult to bother?
Can anyone offer advice on how to do this?
  Reply With Quote


Old 2nd April 2009, 09:56 PM   #2 (permalink)

 
dgaust's Avatar
Status dgaust is Online:
Location Wollongong, NSW
ActivityPosts: 5,476
Reputation & Thanks Support Rating:
dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust
Points Earned: 2327

dgaust has been thanked 988 times in 846 posts
dgaust's
Media Center
Re: Help to write a batch file to convert recorded TV to DVR-MS

Try this



Haven't tested it myself because I don't have WTV Converter on my machine, but it should work (if not it'll create a log file in the directory it's installed in).

Just start it, it'll start minimised in the tray - double click to open, select the recorded tv folder and do a test. It should wait for a recording to finish and then attempt to convert.

I wouldn't use the delete function on anything important just yet.
__________________
"How's the serenity"
  Reply With Quote


1 out of 1 members found this post helpful....
The following Member(s) said "Thank You!" to dgaust for this information:
Old 6th April 2009, 12:42 AM   #3 (permalink)
Newbie
 
Biffa001's Avatar
Status Biffa001 is Offline:
ActivityPosts: 6
Reputation & Thanks Support Rating:
Biffa001
Points Earned: 10

Biffa001 has been thanked 0 times in 0 posts
Re: Help to write a batch file to convert recorded TV to DVR-MS

does this work on VMC? Looks just like what I need!
  Reply With Quote


Old 6th April 2009, 03:51 AM   #4 (permalink)
 
Astrotoy7's Avatar
Status Astrotoy7 is Offline:
ActivityPosts: 4,605
Reputation & Thanks Support Rating:
Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7
Points Earned: 1477

Astrotoy7 has been thanked 582 times in 408 posts
Astrotoy7's
Media Center
Re: Help to write a batch file to convert recorded TV to DVR-MS

Quote:
Originally Posted by Biffa001 View Post
does this work on VMC? Looks just like what I need!
Try it and find out! I dont have any wtv recordings on my Fiji rig to try it on atm

Astro
__________________
*Found a response helpful? Please use the "thanks" button :)
*Guide: Creating Custom Themes in Media Center
*Guide: VistaMC TV Pack 'Fiji': Useful Info for Oz Users

"To generalise is to be an idiot." -William Blake
*
"Ignorance is the root and stem of all evil." -Plato
  Reply With Quote


Old 6th April 2009, 11:33 AM   #5 (permalink)

 
dgaust's Avatar
Status dgaust is Online:
Location Wollongong, NSW
ActivityPosts: 5,476
Reputation & Thanks Support Rating:
dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust
Points Earned: 2327

dgaust has been thanked 988 times in 846 posts
dgaust's
Media Center
Re: Help to write a batch file to convert recorded TV to DVR-MS

No it won't. It is just a small file watcher application that triggers the WTVCovnverter.exe file that's included in the later builds of Win7.

If you don't have that exe, it won't do anything.
__________________
"How's the serenity"
  Reply With Quote


Old 25th April 2009, 03:56 AM   #6 (permalink)
Newbie
 
RandiR's Avatar
Status RandiR is Offline:
ActivityPosts: 2
Reputation & Thanks Support Rating:
RandiR
Points Earned: 12

RandiR has been thanked 2 times in 1 posts
Re: Help to write a batch file to convert recorded TV to DVR-MS

Quote:
As Windows 7 build 7048 and above now include a built in convertor to convert .wtv to .dvr-ms I want to run a batch file that scams my recorded tv folder and automatically runs this file then deletes the original so I can then use life extender to remove commercials.

My questions are:
Is this scenario possible?
is it too difficult to bother?
Can anyone offer advice on how to do this?
It is quite possible and easy if you have a command line conversion utility. I have seen some reference to todvrms on this website. So, I will use that utility in this example.

Here is what you do.

1. Copy and paste the following script to file C:\scripts\Convert.txt .
Code:
# CONVERSION SCRIPT
# Change directory to "recorded tv folder" (ENTER THE CORRECT FOLDER PATH BELOW.)
ccd "recorded tv folder"
# Collect a list of recorded tv files
var str filelist ; lf -rn "*.wtv" > $filelist
# Convert one file at a time
while ($filelist <> "")
do
    var str file ; lex "1" $filelist > $file
    var str converted_file ; stex -c -p "]^.wtv^l" $file > $converted_file
    set $converted_file = $converted_file + ".dvr-ms"
    # The name of the output file is now in $converted_file.
    # It is the same name as input file, except .wtv is replaced wtih .dvr-ms.
    # Convert file
    system "todvrms.exe" ("\""+$file+"\"") ("\""+$converted_file+"\"")
    # Delete original file
    system del ("\""+$file+"\"")
done
2. (If you don't already have biterscripting) Install biterscripting free. Follow instructions at http://www.biterscripting.com/install.html .

3. Start biterscripting and enter the following command.

Code:
script "/Scripts/Convert.txt"
4. That would do it.

Randi

Last edited by RandiR; 25th April 2009 at 05:49 AM..
  Reply With Quote


2 out of 2 members found this post helpful....
The Following 2 Users Say Thank You to RandiR For This Useful Post:
Old 26th April 2009, 02:19 AM   #7 (permalink)
 
Astrotoy7's Avatar
Status Astrotoy7 is Offline:
ActivityPosts: 4,605
Reputation & Thanks Support Rating:
Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7
Points Earned: 1477

Astrotoy7 has been thanked 582 times in 408 posts
Astrotoy7's
Media Center
Re: Help to write a batch file to convert recorded TV to DVR-MS

It would be nice if MS/Someone could import that inbuilt wtv converter to vista

Astro
__________________
*Found a response helpful? Please use the "thanks" button :)
*Guide: Creating Custom Themes in Media Center
*Guide: VistaMC TV Pack 'Fiji': Useful Info for Oz Users

"To generalise is to be an idiot." -William Blake
*
"Ignorance is the root and stem of all evil." -Plato
  Reply With Quote


Old 4th May 2009, 03:26 AM   #8 (permalink)
Newbie
 
jrwalte's Avatar
Status jrwalte is Offline:
ActivityPosts: 1
Reputation & Thanks Support Rating:
jrwalte
Points Earned: 10

jrwalte has been thanked 0 times in 0 posts
Re: Help to write a batch file to convert recorded TV to DVR-MS

Thanks for that script, RandiR.

I was able to use it to convert my 50+ WTV files because I want to go back to non- TV Pack (stopped using QAM).

Suggestions to others:

1) ccd "recorded tv folder"

If your recorded tv folder is on another hard drive, use this syntax:
ccd "f:/recorded tv"

the ccd function requires a "/" instead of the usual "\".

Also be sure the todvrms.exe is in your recorded tv folder.

2) I would suggest removing the line that deletes the original .WTV file. todvrms is not a 'solid' program and it will fail often on a conversion and then you'll have lost the original WTV file. You're better off manually deleting the .WTV files.

or if you create a while statement that will only delete the WTV file if the file size of the dvr-ms is greater than 1MB, that would work. If the conversion fails, the dvr-ms file has always been under 1 MB for me.

3) To add meta data and make the conversion more stable, change the todvrms syntax line:

system "todvrms.exe" ("\""+$file+"\"") ("\""+$converted_file+"\"") "-m -v"
  Reply With Quote


Old 4th May 2009, 09:59 AM   #9 (permalink)
Newbie
 
RandiR's Avatar
Status RandiR is Offline:
ActivityPosts: 2
Reputation & Thanks Support Rating:
RandiR
Points Earned: 12

RandiR has been thanked 2 times in 1 posts
Suggestions for the todvrms script

jrwalte:

You are welcome. Thanks for the suggestions. All are excellent.

Quote:
If the conversion fails, the dvr-ms file has always been under 1 MB for me.
One can use the af command to check the size of the converted file. The delete portion of the script can be changed as follows. Perhaps, instead of a fixed 1MB number, a number based on the size of the original file can be used ?

Code:
# Delete original file, but only if the converted file has at least 1MB bytes.
# Below 1 MB would indicate that the conversion failed.
af $converted_file
if ($fsize < 1000000)
    echo "Conversion failed for file " $file
else
    system del ("\""+$file+"\"")
endif
Please do post your better script - I think you have made several other changes. I think that a lot of readers can benefit.

Randi
  Reply With Quote


Old 4th May 2009, 06:04 PM   #10 (permalink)
 
Astrotoy7's Avatar
Status Astrotoy7 is Offline:
ActivityPosts: 4,605
Reputation & Thanks Support Rating:
Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7 Astrotoy7
Points Earned: 1477

Astrotoy7 has been thanked 582 times in 408 posts
Astrotoy7's
Media Center
Re: Suggestions for the todvrms script

Just a FYI. The latest videoredo beta apparent allows you to quickstream fix WTV to dvrms. I havent used it yet, so cant comment on its effectiveness ...

Re- WTV Conversion Conclusions:
After a few days of searching, fiddling and contemplation - I have tried everything, dvrmstb, mce buddy, videoredo beta... sure it can 'sorta work' ....but all CLUNKY and or cumbersome with oft dubious results. I hate that. I hate scripts even more

I have found this the most easy WTV>DVRMS conversion option from within an XP or vista pc >>> Im sure there might be a few who find this useful
1. Run a virtual W7 from your xp/vista whetaver desktop. (Im using MS virtual PC, VMware is nice but too bloated for such a simple use IMO)
2. Make sure the location where WTVs are stored are networked so you can access them from your virtual rig
3. Use W7s inbuilt dvrms converter(accesible from R click menu) >> Thats it!!

Now I have all those accumulating WTVs ready to accumulate as DVRMS until I can be arsed trimming and encoding them

Works as fast as your CPU/Allocated RAM to the virtual rig allows. Ive got 1.5GB to my virtual W7 and converting took same time as it did in a native win7 install environment. Good ole virtualistion eh I'll be happy to abandon this method once video redo etc are smooth an steady with WTVs

Astro
__________________
*Found a response helpful? Please use the "thanks" button :)
*Guide: Creating Custom Themes in Media Center
*Guide: VistaMC TV Pack 'Fiji': Useful Info for Oz Users

"To generalise is to be an idiot." -William Blake
*
"Ignorance is the root and stem of all evil." -Plato

Last edited by Astrotoy7; 5th May 2009 at 06:18 AM..
  Reply With Quote


Old 31st July 2009, 05:02 PM   #11 (permalink)
MC Graduate
 
aceman's Avatar
Status aceman is Offline:
Location Adelaide
ActivityPosts: 65
Reputation & Thanks Support Rating:
aceman
Points Earned: 25

aceman has been thanked 7 times in 5 posts
Re: Help to write a batch file to convert recorded TV to DVR-MS

Excuse my ignorance but I have a growing list of .wtv files from W7 Media Center and I cannot seem to find the built-in dvrms converter to be able to convert them in VideoReDo. When I right-click on the wtv file there is no option to convert to dvr-ms.

Can anyone help?
  Reply With Quote


Old 31st July 2009, 05:10 PM   #12 (permalink)

 
dgaust's Avatar
Status dgaust is Online:
Location Wollongong, NSW
ActivityPosts: 5,476
Reputation & Thanks Support Rating:
dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust dgaust
Points Earned: 2327

dgaust has been thanked 988 times in 846 posts
dgaust's
Media Center
Re: Help to write a batch file to convert recorded TV to DVR-MS

Right click on the file and there should be the option "Convert to DVR-MS". Apparently it will only appear if the wtv files are associated to open in Windows Media Centre.
__________________
"How's the serenity"
  Reply With Quote


The following Member(s) said "Thank You!" to dgaust for this information:
Reply

Bookmarks

Thread Tools



Advertisers








Terms Of Service - Contact Us - Advertise With Us - Archive - Privacy Policy - FAQ
Microsoft©, Windows 7©, Windows Vista© & Windows XP© are registered trademarks of Microsoft Corporation.
www.xpmediacentre.com.au has no relationship with, nor is affiliated in any way with Microsoft Corporation.
All original content on this website © 2004 - 2010 xpmediacentre.com.au, All rights reserved
Forum by vBulletin Version 3.8.3 - Copyright Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
Local time now is 04:46 AM AEDT.

Add to Google