I can't get to work.
I have Excel 2002. Start it up, get a new workbook. Alt+F11 to get the VB screen. Click on Sheet1 in the LHS menu. Menu-View->Code (or F7). Paste above code into editor...
Code:
Public Sub trimTS()
Dim junk(3) As Byte, a(187) As Byte
Const sync_byte As Byte = &H47
Dim fni, fno
fni = "N:\" + "wag.ts"
fno = "N:\" + "wagpro.ts"
Open fni For Binary Access Read As #1
Open fno For Binary Access Write As #2
Get #1, , junk
Get #1, , a
While a(0) = sync_byte
Put #2, , a
Get #1, , junk
Get #1, , a
Wend
Close
End Sub
Note the file changes (for the location of my .ts file)...
Press > (or Menu->Run->Run Sub/UserForm or F5). Two files are produced, wag and wagpro.ts of zero size!
Tried this again on another SD recording - same result... What's wrong?
EDIT: I used Graham's modification above for fni and fno, and the code seem to work...
Here are the results:
I tried this on Wallace and Gromit (BBC HD) recording of 3.6GB and it produced a 34.2MB file! I tried it on Talk To Her (SD) recording of 2.46GB and it produced a 1.95GB file.
The processed Wallace and Gromit video file played up to the point where it freezes (HD protection kicks in)... and Talk To Her is as choppy as the original recording played on my Vista machine on the MPC I got working yesterday...
Conclusion:
The VB code does BUGGER ALL!



(I think mwardy is asking a good question below!)