Работа с видео в Reaper (1 онлайн

Antonio

Well-Known Member
9 Ноя 2003
4.343
1.558
113
48
Алматы
но когда я вращаю текст, то вместе с ним фоновая картинка...
Попробуйте этот плагин
JT: Essential Video Controls - resize, position, crop, and change opacity
поставить первым в цепочке перед вращением.


Небольшой совет для начинающих "риперовидеомонтажеров" :). В большенстве случаев эффекты удобнее кидать на айтемы, а не на дорожки, так очень удобно удачную цепочку эффектов копировать на те айтемы, на которых нужна такая же цепочка и тогда меньше возни с автоматизацией.
 
Последнее редактирование:
20 Янв 2018
205
108
43
43
Попробуйте этот плагин

поставить первым в цепочке перед вращением.


Небольшой совет для начинающих "риперовидеомонтажеров" :). В большенстве случаев эффекты удобнее кидать на айтемы, а не на дорожки, так очень удобно удачную цепочку эффектов копировать на те айтемы, на которых нужна такая же цепочка и тогда меньше возни с автоматизацией.
К сожалению не помогло... Фон всё равно вращается.
 

Antonio

Well-Known Member
9 Ноя 2003
4.343
1.558
113
48
Алматы
@Вадим Морозов-Калужский,

Сейчас попробовал, тоже не получается. Не значит, что не возможно, но сходу не получилось. Может все таки в Давинчи? :) Там это все базовые функции, без плагинов делается. :) В бесплатной версии.
 
Последнее редактирование:
20 Янв 2018
205
108
43
43
Я согласен с вами, очень на любителя, но хочется выжать из неё все соки))) Кто-то головоломки разгадывает, кто-то игры проходит, а я Рипер, в частности видео монтаж. Интересно себя проверить, когда средств ограниченное кол-во - мозг сразу начинает работать))
Я подумал, что переворот текста надо как-то впилить в базовый пресет текста. Он же там двигается и по горизонтали и по вертикали, значит Rotate можно прописать туда же, по идее. Я не владею программированием, но может среди вас есть такой человек, как мне кажется, это не сложно. Просто вытащить этот Rotate из других пресетов и немного допилить. Может сейчас глупость сказал, ну да ладно)
 
  • Like
Реакции: Antonio

truemanofan

Active Member
2 Июн 2019
165
169
43
@Вадим Морозов-Калужский,
Посмотрите этот скрипт:
// Overlay: text w/adjustable ol/sh/rot/pos
// by papagirafe
// version 3.01, now includes rotation, relative positioning LMR TMB

// Write your own text inside quotes, multiple lines allowed inside quotes
// if empty, text = item/track name
#text="";

// default font = "Arial" in Windows
#style.font="";
/*
font styles from following list - upto 4 choices allowed - uppercase mandatory
'B' - Bold, 'I' - Italics, 'R' - smooth edges,
'V' - Invert bg/fg, 'U' - underlined
ugly "stock" shadow and outline styles still work if you insist on using them...
*/
style.style='';

// preset paramaters
//@param style.frs 'text height' 0.07 0.01 1.0 0.5 0.001
//@param hRef "x ref L/M/R" 0 -1 1 0 1
//@param vRef "y ref T/M/B" 0 -1 1 0 1
//@param tofx "x offset" 0 -1 1 0 0.001
//@param tofy "y offset" 0 -1 1 0 0.001
//@param rota rotation 0 -180 180 0 0.1
//@param style.fgr 'text r' 1 0 1 0.5 0.001
//@param style.fgg 'text g' 1 0 1 0.5 0.001
//@param style.fgb 'text b' 1 0 1 0.5 0.001
//@param style.fga 'text a' 1 -0.01 1 0.5 0.01
//@param style.bgw 'bg w' 0 0 1 1 0.001
//@param style.bgh 'bg h' -0.001 -0.001 1 0.5 0.001 negative? follow bg w!
//@param style.bgr 'bg r' 0 0 1 0.5 0.001
//@param style.bgg 'bg g' 0 0 1 0.5 0.001
//@param style.bgb 'bg b' 0 0 1 0.5 0.001
//@param style.bga 'bg a' 0.4 0 1 0.5 0.001
//@param style.olr 'outline r' 0 0 1 0.5 0.01
//@param style.olg 'outline g' 0 0 1 0.5 0.01
//@param style.olb 'outline b' 0 0 1 0.5 0.01
//@param style.ola 'outline a' 0.1 0.01 1 0.5 0.01
//@param style.olt 'outline thickness' 0 0 1 0.5 0.01
//@param style.shmode 'shadow mode' 0 0 1 0.5 1
//@param style.shangl 'shadow angle' 45 0 359 180 1

function gfx_img_alloc_alpha(w,h)
(
gfx_set(0,0,0,1,0,-1,0); // set black, transparent, clobber
gfx_img_alloc(w,h,1); // allocate and clear image with above settings
);

function xy2polar(x,y,r*,phi*)(r=sqrt(x^2+y^2);phi=2*atan(y/(x+r)));
function polar2xy(r,phi,x*,y*)(x=r*cos(phi);y=r*sin(phi));
function rotate_coord(x*,y*,rota)(xy2polar(x,y,this.r,this.phi);polar2xy(this.r,this.phi-rota,x,y));
//calc size of reactangle that can contain all text + its rotation
function calc_rot_img_size(sw,sh,dw*,dh*,rot)
local(xmax,ymax)
instance(x,y)
(
xmax=sw;ymax=sh;
//top left corner
x=-sw/2;y=-sh/2;rotate_coord(x,y,rot);
xmax<2*abs(x)?xmax=2*abs(x);
ymax<2*abs(y)?ymax=2*abs(y);
//top right corner
x=sw/2;y=-sh/2;rotate_coord(x,y,rot);
xmax<2*abs(x)?xmax=2*abs(x);ymax<2*abs(y)?ymax=2*abs(y);
dw=xmax;dh=ymax;
);

