gexrender

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(rawUrl, saveDir string) (destFile string, err error)

Fetch 抓取资源

func Invoke

func Invoke(name string, job *Job, data []byte) error

Invoke 调用invoke

func Register

func Register(name string, invoker Invoker)

Register 注册invoker

func Render

func Render(setting *Setting) (err error)

Render 渲染

Types

type Action

type Action struct {
	Action    string          `json:"action" validate:"required"`
	Parameter json.RawMessage `json:"parameter" validate:"required"`
}

Action 其他操作

type Asset

type Asset struct {
	Type        string      `json:"type" validate:"required"` // 类型
	Src         string      `json:"src"  validate:"required"` // 文件地址
	Dest        string      `json:"dest"`                     // 下载文件地址
	Composition string      `json:"composition"`              // 合成
	LayerName   string      `json:"layer_name"`               // 图层名
	LayerIndex  int         `json:"layer_index"`              // 图层索引
	Value       interface{} `json:"value"`                    // 值
	Expression  interface{} `json:"expression"`               // 表达式
	Property    string      `json:"property"`                 // 属性
}

Asset 可替换资源

func (*Asset) Fetch

func (a *Asset) Fetch(saveDir string) error

Fetch 抓取资源

func (*Asset) Wrap

func (a *Asset) Wrap() string

Wrap 转换

type Invoker

type Invoker interface {
	Invoke(job *Job, data []byte) error
}

Invoker 调度程序

type Job

type Job struct {
	Uid        string   `json:"-"` // 唯一id
	WorkPath   string   `json:"-"` // 工作目录
	ScriptFile string   `json:"-"` // 脚本文件
	ResultName string   `json:"-"` // 输出文件名
	Output     string   `json:"-"` // 输出文件
	Setting    *Setting `json:"-"` // 参数配置

	Template *Template            `json:"template" validate:"required"` // 模板
	Assets   []*Asset             `json:"assets" validate:"required"`   // 可替换资源
	Actions  map[string][]*Action `json:"actions" validate:"-"`         // Action

}

Job 任务

func CreateJob

func CreateJob(setting *Setting) (job *Job, err error)

CreateJob 创建任务

func (*Job) CleanUp

func (j *Job) CleanUp()

CleanUp 清理数据

func (*Job) CreateScriptFile

func (j *Job) CreateScriptFile() error

CreateScriptFile 生成脚本文件

func (*Job) Fetch

func (j *Job) Fetch() (err error)

Fetch 获取资源

func (*Job) Invoke

func (j *Job) Invoke(actionType string) (err error)

Invoke 调用Action

func (*Job) Parse

func (j *Job) Parse(s string)

func (*Job) Render

func (j *Job) Render() (err error)

Render 执行渲染

func (*Job) Run

func (j *Job) Run() (err error)

Run 执行

type Setting

type Setting struct {
	Config                string // JSON配置
	ConfigFile            string // JSON配置文件
	Binary                string // AeRender文件位置
	WorkPath              string // 运行目录
	NoLicense             bool   // 不需要license
	SkipCleanup           bool   // 不清理缓存目录
	ForceCommandLinePatch bool   // 补丁
	Debug                 bool   // 调试模式
	LogFile               string // 日志输出文件
	MultiFrames           bool
	Reuse                 bool
	StopOnError           bool
	MaxMemoryPercent      int
	ImageCachePercent     int
}

Setting 参数

func (*Setting) Setup

func (s *Setting) Setup() (job *Job, err error)

Setup 配置

type Template

type Template struct {
	Src         string `json:"src" validate:"required"`         // 文件
	Composition string `json:"composition" validate:"required"` // 合成
	Dest        string `json:"dest"`                            // 输出

	FrameStart     string `json:"frame_start"`     // -s 开始帧
	FrameEnd       string `json:"frame_end"`       // -e 结束
	IncrementFrame string `json:"increment_frame"` // -i

	ContinueOnMissing bool   `json:"continue_on_missing"` //
	SettingsTemplate  string `json:"settings_template"`   // - RStemplate
	OutputModule      string `json:"output_module"`       // - OMtemplate
	OutputExt         string `json:"output_ext"`          // 输出视频后缀
	ImageSequence     bool   `json:"image_sequence"`      // 图片序列帧
}

Template 素材模板

func (*Template) Fetch

func (t *Template) Fetch(saveDir string) error

Fetch 抓取资源

func (*Template) GetOutputExt

func (t *Template) GetOutputExt() string

GetOutputExt 渲染视频后缀

func (*Template) IsRenderImageSequence

func (t *Template) IsRenderImageSequence() bool

IsRenderImageSequence 是否渲染序列帧

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL