将帧(作为整数)转换为格式正确的视频时间码
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了将帧(作为整数)转换为格式正确的视频时间码相关的知识,希望对你有一定的参考价值。
Takes an integer value of frames (a) and converts it to a text formatted timecode "00:00:00:00" using the supplied framerate (b). Mainly for use in OpenOffice Calc.
Function FRAMESTOTC(a,b) Dim HrsStr, MinsStr, SecsStr, FramesStr as String Dim HrsFinalStr, MinsFinalStr, SecsFinalStr, FramesFinalStr as String Dim MinsInt, SecsInt, FramesInt as Integer Dim HrsInt as Long FramesInt = a mod b FramesStr = FramesInt If Len(FramesStr) = 1 Then FramesFinalStr = "0" & FramesStr Else FramesFinalStr = FramesStr End If SecsInt = ((a-FramesInt)/b) mod 60 SecsStr = SecsInt If Len(SecsStr) = 1 Then SecsFinalStr = "0" & SecsStr Else SecsFinalStr = SecsStr End If MinsInt = ((a-SecsInt*b-FramesInt)/(60*b)) mod 60 MinsStr = MinsInt If Len(MinsStr) = 1 Then MinsFinalStr = "0" & MinsStr Else MinsFinalStr = MinsStr End If HrsInt = ((a-MinsInt*b*60-SecsInt*b-FramesInt))/(60*60*b) mod 60 HrsStr = HrsInt If Len(HrsStr) = 1 Then HrsFinalStr = "0" & HrsStr Else HrsFinalStr = HrsStr End If FRAMESTOTC = HrsFinalStr & ":" & MinsFinalStr & ":" & SecsFinalStr & ":" & FramesFinalStr End Function
以上是关于将帧(作为整数)转换为格式正确的视频时间码的主要内容,如果未能解决你的问题,请参考以下文章