Reaper視頻文件添加時間軸腳本
貼個筆記,日后方便查找

以下是腳本

// 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);