//set the rest of the environment
colorspace='RGBA';
oldiv=128;
rota=rota/180*$pi;
style.fga<0?style.fga=param_wet;
style.bga*=style.fga; //bg alpha dependent upon fg alpha
mode=0x10000|0x100; //use alpha & smoothing

//no text? get it from item name or track name
strlen(#text)==0 ? input_get_name(-1,#text);
// get current input stats and force output to that size
input_info(0,sw,sh); project_w=sw;project_h=sh;
//calculate text stats, fsize=pix height of font
gfx_setfont(fsize=style.frs*min(sw,sh),#style.font,style.style);
gfx_str_measure(#text,tw,th);

// calculate text background dimensions to parameters & outline/shadow extra space
style.bgw*=tw;
style.bgh=style.bgh<0?style.bgw:style.bgh*=th;
style.olt*=fsize/4; // outline pix thickness
tbw=tw+2*style.bgw+2*style.olt; //text bg pix width
tbh=th+2*style.bgh+2*style.olt; //text bg pix height

//calc temporary img size compensated for rotation: (iw,ih) new temporary img dim
calc_rot_img_size(tbw,tbh,iw,ih,rota);

//ok, it's time to render to temporary image
img=gfx_img_alloc_alpha(iw,ih);

//background if applicable
style.bga>0?(
gfx_set(style.bgr,style.bgg,style.bgb,style.bga,mode,img);
gfx_fillrect((iw-tbw)/2,(ih-tbh)/2,tbw,tbh);
);
// outline or shadow of applicable
style.olt>0?(
style.shmode?(style.ola=exp(style.ola*style.fga*4.5-4);style.shangl=style.shangl*oldiv/360):(style.ola=exp((oldiv/20)*style.ola*style.fga-5.7);style.shangl=0;);
gfx_set(style.olr,style.olg,style.olb,style.ola*style.fga,mode,img);
i=0; loop(style.shmode?oldiv/16:eek:ldiv,
phi=2*(i+style.shangl)*$pi/oldiv;
polar2xy(style.olt,phi,ox,oy);
gfx_str_draw(#text,(iw-tw)/2+ox,(ih-th)/2+oy);
i+=1;
);
);
// 'normal' text
gfx_set(style.fgr,style.fgg,style.fgb,style.fga,mode,img);
gfx_str_draw(#text,(iw-tw)/2,(ih-th)/2);

//final render
gfx_set(1,1,1,1,mode,-1,1);
gfx_blit(0,1);
//offset factor compensation according to alignement reference
tofx+=hRef*(sw-tbw)/(2*sw);
tofy+=vRef*(sh-tbh)/(2*sh);
//final position
rx=tofx*sw+sw/2-iw/2;
ry=tofy*sh+sh/2-ih/2;
//final blit + clean
gfx_rotoblit(img,rota,rx,ry,iw,ih);
gfx_img_free(img);
Довольно многофункциональный, такой себе Overlay: Text на стероидах и в нем как раз есть "text rotation independent of background" =)
Проверил - работает =)
overlay text rotation.gif
 

V_ad_im

Well-Known Member
1 Ноя 2006
2.699
2.276
113
48
Добрый день! с видео в Рипере обычно не связываюсь, потому как 1)у меня он на маке не открывает AVCHD файлы, даже при скаченных рекомендованных в начале топика MMPEG dlyb, 2)у него нет поддержки GPU - соответственно, рендерит медленнее чем видеоредакторы 3)на работе использую Vegas, а дома - давинчи. Но, вдруг первые два пункта уже исправились с апдейтами/костылями, а я просто не уследил?
 
20 Янв 2018
205
108
43
43
@Вадим Морозов-Калужский,
Посмотрите этот скрипт:
// Overlay: text w/adjustable ol/sh/rot/pos
// by papagirafe
// version 3.01, now includes rotation, relative positioning LMR TMB

// Write your own text inside quotes, multiple lines allowed inside quotes
// if empty, text = item/track name
#text="";

// default font = "Arial" in Windows
#style.font="";
/*
font styles from following list - upto 4 choices allowed - uppercase mandatory
'B' - Bold, 'I' - Italics, 'R' - smooth edges,
'V' - Invert bg/fg, 'U' - underlined
ugly "stock" shadow and outline styles still work if you insist on using them...
*/
style.style='';

// preset paramaters
//@param style.frs 'text height' 0.07 0.01 1.0 0.5 0.001
//@param hRef "x ref L/M/R" 0 -1 1 0 1
//@param vRef "y ref T/M/B" 0 -1 1 0 1
//@param tofx "x offset" 0 -1 1 0 0.001
//@param tofy "y offset" 0 -1 1 0 0.001
//@param rota rotation 0 -180 180 0 0.1
//@param style.fgr 'text r' 1 0 1 0.5 0.001
//@param style.fgg 'text g' 1 0 1 0.5 0.001
//@param style.fgb 'text b' 1 0 1 0.5 0.001
//@param style.fga 'text a' 1 -0.01 1 0.5 0.01
//@param style.bgw 'bg w' 0 0 1 1 0.001
//@param style.bgh 'bg h' -0.001 -0.001 1 0.5 0.001 negative? follow bg w!
//@param style.bgr 'bg r' 0 0 1 0.5 0.001
//@param style.bgg 'bg g' 0 0 1 0.5 0.001
//@param style.bgb 'bg b' 0 0 1 0.5 0.001
//@param style.bga 'bg a' 0.4 0 1 0.5 0.001
//@param style.olr 'outline r' 0 0 1 0.5 0.01
//@param style.olg 'outline g' 0 0 1 0.5 0.01
//@param style.olb 'outline b' 0 0 1 0.5 0.01
//@param style.ola 'outline a' 0.1 0.01 1 0.5 0.01
//@param style.olt 'outline thickness' 0 0 1 0.5 0.01
//@param style.shmode 'shadow mode' 0 0 1 0.5 1
//@param style.shangl 'shadow angle' 45 0 359 180 1

