Old 09-26-2017, 12:30 PM   #1
Reno.thestraws
Human being with feelings
 
Reno.thestraws's Avatar
 
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
Default Req : Video processor : Title text overlay from item note

Code:
// Title text overlay
text="This is a title";
font="Arial";

//@param1:size 'text height' 0.05 0.01 0.2 0.1 0.01
//@param2:ypos 'y position' 0.95 0 1 0.5 0.01
//@param3:xpos 'x position' 0 0 1 0.5 0.01
//@param4:border 'border' 0 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.75 0 1 0.5 0.01
//@param8:bga 'bg alpha' 0.5 0 1 0.5 0.01

input = 0;
!project_wh_valid && input_info(input,w,h) ? ( project_w=w; project_h=h; );
gfx_blit(input,1);
gfx_setfont(size*project_h,font);
gfx_str_measure(text,txtw,txth);
yt = (project_h- txth*(1+border*2))*ypos;
gfx_set(bgc,bgc,bgc,bga);
gfx_fillrect(0, yt, project_w, txth*(1+border*2));
gfx_set(fgc,fgc,fgc,fga);
gfx_str_draw(text,xpos * (project_w-txtw),yt+txth*border);
How can i do it?

would be very handy to create subtitles/lyrics on music video
__________________
http://www.residenceemilia.com
Reno.thestraws is offline   Reply With Quote
Old 09-26-2017, 03:41 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Unfortunately it is not possible to access ReaScript functions or any elements from the arrange view with video processor. It is its own little world.

We have been requested that since a lot time tough.
X-Raym is offline   Reply With Quote
Old 09-26-2017, 04:51 PM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Code:
<VIDEO_EFFECT "Video processor" ""
          <CODE
            |// Title text overlay
            |text="This is a title";
            |font="Arial";
            |
            |//@param1:size 'text height' 0.05 0.01 0.2 0.1 0.01
            |//@param2:ypos 'y position' 0.95 0 1 0.5 0.01
            |//@param3:xpos 'x position' 0 0 1 0.5 0.01
            |//@param4:border 'border' 0 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.75 0 1 0.5 0.01
            |//@param8:bga 'bg alpha' 0.5 0 1 0.5 0.01
            |
            |input = 0;
            |!project_wh_valid && input_info(input,w,h) ? ( project_w=w; project_h=h; );
            |gfx_blit(input,1);
            |gfx_setfont(size*project_h,font);
            |gfx_str_measure(text,txtw,txth);
            |yt = (project_h- txth*(1+border*2))*ypos;
            |gfx_set(bgc,bgc,bgc,bga);
            |gfx_fillrect(0, yt, project_w, txth*(1+border*2));
            |gfx_set(fgc,fgc,fgc,fga);
            |gfx_str_draw(text,xpos * (project_w-txtw),yt+txth*border);
          >
          CODEPARM 0.0500000000 0.9500000000 0.0000000000 0.0000000000 1.0000000000 1.0000000000 0.7500000000 0.5000000000 0.0000000000 0.0000000000 1.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000
        >
This is how video processor take FX text preset is written right in the RPP file.

A script could update the text field based (from Item Chunks directly) on some object properties... like items notes.
X-Raym is offline   Reply With Quote
Old 08-02-2018, 06:57 AM   #4
murphsa
Human being with feelings
 
Join Date: Aug 2018
Posts: 2
Default Title text overlay does work!

Hi, this code does work and you can easily add text overlays and modify how it looks, acts, etc. Just add this effect to an empty midi item, make the changes you wish (such as change the text) and be sure to save your changes with Ctrl-S while the window has focus, and you should be good to go. Feel free to PM if more detailed instructions are needed. -Scott
murphsa is offline   Reply With Quote
Old 08-04-2018, 05:27 PM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

These functions might be a good start:

https://github.com/ReaTeam/ReaScript...f15be48f57e2ae

Read the comments, as they give you hints, what to expect and what difficulties are involved with updating VideoProcessor-code at "runtime" of a playing/rendering project.
Meo-Ada Mespotine is offline   Reply With Quote
Old 08-05-2018, 06:53 AM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

In fact, I just made some script for pushing text into video processor, like from region;




Pack release soon.
X-Raym is offline   Reply With Quote
Old 08-06-2018, 03:20 AM   #7
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,214
Default

X-Raym.. My hero!

That will definitely come in useful again at some point as I use video text overlays in demo videos for game sounds all the time so the coders know where to put the hooks

Thanks!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 11-03-2018, 06:50 AM   #8
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
Default

Hi X-raym,

did you ever publish the "region title to text overlay" script? I searched the packages but didn't find anything similar. In your gif it seems to work pretty well. And I'm pretty excited to test it for a song translation I want to do. Many thanks in advance.

Greetings
Eli
Eliseat is offline   Reply With Quote
Old 11-03-2018, 06:29 PM   #9
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@Eliseat
Hi !


I made a small premium reapack package for video processor related scripts,
I had other things to add to it but they need more testing.


Anyway, these scripts are working nicely. :P
X-Raym is offline   Reply With Quote
Old 11-04-2018, 03:57 AM   #10
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
Default

Okay, got it.
Eliseat is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.