Subtitles background?

formingus wrote on 6/24/2022, 6:31 AM

Does anyone to tech some easy steep to add background to subtitles?

I saw some tuts on youtube, but there was a long way, we need to add a background blank image, then crop, then mask etc..

Is there some fast way to add background to multiple subtitles ? Thanks

Windows 10 Pro
DirectX DirectX 12.0
Intel Core i5-4210U, 2700 MHz
Hewlett-Packard HP Pavilion 15 Notebook PC
System Memory    8122 MB  (DDR3 SDRAM)
Video Adapter    Intel(R) HD Graphics 4400  (3 GB)
3D Accelerator    Intel HD Graphics 4400
Multimedia Realtek ALC290 @ Intel Lynx Point-LP PCH - High Definition Audio Controller
Disk Drive    Seagate M3 Portable SCSI Disk Device  (3726 GB)
Disk Drive    GIGABYTE GP-GSTFS31256GTND  (256 GB, SATA-III)

Comments

RogerS wrote on 6/24/2022, 8:11 AM

For subtitles, Vegas now has a crop background to text option in titles and text. See if that works for your purposes.

3POINT wrote on 6/24/2022, 11:23 AM

Example:

Former user wrote on 6/24/2022, 11:32 AM

For subtitles, Vegas now has a crop background to text option in titles and text. See if that works for your purposes.


@RogerS 👍 is that new?

jetdv wrote on 6/24/2022, 11:33 AM
// titles and text set "FitBackgroundColor" flag - needs VEGAS Pro 19
            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach (TrackEvent evnt in myTrack.Events)
                    {
                        if (evnt.ActiveTake.Media.IsGenerated())
                        {
                            VideoEvent vevnt = (VideoEvent)evnt;
                            Effect gEffect = vevnt.ActiveTake.Media.Generator;
                            
                            if (gEffect.PlugIn.UniqueID == "{Svfx:com.vegascreativesoftware:titlesandtext}")
                            {
                                OFXEffect ofx = gEffect.OFXEffect;

                                OFXRGBAParameter fc = (OFXRGBAParameter)ofx.FindParameterByName("Background");
                                Color fcolor = Color.Black;

                                OFXColor foc;
                                foc.R = fcolor.R / 255.0;
                                foc.G = fcolor.G / 255.0;
                                foc.B = fcolor.B / 255.0;
                                foc.A = fcolor.A / 255.0;
                                fc.Value = foc;

                                OFXBooleanParameter fit = (OFXBooleanParameter)ofx.FindParameterByName("FitBackgroundColor");
                                fit.Value = true;

                                ofx.AllParametersChanged();
                            }
                        }
                    }
                }
            }

That's the code to set the fit background color flag. See my tutorials for the code that goes around this to complete the script. This tutorial will be on August 15th on www.jetdv.com and https://www.youtube.com/channel/UCbRCTmKY_LO-8kJwX-knW3Q/

formingus wrote on 6/24/2022, 1:36 PM
// titles and text set "FitBackgroundColor" flag - needs VEGAS Pro 19
            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach (TrackEvent evnt in myTrack.Events)
                    {
                        if (evnt.ActiveTake.Media.IsGenerated())
                        {
                            VideoEvent vevnt = (VideoEvent)evnt;
                            Effect gEffect = vevnt.ActiveTake.Media.Generator;
                            
                            if (gEffect.PlugIn.UniqueID == "{Svfx:com.vegascreativesoftware:titlesandtext}")
                            {
                                OFXEffect ofx = gEffect.OFXEffect;

                                OFXRGBAParameter fc = (OFXRGBAParameter)ofx.FindParameterByName("Background");
                                Color fcolor = Color.Black;

                                OFXColor foc;
                                foc.R = fcolor.R / 255.0;
                                foc.G = fcolor.G / 255.0;
                                foc.B = fcolor.B / 255.0;
                                foc.A = fcolor.A / 255.0;
                                fc.Value = foc;

                                OFXBooleanParameter fit = (OFXBooleanParameter)ofx.FindParameterByName("FitBackgroundColor");
                                fit.Value = true;

                                ofx.AllParametersChanged();
                            }
                        }
                    }
                }
            }

That's the code to set the fit background color flag. See my tutorials for the code that goes around this to complete the script. This tutorial will be on August 15th on www.jetdv.com and https://www.youtube.com/channel/UCbRCTmKY_LO-8kJwX-knW3Q/