function gfx_img_alloc_alpha(w,h)
(
gfx_set(0,0,0,1,0,-1,0); // set black, transparent, clobber
gfx_img_alloc(w,h,1); // allocate and clear image with above settings
);

function xy2polar(x,y,r*,phi*)(r=sqrt(x^2+y^2);phi=2*atan(y/(x+r)));
function polar2xy(r,phi,x*,y*)(x=r*cos(phi);y=r*sin(phi));
function rotate_coord(x*,y*,rota)(xy2polar(x,y,this.r,this.phi);polar2xy(this.r,this.phi-rota,x,y));
//calc size of reactangle that can contain all text + its rotation
function calc_rot_img_size(sw,sh,dw*,dh*,rot)
local(xmax,ymax)
instance(x,y)
(
xmax=sw;ymax=sh;
//top left corner
x=-sw/2;y=-sh/2;rotate_coord(x,y,rot);
xmax<2*abs(x)?xmax=2*abs(x);
ymax<2*abs(y)?ymax=2*abs(y);
//top right corner
x=sw/2;y=-sh/2;rotate_coord(x,y,rot);
xmax<2*abs(x)?xmax=2*abs(x);ymax<2*abs(y)?ymax=2*abs(y);
dw=xmax;dh=ymax;
);

//set the rest of the environment
colorspace='RGBA';
oldiv=128;
rota=rota/180*$pi;
style.fga<0?style.fga=param_wet;
style.bga*=style.fga; //bg alpha dependent upon fg alpha
mode=0x10000|0x100; //use alpha & smoothing

