As you may recall from the Media Player hardware review, the Linksys 1600 does not recognise the .M4V file suffix. This suffix is used by CNN amongst others. In order to make these files play the suffix needs to be changed to .MP4. The files then play without any further problem so the underlying file format is obviously the same.
As Nomad suffers from terminal laziness the task of doing this manually did not appeal. Clearly a batch file was needed for the job. In fact a batch file has been running for some weeks which copies files for the 3 CNN feeds. Could this be modified to scan through all the Miro feeds and copy any files as neccessary? The problem occupied much of Nomads Sunday. DOS Batch files are a highly frustrating medium; you think you are about to solve the problem and then you discover you are back at the start. Bearing in mind that Sunday was a particularily pleasant and sunny day, it is clear that Nomad needs to develop other interests and generally get a life.
Anyway, lets get on with it. There are 2 batch files needed. The first file, named "xSuffix.bat", scans through the sub-directories in the Miro folder. Each sub-directory corresponds to a Miro feed. The first file then calls the second file named "ySuffix.bat" and supplies the sub-directory name. The second file moves to the sub-directory and copies any .M4V files to a .MP4 file. Obviously it would be faster to rename the existing file instead of creating a copy; however Miro would then lose track of what it had.
To fully automate the task you need to go to the Control Panel in Windows and create a Scheduled Task that runs every 15 minutes lets say. This works fine but has the disconcerting effect that a new window pops up in the middle of what you are doing every time the task runs. To get rid of this create a shortcut to the "xSuffix.bat" file and in the shortcut properties select "minimized" (sic). Now change the scheduled task to call the shortcut instead of the batch file. Windows will 'helpfully' replace the shortcut with the referenced batch file if you try selection by "browse". You need to manually enter the full path and filename (including the .LNK suffix) for the shortcut. Now the process will run automatically and can be seen to momentarily appear in the task bar.
There are other things that could be automated. Deletion of out of date files would be very useful. For now I seem to have run out of enthusiasm, perhaps it could be a job for a rainy day.
xSuffix.bat:
@echo off
rem change suffix on mpeg-4 files for media player compatability
D:
cd "D:\My Videos\Miro\"
for /f "delims=" %%a IN ('dir /b /s /a:d') do call ySuffix.bat "%%a"
ySuffix.bat:
@echo off
cd "%1"
xcopy *.m4v *.mp4 /D /Y
cd..
Tuesday, 28 April 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment