01-02-2016, 05:24 AM | #1 |
Human being with feelings
Join Date: Jun 2009
Location: Praha, Czech republic
Posts: 595
|
Timecode Overlay video FX
Hi,
for first time I played little bit with v5 video processor, while thinking about some useful feature for me. I came with small modification of included title overlay preset for timecode (HH:MM:SS:Frame) insertion. Default knob values should be at reasonable start point, but you can tweak it, as you need. AFAIK besides basic things, there isn't much other variables available to video processor, so if you use for example project start offset, it has to be set manually using video FX parameters, but you can offset it, how you like. Also it doesn't support drop frame timecode. It can be maybe also useful for you, for example if you have maximized video window at another screen and it is on top of other windows or when you have another working units at your project (like bars,beats) and still like to watch timecode sometimes. Also sometimes, there is delivered video with burned timecode, but it is very small or unreadable, so you can place timecode with better readability over it. Just insert video processor with that preset either as a item fx, track or master fx. Code:
// Timecode overlay font="Arial"; //@param1:size 'text height' 0.1 0.01 0.5 0.25 0.01 //@param2:ypos 'y position' 0.90 0 1 0.5 0.01 //@param3:xpos 'x position' 0.5 0 1 0.5 0.01 //@param4:border 'border' 0.03 0 1 0.5 0.01 //@param5:fgc 'text bright' 1.0 0 1 0.5 0.01 //@param6:fga 'text alpha' 1.0 0 1 0.5 0.01 //@param7:bgc 'bg bright' 0 0 1 0.5 0.01 //@param8:bga 'bg alpha' 0.5 0 1 0.5 0.01 //@param9:h_off 'hours offset' 0 -23 23 0 1 //@param10:m_off 'minutes offset' 0 -59 59 0 1 //@param11:s_off 'seconds offset' 0 -59 59 0 1 //@param12:f_off 'frames offset' 0 -29 29 0 1 offset = 3600*h_off + 60*m_off + s_off + f_off/framerate; time_value = time / (ceil(framerate)/framerate) + offset; hours = time_value/3600; minutes = (time_value / 60) % 60; seconds = time_value % 60; frames = (time_value - floor(time_value))*framerate; #timecode = sprintf(#, "%02d:", hours); #timecode += sprintf(#, "%02d:", minutes); #timecode += sprintf(#, "%02d:", seconds); #timecode += sprintf(#, "%02d", frames); // #timecode += sprintf(#, " %.3f s", time); // abs. time // #timecode += sprintf(#, "%10d f", (time*framerate)); // abs. frames gfx_blit(0,1); gfx_setfont(size*project_h,font,'B'); gfx_str_measure(#timecode,txtw,txth); yt = (project_h- txth*(1+border*2))*ypos; gfx_set(bgc,bgc,bgc,bga); gfx_fillrect(xpos * (project_w-txtw*(1+border*2)), yt, txtw*(1+border*2), txth*(1+border*2)); gfx_set(fgc,fgc,fgc,fga); gfx_str_draw(#timecode,xpos * (project_w-txtw),yt+txth*border); Michal Update 1: Improved handling of non-whole number framerates (23.976, 59.54 etc.)
__________________
FRs: Better FX bypass Last edited by msmucr; 06-05-2016 at 02:30 AM. Reason: updated version for NTSC timecodes |
Thread Tools | |
Display Modes | |
|
|