//no text? get it from item name or track name
strlen(#text)==0 ? input_get_name(-1,#text);
// get current input stats and force output to that size
input_info(0,sw,sh); project_w=sw;project_h=sh;
//calculate text stats, fsize=pix height of font
gfx_setfont(fsize=style.frs*min(sw,sh),#style.font,style.style);
gfx_str_measure(#text,tw,th);

// calculate text background dimensions to parameters & outline/shadow extra space
style.bgw*=tw;
style.bgh=style.bgh<0?style.bgw:style.bgh*=th;
style.olt*=fsize/4; // outline pix thickness
tbw=tw+2*style.bgw+2*style.olt; //text bg pix width
tbh=th+2*style.bgh+2*style.olt; //text bg pix height

//calc temporary img size compensated for rotation: (iw,ih) new temporary img dim
calc_rot_img_size(tbw,tbh,iw,ih,rota);

//ok, it's time to render to temporary image
img=gfx_img_alloc_alpha(iw,ih);

//background if applicable
style.bga>0?(
gfx_set(style.bgr,style.bgg,style.bgb,style.bga,mode,img);
gfx_fillrect((iw-tbw)/2,(ih-tbh)/2,tbw,tbh);
);
// outline or shadow of applicable
style.olt>0?(
style.shmode?(style.ola=exp(style.ola*style.fga*4.5-4);style.shangl=style.shangl*oldiv/360):(style.ola=exp((oldiv/20)*style.ola*style.fga-5.7);style.shangl=0;);
gfx_set(style.olr,style.olg,style.olb,style.ola*style.fga,mode,img);
i=0; loop(style.shmode?oldiv/16:eek:ldiv,
phi=2*(i+style.shangl)*$pi/oldiv;
polar2xy(style.olt,phi,ox,oy);
gfx_str_draw(#text,(iw-tw)/2+ox,(ih-th)/2+oy);
i+=1;
);
);
// 'normal' text
gfx_set(style.fgr,style.fgg,style.fgb,style.fga,mode,img);
gfx_str_draw(#text,(iw-tw)/2,(ih-th)/2);

//final render
gfx_set(1,1,1,1,mode,-1,1);
gfx_blit(0,1);
//offset factor compensation according to alignement reference
tofx+=hRef*(sw-tbw)/(2*sw);
tofy+=vRef*(sh-tbh)/(2*sh);
//final position
rx=tofx*sw+sw/2-iw/2;
ry=tofy*sh+sh/2-ih/2;
//final blit + clean
gfx_rotoblit(img,rota,rx,ry,iw,ih);
gfx_img_free(img);
Довольно многофункциональный, такой себе Overlay: Text на стероидах и в нем как раз есть "text rotation independent of background" =)
Проверил - работает =)
Посмотреть вложение 235861
Оу, ну это уже совсем другое дело!)) Надо тоже затестить немедленно! Спасибо огромное!
 
  • Like
Реакции: truemanofan
20 Янв 2018
205
108
43
43
@Вадим Морозов-Калужский,
Посмотрите этот скрипт:
// Overlay: text w/adjustable ol/sh/rot/pos
// by papagirafe
// version 3.01, now includes rotation, relative positioning LMR TMB

// Write your own text inside quotes, multiple lines allowed inside quotes
// if empty, text = item/track name
#text="";

// default font = "Arial" in Windows
#style.font="";
/*
font styles from following list - upto 4 choices allowed - uppercase mandatory
'B' - Bold, 'I' - Italics, 'R' - smooth edges,
'V' - Invert bg/fg, 'U' - underlined
ugly "stock" shadow and outline styles still work if you insist on using them...
*/
style.style='';

// preset paramaters
//@param style.frs 'text height' 0.07 0.01 1.0 0.5 0.001
//@param hRef "x ref L/M/R" 0 -1 1 0 1
//@param vRef "y ref T/M/B" 0 -1 1 0 1
//@param tofx "x offset" 0 -1 1 0 0.001
//@param tofy "y offset" 0 -1 1 0 0.001
//@param rota rotation 0 -180 180 0 0.1
//@param style.fgr 'text r' 1 0 1 0.5 0.001
//@param style.fgg 'text g' 1 0 1 0.5 0.001
//@param style.fgb 'text b' 1 0 1 0.5 0.001
//@param style.fga 'text a' 1 -0.01 1 0.5 0.01
//@param style.bgw 'bg w' 0 0 1 1 0.001
//@param style.bgh 'bg h' -0.001 -0.001 1 0.5 0.001 negative? follow bg w!
//@param style.bgr 'bg r' 0 0 1 0.5 0.001
//@param style.bgg 'bg g' 0 0 1 0.5 0.001
//@param style.bgb 'bg b' 0 0 1 0.5 0.001
//@param style.bga 'bg a' 0.4 0 1 0.5 0.001
//@param style.olr 'outline r' 0 0 1 0.5 0.01
//@param style.olg 'outline g' 0 0 1 0.5 0.01
//@param style.olb 'outline b' 0 0 1 0.5 0.01
//@param style.ola 'outline a' 0.1 0.01 1 0.5 0.01
//@param style.olt 'outline thickness' 0 0 1 0.5 0.01
//@param style.shmode 'shadow mode' 0 0 1 0.5 1
//@param style.shangl 'shadow angle' 45 0 359 180 1

function gfx_img_alloc_alpha(w,h)
(
gfx_set(0,0,0,1,0,-1,0); // set black, transparent, clobber
gfx_img_alloc(w,h,1); // allocate and clear image with above settings
);

function xy2polar(x,y,r*,phi*)(r=sqrt(x^2+y^2);phi=2*atan(y/(x+r)));
function polar2xy(r,phi,x*,y*)(x=r*cos(phi);y=r*sin(phi));
function rotate_coord(x*,y*,rota)(xy2polar(x,y,this.r,this.phi);polar2xy(this.r,this.phi-rota,x,y));
//calc size of reactangle that can contain all text + its rotation
function calc_rot_img_size(sw,sh,dw*,dh*,rot)
local(xmax,ymax)
instance(x,y)
(
xmax=sw;ymax=sh;
//top left corner
x=-sw/2;y=-sh/2;rotate_coord(x,y,rot);
xmax<2*abs(x)?xmax=2*abs(x);
ymax<2*abs(y)?ymax=2*abs(y);
//top right corner
x=sw/2;y=-sh/2;rotate_coord(x,y,rot);
xmax<2*abs(x)?xmax=2*abs(x);ymax<2*abs(y)?ymax=2*abs(y);
dw=xmax;dh=ymax;
);

//set the rest of the environment
colorspace='RGBA';
oldiv=128;
rota=rota/180*$pi;
style.fga<0?style.fga=param_wet;
style.bga*=style.fga; //bg alpha dependent upon fg alpha
mode=0x10000|0x100; //use alpha & smoothing

//no text? get it from item name or track name
strlen(#text)==0 ? input_get_name(-1,#text);
// get current input stats and force output to that size
input_info(0,sw,sh); project_w=sw;project_h=sh;
//calculate text stats, fsize=pix height of font
gfx_setfont(fsize=style.frs*min(sw,sh),#style.font,style.style);
gfx_str_measure(#text,tw,th);

// calculate text background dimensions to parameters & outline/shadow extra space
style.bgw*=tw;
style.bgh=style.bgh<0?style.bgw:style.bgh*=th;
style.olt*=fsize/4; // outline pix thickness
tbw=tw+2*style.bgw+2*style.olt; //text bg pix width
tbh=th+2*style.bgh+2*style.olt; //text bg pix height

//calc temporary img size compensated for rotation: (iw,ih) new temporary img dim
calc_rot_img_size(tbw,tbh,iw,ih,rota);

//ok, it's time to render to temporary image
img=gfx_img_alloc_alpha(iw,ih);

//background if applicable
style.bga>0?(
gfx_set(style.bgr,style.bgg,style.bgb,style.bga,mode,img);
gfx_fillrect((iw-tbw)/2,(ih-tbh)/2,tbw,tbh);
);
// outline or shadow of applicable
style.olt>0?(
style.shmode?(style.ola=exp(style.ola*style.fga*4.5-4);style.shangl=style.shangl*oldiv/360):(style.ola=exp((oldiv/20)*style.ola*style.fga-5.7);style.shangl=0;);
gfx_set(style.olr,style.olg,style.olb,style.ola*style.fga,mode,img);
i=0; loop(style.shmode?oldiv/16:eek:ldiv,
phi=2*(i+style.shangl)*$pi/oldiv;
polar2xy(style.olt,phi,ox,oy);
gfx_str_draw(#text,(iw-tw)/2+ox,(ih-th)/2+oy);
i+=1;
);
);
// 'normal' text
gfx_set(style.fgr,style.fgg,style.fgb,style.fga,mode,img);
gfx_str_draw(#text,(iw-tw)/2,(ih-th)/2);

//final render
gfx_set(1,1,1,1,mode,-1,1);
gfx_blit(0,1);
//offset factor compensation according to alignement reference
tofx+=hRef*(sw-tbw)/(2*sw);
tofy+=vRef*(sh-tbh)/(2*sh);
//final position
rx=tofx*sw+sw/2-iw/2;
ry=tofy*sh+sh/2-ih/2;
//final blit + clean
gfx_rotoblit(img,rota,rx,ry,iw,ih);
gfx_img_free(img);
Довольно многофункциональный, такой себе Overlay: Text на стероидах и в нем как раз есть "text rotation independent of background" =)
Проверил - работает =)
Посмотреть вложение 235861
Вставляю, не работает. Может часть кода потеряна в спойлере?
 
20 Янв 2018
205
108
43
43
@Вадим Морозов-Калужский,
Посмотрите этот скрипт:
// Overlay: text w/adjustable ol/sh/rot/pos
// by papagirafe
// version 3.01, now includes rotation, relative positioning LMR TMB

// Write your own text inside quotes, multiple lines allowed inside quotes
// if empty, text = item/track name
#text="";

// default font = "Arial" in Windows
#style.font="";
/*
font styles from following list - upto 4 choices allowed - uppercase mandatory
'B' - Bold, 'I' - Italics, 'R' - smooth edges,
'V' - Invert bg/fg, 'U' - underlined
ugly "stock" shadow and outline styles still work if you insist on using them...
*/
style.style='';

// preset paramaters
//@param style.frs 'text height' 0.07 0.01 1.0 0.5 0.001
//@param hRef "x ref L/M/R" 0 -1 1 0 1
//@param vRef "y ref T/M/B" 0 -1 1 0 1
//@param tofx "x offset" 0 -1 1 0 0.001
//@param tofy "y offset" 0 -1 1 0 0.001
//@param rota rotation 0 -180 180 0 0.1
//@param style.fgr 'text r' 1 0 1 0.5 0.001
//@param style.fgg 'text g' 1 0 1 0.5 0.001
//@param style.fgb 'text b' 1 0 1 0.5 0.001
//@param style.fga 'text a' 1 -0.01 1 0.5 0.01
//@param style.bgw 'bg w' 0 0 1 1 0.001
//@param style.bgh 'bg h' -0.001 -0.001 1 0.5 0.001 negative? follow bg w!
//@param style.bgr 'bg r' 0 0 1 0.5 0.001
//@param style.bgg 'bg g' 0 0 1 0.5 0.001
//@param style.bgb 'bg b' 0 0 1 0.5 0.001
//@param style.bga 'bg a' 0.4 0 1 0.5 0.001
//@param style.olr 'outline r' 0 0 1 0.5 0.01
//@param style.olg 'outline g' 0 0 1 0.5 0.01
//@param style.olb 'outline b' 0 0 1 0.5 0.01
//@param style.ola 'outline a' 0.1 0.01 1 0.5 0.01
//@param style.olt 'outline thickness' 0 0 1 0.5 0.01
//@param style.shmode 'shadow mode' 0 0 1 0.5 1
//@param style.shangl 'shadow angle' 45 0 359 180 1

function gfx_img_alloc_alpha(w,h)
(
gfx_set(0,0,0,1,0,-1,0); // set black, transparent, clobber
gfx_img_alloc(w,h,1); // allocate and clear image with above settings
);

function xy2polar(x,y,r*,phi*)(r=sqrt(x^2+y^2);phi=2*atan(y/(x+r)));
function polar2xy(r,phi,x*,y*)(x=r*cos(phi);y=r*sin(phi));
function rotate_coord(x*,y*,rota)(xy2polar(x,y,this.r,this.phi);polar2xy(this.r,this.phi-rota,x,y));
//calc size of reactangle that can contain all text + its rotation
function calc_rot_img_size(sw,sh,dw*,dh*,rot)
local(xmax,ymax)
instance(x,y)
(
xmax=sw;ymax=sh;
//top left corner
x=-sw/2;y=-sh/2;rotate_coord(x,y,rot);
xmax<2*abs(x)?xmax=2*abs(x);
ymax<2*abs(y)?ymax=2*abs(y);
//top right corner
x=sw/2;y=-sh/2;rotate_coord(x,y,rot);
xmax<2*abs(x)?xmax=2*abs(x);ymax<2*abs(y)?ymax=2*abs(y);
dw=xmax;dh=ymax;
);

//set the rest of the environment
colorspace='RGBA';
oldiv=128;
rota=rota/180*$pi;
style.fga<0?style.fga=param_wet;
style.bga*=style.fga; //bg alpha dependent upon fg alpha
mode=0x10000|0x100; //use alpha & smoothing

//no text? get it from item name or track name
strlen(#text)==0 ? input_get_name(-1,#text);
// get current input stats and force output to that size
input_info(0,sw,sh); project_w=sw;project_h=sh;
//calculate text stats, fsize=pix height of font
gfx_setfont(fsize=style.frs*min(sw,sh),#style.font,style.style);
gfx_str_measure(#text,tw,th);

// calculate text background dimensions to parameters & outline/shadow extra space
style.bgw*=tw;
style.bgh=style.bgh<0?style.bgw:style.bgh*=th;
style.olt*=fsize/4; // outline pix thickness
tbw=tw+2*style.bgw+2*style.olt; //text bg pix width
tbh=th+2*style.bgh+2*style.olt; //text bg pix height

//calc temporary img size compensated for rotation: (iw,ih) new temporary img dim
calc_rot_img_size(tbw,tbh,iw,ih,rota);

//ok, it's time to render to temporary image
img=gfx_img_alloc_alpha(iw,ih);

//background if applicable
style.bga>0?(
gfx_set(style.bgr,style.bgg,style.bgb,style.bga,mode,img);
gfx_fillrect((iw-tbw)/2,(ih-tbh)/2,tbw,tbh);
);
// outline or shadow of applicable
style.olt>0?(
style.shmode?(style.ola=exp(style.ola*style.fga*4.5-4);style.shangl=style.shangl*oldiv/360):(style.ola=exp((oldiv/20)*style.ola*style.fga-5.7);style.shangl=0;);
gfx_set(style.olr,style.olg,style.olb,style.ola*style.fga,mode,img);
i=0; loop(style.shmode?oldiv/16:eek:ldiv,
phi=2*(i+style.shangl)*$pi/oldiv;
polar2xy(style.olt,phi,ox,oy);
gfx_str_draw(#text,(iw-tw)/2+ox,(ih-th)/2+oy);
i+=1;
);
);
// 'normal' text
gfx_set(style.fgr,style.fgg,style.fgb,style.fga,mode,img);
gfx_str_draw(#text,(iw-tw)/2,(ih-th)/2);

//final render
gfx_set(1,1,1,1,mode,-1,1);
gfx_blit(0,1);
//offset factor compensation according to alignement reference
tofx+=hRef*(sw-tbw)/(2*sw);
tofy+=vRef*(sh-tbh)/(2*sh);
//final position
rx=tofx*sw+sw/2-iw/2;
ry=tofy*sh+sh/2-ih/2;
//final blit + clean
gfx_rotoblit(img,rota,rx,ry,iw,ih);
gfx_img_free(img);
Довольно многофункциональный, такой себе Overlay: Text на стероидах и в нем как раз есть "text rotation independent of background" =)
Проверил - работает =)
Посмотреть вложение 235861
Ошибку выдаёт:

235888
 

Mr_Tsonts

Well-Known Member
18 Апр 2019
1.656
1.341
113
56
Киев
@Вадим Морозов-Калужский,
Посмотрите этот скрипт:
// Overlay: text w/adjustable ol/sh/rot/pos
// by papagirafe
// version 3.01, now includes rotation, relative positioning LMR TMB

// Write your own text inside quotes, multiple lines allowed inside quotes
// if empty, text = item/track name
#text="";

// default font = "Arial" in Windows
#style.font="";
/*
font styles from following list - upto 4 choices allowed - uppercase mandatory
'B' - Bold, 'I' - Italics, 'R' - smooth edges,
'V' - Invert bg/fg, 'U' - underlined
ugly "stock" shadow and outline styles still work if you insist on using them...
*/
style.style='';

// preset paramaters
//@param style.frs 'text height' 0.07 0.01 1.0 0.5 0.001
//@param hRef "x ref L/M/R" 0 -1 1 0 1
//@param vRef "y ref T/M/B" 0 -1 1 0 1
//@param tofx "x offset" 0 -1 1 0 0.001
//@param tofy "y offset" 0 -1 1 0 0.001
//@param rota rotation 0 -180 180 0 0.1
//@param style.fgr 'text r' 1 0 1 0.5 0.001
//@param style.fgg 'text g' 1 0 1 0.5 0.001
//@param style.fgb 'text b' 1 0 1 0.5 0.001
//@param style.fga 'text a' 1 -0.01 1 0.5 0.01
//@param style.bgw 'bg w' 0 0 1 1 0.001
//@param style.bgh 'bg h' -0.001 -0.001 1 0.5 0.001 negative? follow bg w!
//@param style.bgr 'bg r' 0 0 1 0.5 0.001
//@param style.bgg 'bg g' 0 0 1 0.5 0.001
//@param style.bgb 'bg b' 0 0 1 0.5 0.001
//@param style.bga 'bg a' 0.4 0 1 0.5 0.001
//@param style.olr 'outline r' 0 0 1 0.5 0.01
//@param style.olg 'outline g' 0 0 1 0.5 0.01
//@param style.olb 'outline b' 0 0 1 0.5 0.01
//@param style.ola 'outline a' 0.1 0.01 1 0.5 0.01
//@param style.olt 'outline thickness' 0 0 1 0.5 0.01
//@param style.shmode 'shadow mode' 0 0 1 0.5 1
//@param style.shangl 'shadow angle' 45 0 359 180 1

function gfx_img_alloc_alpha(w,h)
(
gfx_set(0,0,0,1,0,-1,0); // set black, transparent, clobber
gfx_img_alloc(w,h,1); // allocate and clear image with above settings
);

function xy2polar(x,y,r*,phi*)(r=sqrt(x^2+y^2);phi=2*atan(y/(x+r)));
function polar2xy(r,phi,x*,y*)(x=r*cos(phi);y=r*sin(phi));
function rotate_coord(x*,y*,rota)(xy2polar(x,y,this.r,this.phi);polar2xy(this.r,this.phi-rota,x,y));
//calc size of reactangle that can contain all text + its rotation
function calc_rot_img_size(sw,sh,dw*,dh*,rot)
local(xmax,ymax)
instance(x,y)
(
xmax=sw;ymax=sh;
//top left corner
x=-sw/2;y=-sh/2;rotate_coord(x,y,rot);
xmax<2*abs(x)?xmax=2*abs(x);
ymax<2*abs(y)?ymax=2*abs(y);
//top right corner
x=sw/2;y=-sh/2;rotate_coord(x,y,rot);
xmax<2*abs(x)?xmax=2*abs(x);ymax<2*abs(y)?ymax=2*abs(y);
dw=xmax;dh=ymax;
);

//set the rest of the environment
colorspace='RGBA';
oldiv=128;
rota=rota/180*$pi;
style.fga<0?style.fga=param_wet;
style.bga*=style.fga; //bg alpha dependent upon fg alpha
mode=0x10000|0x100; //use alpha & smoothing

//no text? get it from item name or track name
strlen(#text)==0 ? input_get_name(-1,#text);
// get current input stats and force output to that size
input_info(0,sw,sh); project_w=sw;project_h=sh;
//calculate text stats, fsize=pix height of font
gfx_setfont(fsize=style.frs*min(sw,sh),#style.font,style.style);
gfx_str_measure(#text,tw,th);

// calculate text background dimensions to parameters & outline/shadow extra space
style.bgw*=tw;
style.bgh=style.bgh<0?style.bgw:style.bgh*=th;
style.olt*=fsize/4; // outline pix thickness
tbw=tw+2*style.bgw+2*style.olt; //text bg pix width
tbh=th+2*style.bgh+2*style.olt; //text bg pix height

//calc temporary img size compensated for rotation: (iw,ih) new temporary img dim
calc_rot_img_size(tbw,tbh,iw,ih,rota);

//ok, it's time to render to temporary image
img=gfx_img_alloc_alpha(iw,ih);

//background if applicable
style.bga>0?(
gfx_set(style.bgr,style.bgg,style.bgb,style.bga,mode,img);
gfx_fillrect((iw-tbw)/2,(ih-tbh)/2,tbw,tbh);
);
// outline or shadow of applicable
style.olt>0?(
style.shmode?(style.ola=exp(style.ola*style.fga*4.5-4);style.shangl=style.shangl*oldiv/360):(style.ola=exp((oldiv/20)*style.ola*style.fga-5.7);style.shangl=0;);
gfx_set(style.olr,style.olg,style.olb,style.ola*style.fga,mode,img);
i=0; loop(style.shmode?oldiv/16:eek:ldiv,
phi=2*(i+style.shangl)*$pi/oldiv;
polar2xy(style.olt,phi,ox,oy);
gfx_str_draw(#text,(iw-tw)/2+ox,(ih-th)/2+oy);
i+=1;
);
);
// 'normal' text
gfx_set(style.fgr,style.fgg,style.fgb,style.fga,mode,img);
gfx_str_draw(#text,(iw-tw)/2,(ih-th)/2);

//final render
gfx_set(1,1,1,1,mode,-1,1);
gfx_blit(0,1);
//offset factor compensation according to alignement reference
tofx+=hRef*(sw-tbw)/(2*sw);
tofy+=vRef*(sh-tbh)/(2*sh);
//final position
rx=tofx*sw+sw/2-iw/2;
ry=tofy*sh+sh/2-ih/2;
//final blit + clean
gfx_rotoblit(img,rota,rx,ry,iw,ih);
gfx_img_free(img);
Довольно многофункциональный, такой себе Overlay: Text на стероидах и в нем как раз есть "text rotation independent of background" =)
Проверил - работает =)
Посмотреть вложение 235861
@truemanofan, попробуйте вставить код не как текст, а как код, чтобы без "улыбочек" было. Тогда можно будет правильно скопировать.
Тут есть возможность вставки именно кода. Там где три точки открывается менюшка.
 
  • Like
Реакции: truemanofan

truemanofan

Active Member
2 Июн 2019
165
169
43
@Mr_Tsonts, спасибо, сделаю =) мой косяк, не знал о таком и не обратил внимания даже, что там местами появились смайлики =)
@Вадим Морозов-Калужский, пробую отправить по совету выше:
Код:
// Overlay: text w/adjustable ol/sh/rot/pos
// by papagirafe
// version 3.01, now includes rotation, relative positioning LMR TMB

// Write your own text inside quotes, multiple lines allowed inside quotes
// if empty, text = item/track name
#text="";

// default font = "Arial" in Windows
#style.font="";
/*
  font styles from following list - upto 4 choices allowed - uppercase mandatory
  'B' - Bold,   'I' - Italics,  'R' - smooth edges,
  'V' - Invert bg/fg, 'U' - underlined
  ugly "stock" shadow and outline styles still work if you insist on using them...
*/
style.style='';

// preset paramaters
//@param style.frs 'text height' 0.07 0.01 1.0 0.5 0.001
//@param hRef "x ref L/M/R" 0 -1 1 0 1
//@param vRef "y ref T/M/B" 0 -1 1 0 1
//@param tofx "x offset" 0 -1 1 0 0.001
//@param tofy "y offset" 0 -1 1 0 0.001
//@param rota rotation 0 -180 180 0 0.1
//@param style.fgr 'text r' 1 0 1 0.5 0.001
//@param style.fgg 'text g' 1 0 1 0.5 0.001
//@param style.fgb 'text b' 1 0 1 0.5 0.001
//@param style.fga 'text a' 1 -0.01 1 0.5 0.01
//@param style.bgw 'bg w' 0 0 1 1 0.001
//@param style.bgh 'bg h' -0.001 -0.001 1 0.5 0.001    negative? follow bg w!
//@param style.bgr 'bg r' 0 0 1 0.5 0.001
//@param style.bgg 'bg g' 0 0 1 0.5 0.001
//@param style.bgb 'bg b' 0 0 1 0.5 0.001
//@param style.bga 'bg a' 0.4 0 1 0.5 0.001
//@param style.olr 'outline r' 0 0 1 0.5 0.01
//@param style.olg 'outline g' 0 0 1 0.5 0.01
//@param style.olb 'outline b' 0 0 1 0.5 0.01
//@param style.ola 'outline a' 0.1 0.01 1 0.5 0.01
//@param style.olt 'outline thickness' 0 0 1 0.5 0.01
//@param style.shmode 'shadow mode' 0 0 1 0.5 1
//@param style.shangl 'shadow angle' 45 0 359 180 1

function gfx_img_alloc_alpha(w,h)
(
  gfx_set(0,0,0,1,0,-1,0); // set black, transparent, clobber
  gfx_img_alloc(w,h,1); // allocate and clear image with above settings
);

function xy2polar(x,y,r*,phi*)(r=sqrt(x^2+y^2);phi=2*atan(y/(x+r)));
function polar2xy(r,phi,x*,y*)(x=r*cos(phi);y=r*sin(phi));
function rotate_coord(x*,y*,rota)(xy2polar(x,y,this.r,this.phi);polar2xy(this.r,this.phi-rota,x,y));
//calc size of reactangle that can contain all text + its rotation
function calc_rot_img_size(sw,sh,dw*,dh*,rot)
  local(xmax,ymax)
  instance(x,y)
(
  xmax=sw;ymax=sh;
  //top left corner
  x=-sw/2;y=-sh/2;rotate_coord(x,y,rot);
  xmax<2*abs(x)?xmax=2*abs(x);
  ymax<2*abs(y)?ymax=2*abs(y);
  //top right corner
  x=sw/2;y=-sh/2;rotate_coord(x,y,rot);
  xmax<2*abs(x)?xmax=2*abs(x);ymax<2*abs(y)?ymax=2*abs(y);
  dw=xmax;dh=ymax;
);

//set the rest of the environment
colorspace='RGBA';
oldiv=128;
rota=rota/180*$pi;
style.fga<0?style.fga=param_wet;
style.bga*=style.fga; //bg alpha dependent upon fg alpha
mode=0x10000|0x100; //use alpha & smoothing

//no text? get it from item name or track name
strlen(#text)==0 ? input_get_name(-1,#text);
// get current input stats and force output to that size
input_info(0,sw,sh); project_w=sw;project_h=sh;
//calculate text stats, fsize=pix height of font
gfx_setfont(fsize=style.frs*min(sw,sh),#style.font,style.style);
gfx_str_measure(#text,tw,th);

// calculate text background dimensions to parameters & outline/shadow extra space
style.bgw*=tw;
style.bgh=style.bgh<0?style.bgw:style.bgh*=th;
style.olt*=fsize/4;  // outline pix thickness
tbw=tw+2*style.bgw+2*style.olt;  //text bg pix width
tbh=th+2*style.bgh+2*style.olt;  //text bg pix height

//calc temporary img size compensated for rotation: (iw,ih) new temporary img dim
calc_rot_img_size(tbw,tbh,iw,ih,rota);

//ok, it's time to render to temporary image
img=gfx_img_alloc_alpha(iw,ih);

//background if applicable
style.bga>0?(
  gfx_set(style.bgr,style.bgg,style.bgb,style.bga,mode,img);
  gfx_fillrect((iw-tbw)/2,(ih-tbh)/2,tbw,tbh);
);
// outline or shadow of applicable
style.olt>0?(
  style.shmode?(style.ola=exp(style.ola*style.fga*4.5-4);style.shangl=style.shangl*oldiv/360):(style.ola=exp((oldiv/20)*style.ola*style.fga-5.7);style.shangl=0;);
  gfx_set(style.olr,style.olg,style.olb,style.ola*style.fga,mode,img);
  i=0; loop(style.shmode?oldiv/16:oldiv,
    phi=2*(i+style.shangl)*$pi/oldiv;
    polar2xy(style.olt,phi,ox,oy);
    gfx_str_draw(#text,(iw-tw)/2+ox,(ih-th)/2+oy);
    i+=1;
  );
);
// 'normal' text
gfx_set(style.fgr,style.fgg,style.fgb,style.fga,mode,img);
gfx_str_draw(#text,(iw-tw)/2,(ih-th)/2);

//final render
gfx_set(1,1,1,1,mode,-1,1);
gfx_blit(0,1);
//offset factor compensation according to alignement reference
tofx+=hRef*(sw-tbw)/(2*sw);
tofy+=vRef*(sh-tbh)/(2*sh);
//final position
rx=tofx*sw+sw/2-iw/2;
ry=tofy*sh+sh/2-ih/2;
//final blit + clean
gfx_rotoblit(img,rota,rx,ry,iw,ih);
gfx_img_free(img);
В крайнем случае - код это не мой, я его в интернете нашел, так что просто могу дать ссылку и заберете из первоисточника =)
upd
Попробовал скопировать-вставить - получилось, работает =)
copy-paste code.gif
 
Последнее редактирование:
  • Like
Реакции: Mr_Tsonts

V_ad_im

Well-Known Member
1 Ноя 2006
2.699
2.276
113
48
Вчера обнаружил такой глюк (или не глюк?) Есть несколько файлов mp4 4k, снятые фотиком Lumix. Несколько, потому как он сам разбивает большое видео на куски по 4 гига. И вот есть как минимум пара программ, которые помогают бесшовно склеивать эти куски: mp4joiner и упомянутый выше Shutter Encoder (+mmpeg). и вот если я склеенное видео затаскиваю в Рипер (пробовал версии 6.83/7RC13 на маке m1), то версия, склеенная с помощью mp4joiner выглядит и звучит криво - аудио начинает спотыкаться на склейках и опаздывать после склеек. Если затаскиваю оба видео в Нуэндо/Давинчи - всё норм, синхронно и без швов от начала до конца. (если слушаю в файндере место склеек - в обоих файлах слышно подёргивание звука)
В звуковом примере стык примерно через 1-2 сек после слова "септима", сначала звучит стык из Shutter Encoder, затем из mp4joiner:

236044

 

Вложения

Последнее редактирование:

Antonio

Well-Known Member
9 Ноя 2003
4.343
1.558
113
48
Алматы
Если затаскиваю оба видео в Нуэндо/Давинчи
В Давинчи есть своя утилитка для склеивания таких файлов. А в рипере и руками за 10 секунд не сложно склеить. А клеить всякими
mp4joiner и упомянутый выше Shutter Encoder
я бы не стал, это же лишнее перекодирование, качество теряется.
 

Сейчас онлайн (Пользователей: 0, Гостей: 1)