Convert video timecode from text to frames


/ Published in: Other
Save to your folder(s)

Takes a video timecode (a) in text format "00:00:00:00" and converts it to frames, using the supplied framerate (b). Mainly for use in OpenOffice Calc.


Copy this code and paste it in your HTML
  1. Function TCTOFRAMES(a,b)
  2.  
  3. Dim HrsString as String
  4. Dim HrsInt as Integer
  5. Dim HrsConvToFrames as Long
  6.  
  7. HrsString = left(a,2)
  8. HrsInt = HrsString
  9. HrsConvToFrames = HrsInt*60*60*b
  10.  
  11. Dim MinsString as String
  12. Dim MinsInt as Integer
  13. Dim MinsConvToFrames as Integer
  14.  
  15. MinsString = Mid(a,4,2)
  16. MinsInt = MinsString
  17. MinsConvToFrames = MinsInt*60*b
  18.  
  19. Dim SecsString as String
  20. Dim SecsInt as Integer
  21. Dim SecsConvToFrames as Integer
  22.  
  23. SecsString = Mid(a,7,2)
  24. SecsInt = SecsString
  25. SecsConvToFrames = SecsInt*b
  26.  
  27. Dim FramesString as String
  28. Dim FramesInt as Integer
  29.  
  30. FramesString = right(a,2)
  31. FramesInt = FramesString
  32.  
  33. TCTOFRAMES = HrsConvToFrames+MinsConvToFrames+SecsConvToFrames+FramesInt
  34.  
  35. End Function

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.