Windows 10 Pro
DirectX DirectX 12.0
Intel Core i5-4210U, 2700 MHz
Hewlett-Packard HP Pavilion 15 Notebook PC
System Memory    8122 MB  (DDR3 SDRAM)
Video Adapter    Intel(R) HD Graphics 4400  (3 GB)
3D Accelerator    Intel HD Graphics 4400
Multimedia Realtek ALC290 @ Intel Lynx Point-LP PCH - High Definition Audio Controller
Disk Drive    Seagate M3 Portable SCSI Disk Device  (3726 GB)
Disk Drive    GIGABYTE GP-GSTFS31256GTND  (256 GB, SATA-III)

formingus wrote on 6/24/2022, 1:41 PM

For subtitles, Vegas now has a crop background to text option in titles and text. See if that works for your purposes.

Example:


 

Example:

Using vegas 19 pro b381 dont have that option

Windows 10 Pro
DirectX DirectX 12.0
Intel Core i5-4210U, 2700 MHz
Hewlett-Packard HP Pavilion 15 Notebook PC
System Memory    8122 MB  (DDR3 SDRAM)
Video Adapter    Intel(R) HD Graphics 4400  (3 GB)
3D Accelerator    Intel HD Graphics 4400
Multimedia Realtek ALC290 @ Intel Lynx Point-LP PCH - High Definition Audio Controller
Disk Drive    Seagate M3 Portable SCSI Disk Device  (3726 GB)
Disk Drive    GIGABYTE GP-GSTFS31256GTND  (256 GB, SATA-III)

formingus wrote on 6/24/2022, 1:41 PM

For subtitles, Vegas now has a crop background to text option in titles and text. See if that works for your purposes.

Using vegas 19 pro b381 dont have that option

Windows 10 Pro
DirectX DirectX 12.0
Intel Core i5-4210U, 2700 MHz
Hewlett-Packard HP Pavilion 15 Notebook PC
System Memory    8122 MB  (DDR3 SDRAM)
Video Adapter    Intel(R) HD Graphics 4400  (3 GB)
3D Accelerator    Intel HD Graphics 4400
Multimedia Realtek ALC290 @ Intel Lynx Point-LP PCH - High Definition Audio Controller
Disk Drive    Seagate M3 Portable SCSI Disk Device  (3726 GB)
Disk Drive    GIGABYTE GP-GSTFS31256GTND  (256 GB, SATA-III)

jetdv wrote on 6/24/2022, 3:09 PM

That's not ALL of the code. That's the code that makes it add the option. You need more code around it which is why I pointed you to the tutorials. Here's the complete code:

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;
            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach (TrackEvent evnt in myTrack.Events)
                    {
                        if (evnt.ActiveTake.Media.IsGenerated())
                        {
                            VideoEvent vevnt = (VideoEvent)evnt;
                            Effect gEffect = vevnt.ActiveTake.Media.Generator;
                            
                            if (gEffect.PlugIn.UniqueID == "{Svfx:com.vegascreativesoftware:titlesandtext}")
                            {
                                OFXEffect ofx = gEffect.OFXEffect;

                                OFXRGBAParameter fc = (OFXRGBAParameter)ofx.FindParameterByName("Background");
                                Color fcolor = Color.Black;

                                OFXColor foc;
                                foc.R = fcolor.R / 255.0;
                                foc.G = fcolor.G / 255.0;
                                foc.B = fcolor.B / 255.0;
                                foc.A = fcolor.A / 255.0;
                                fc.Value = foc;

                                OFXBooleanParameter fit = (OFXBooleanParameter)ofx.FindParameterByName("FitBackgroundColor");
                                fit.Value = true;

                                ofx.AllParametersChanged();
                            }
                        }
                    }
                }
            }
        }
    }

}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

Make sure the file ends with .cs. You could name it something like SubTitleBackground.cs.

This option was added in build 636 so you must be on 636 or 643 in order to use this feature. Just update from 381 to 643 and this option will be available to you.

Jon-W wrote on 5/19/2024, 6:13 PM

Thanks for this post as I searched all over and YouTube to find this answer without success and the forum has solved it with the crop background box. Thank goodness!! Thank you!

HP Pavilion All-in-One Desktop 24-ca0xxx     
Processor    AMD Ryzen 7 5700U with Radeon Graphics            1.80 GHz
Installed RAM    16.0 GB (15.4 GB usable)
System type    64-bit operating system, x64-based processor
Edition    Windows 11 Home
Version    23H2
Installed on    ‎02/‎02/‎2023
OS build    22631.3374
Experience    Windows Feature Experience Pack 1000.22688.1000.0

Vegas Pro Version 20.0 (Build 411)
 

jetdv wrote on 5/20/2024, 6:46 AM

@Jon-W here's a tutorial showing the set background text. You might want to look over all of the tutorials on my YouTube page: