diff --git a/.github/workflows/contributors.yml b/.github/workflows/contributors.yml
index 36e6ca2..aa10b57 100644
--- a/.github/workflows/contributors.yml
+++ b/.github/workflows/contributors.yml
@@ -24,7 +24,7 @@ jobs:
run: git checkout master
- uses: BobAnkh/add-contributors@v0.2.2
with:
- CONTRIBUTOR: "## Contributors"
+ CONTRIBUTOR: "## 🤝 Contributors"
COLUMN_PER_ROW: "6"
ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
IMG_WIDTH: "100"
diff --git a/.github/workflows/ginkgo.yml b/.github/workflows/ginkgo.yml
index 72b3857..b15477e 100644
--- a/.github/workflows/ginkgo.yml
+++ b/.github/workflows/ginkgo.yml
@@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-go@v3
with:
- go-version: 1.18
+ go-version: 1.19
- name: Checkout
uses: actions/checkout@v3
@@ -25,7 +25,7 @@ jobs:
- name: Get changed files
id: changed-files
- uses: tj-actions/changed-files@v14.1
+ uses: tj-actions/changed-files@v35.9.2
with:
files: |
go.*
@@ -44,7 +44,7 @@ jobs:
- uses: actions/setup-go@v3
with:
- go-version: '1.18'
+ go-version: '1.19'
- name: Checkout
uses: actions/checkout@v3
@@ -53,7 +53,7 @@ jobs:
- name: Get changed files
id: changed-files
- uses: tj-actions/changed-files@v14.1
+ uses: tj-actions/changed-files@v35.9.2
with:
files: |
go.*
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
index 340ab19..419c996 100644
--- a/.github/workflows/golangci-lint.yml
+++ b/.github/workflows/golangci-lint.yml
@@ -16,14 +16,14 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
- go-version: 1.18
+ go-version: 1.19
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
- uses: tj-actions/changed-files@v14.1
+ uses: tj-actions/changed-files@v35.9.2
with:
files: |
go.*
@@ -31,6 +31,6 @@ jobs:
- name: golangci-lint
if: steps.changed-files.outputs.any_changed == 'true'
- uses: golangci/golangci-lint-action@v3.2.0
+ uses: golangci/golangci-lint-action@v3.4.0
with:
- version: v1.48.0
\ No newline at end of file
+ version: v1.52.2
\ No newline at end of file
diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml
index f8177f8..80c7549 100644
--- a/.github/workflows/goreleaser.yml
+++ b/.github/workflows/goreleaser.yml
@@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-go@v3
with:
- go-version: 1.18
+ go-version: 1.19
- name: Compile the source
uses: goreleaser/goreleaser-action@v2
diff --git a/.golangci.yml b/.golangci.yml
index 81d463a..fd11a22 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -11,12 +11,9 @@ linters:
- staticcheck
- unused
- gosimple
- - structcheck # waiting for compatibility with Go 1.18
- - varcheck
- ineffassign
- - deadcode
- typecheck
- - bodyclose # waiting for compatibility with Go 1.18
+ - bodyclose # waiting for compatibility with Go 1.19
- revive
- stylecheck
- gosec
@@ -30,7 +27,7 @@ linters:
- depguard
- misspell
- lll
- - unparam # waiting for compatibility with Go 1.18
+ - unparam # waiting for compatibility with Go 1.19
- dogsled
# - funlen
- gochecknoinits
diff --git a/.goreleaser.yml b/.goreleaser.yml
index 36e858f..ffa0308 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -33,6 +33,9 @@ changelog:
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
+ - title: 'Chores'
+ regexp: "^.*chore[(\\w)]*:+.*$"
+ order: 2
- title: Others
order: 999
sort: asc
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 214ee3e..c1342da 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -25,17 +25,24 @@
"gochecknoglobals",
"gochecknoinits",
"gocognit",
+ "goconst",
"gocritic",
"gocyclo",
"godox",
"gofmt",
"goimports",
+ "golangci",
"golint",
+ "gomega",
"goreleaser",
+ "gosec",
+ "gosimple",
"govet",
"greyscale",
+ "horz",
"HTMLAsset",
"imageasset",
+ "incpatch",
"ineffassign",
"kenburns",
"lavfi",
@@ -48,17 +55,22 @@
"nakedret",
"nilerr",
"noctx",
+ "nolint",
+ "onsi",
"openapi",
"overfiller",
"Pexels",
+ "pixelize",
"prealloc",
"Rémy",
"scopelint",
"setpts",
"Shotstack",
"shottower",
+ "Slowloris",
"STARTPTS",
"staticcheck",
+ "strack",
"structcheck",
"stylecheck",
"titleasset",
@@ -78,7 +90,8 @@
"webm",
"wipeleft",
"xfade",
- "yuva"
+ "yuva",
+ "zoomin"
],
"go.lintTool": "golangci-lint",
"go.lintOnSave": "workspace"
diff --git a/Dockerfile b/Dockerfile
index 322079a..da765cc 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM golang:1.18 AS build
+FROM golang:1.19 AS build
WORKDIR /go/src
COPY go ./go
COPY main.go .
diff --git a/README.md b/README.md
index edee65d..6512af3 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ An open source, self-hosted implementation of the Shotstack backend server.
Join our [Discord](https://discord.gg/GCXCNHRC) server for a chat.
-## What is ShotStack
+## 🔍 What is ShotStack
ShotStack is a video editing API that allow to build dynamic Video Applications at Scale.
@@ -21,18 +21,19 @@ Everything in ShotStack is Open Source, except the Dashboard and the backend ser
The backend server translate JSON to FFMPEG commands and serve the result.
-## Design goal
+## 🎯 Design goal
`shottower` aims to implement a self-hosted, open source alternative to the Shotstack backend server. `shottower` has a narrower scope and are not built for heavy transcode (but pull request are welcome!).
`shottower` uses terms that maps to Shotstack's API, consult the glossary for explanations.
-## Support
+
+## 🙏 Support
If you like `shottower` and find it useful, there is a sponsorship and donation buttons available in the repo.
If you would like to sponsor features, bugs or prioritization, reach out to one of the maintainers.
-## Features (Basic + Exclusive 😎)
+## 💡 Features (Basic + Exclusive 😎)
* "Basic" (`Track`, `Clip`, `VideoAsset`, ...) support of Shotstack's features (See bellow for progress)
* Use only the `stage` endpoint value until all features are implemented (See https://github.com/DblK/shottower/issues/1 for multiple endpoint handling)
@@ -41,10 +42,11 @@ If you would like to sponsor features, bugs or prioritization, reach out to one
* 😎 Add an endpoint `/dl/{version}/renders/:id` to download renders (instead of cdn/s3)
* 😎 Add other values for resolution (`360`, `480`, `540`, `720`) all with default `25 fps`.
* 😎 Add other values for output quality (`highest`, `lowest`).
+* 😎 Add missing transitions from `ffmpeg` (`fadeBlack`, `fadeWhite`, `distance`, `wipeUp`, `wipeDown`, `smoothLeft`, `smoothRight`, `smoothUp`, `smoothDown`, `circleCrop`, `rectCrop`, `circleClose`, `circleOpen`, `horzClose`, `horzOpen`, `vertClose`, `vertOpen`, `diagBottomLeft`, `diagBottomRight`, `diagTopLeft`, `diagTopRight`, `horizontalLeftSlice`, `horizontalRightSlice`, `verticalUpSlice`, `verticalDownSlice`, `dissolve`, `pixelize`, `radial`, `horizontalBlur`, `wipeTopLeft`, `wipeTopRight`, `wipeBottomLeft`, `wipeBottomRight`, `fadeGrays`, `squeezeVertical`, `squeezeHorizontal`)
* [`Planned`] Allow to use ftp file from `url` filed (`ftp://user:password@dblk.org/mypath/my_asset`)
* [`Planned`] Add destination to Youtube
-### Shotstack implementation progress
+### 🏃🏻♂️ Shotstack implementation progress
In the following matrix, there is only components than their implementation have been started.
At the end of the road this section should either disappear or be full of `Yes` 😇.
@@ -64,7 +66,7 @@ At the end of the road this section should either disappear or be full of `Yes`
| Clip | scale | Yes ✅| |
| Clip | position | Yes ✅ | |
| Clip | offset | Not yet | |
-| Clip | transition | Not yet | |
+| Clip | transition | Partial 🛠 | Missing `shuffleXXX` transitions |
| Clip | effect | Not yet | |
| Clip | filter | Not yet | |
| Clip | opacity | Not yet | |
@@ -93,7 +95,7 @@ At the end of the road this section should either disappear or be full of `Yes`
| Output | destinations | Not yet | |
| Callback | | Yes ✅ | |
-#### Endpoint implementation
+#### 𐫰 Endpoint implementation
There are several endpoints that are available but not all of them are implemented.
@@ -111,20 +113,21 @@ There are several endpoints that are available but not all of them are implement
| Serve | Get Asset | Partial 🛠 | |
| Serve | Delete Asset | Not yet | |
| Serve | Get Asset by Render ID | Not yet | |
-## Running shottower
+
+## 📄 Running shottower
Please have a look at the documentation under `docs/`.
-## Disclaimer
+## ⚠️ Disclaimer
1. We have nothing to do with shotstack
2. The purpose of ShotTower is maintaining a working, self-hosted Shotstack api compatible backend.
-## Contributing
+## 👨🏻💻 Contributing
To contribute to shottower you would need the latest version of Go.
-### Code style
+### 🏛️ Code style
To ensure we have some consistency with contributions, this project has adopted linting and style/formatting rules:
@@ -132,41 +135,42 @@ The **Go** code is linted with [`golangci-lint`](https://golangci-lint.run).
Check out the `.golangci.yml` to see the specific configuration.
-### Commit message
+### ✏️ Commit message
To ensure, the changelog are well generated, please use prefix in your commit message as follow:
- `feat`, `features`, `feature`: For new features
- `fix`: For any fix
+- `chore`: For golang updates or dep updates
- `doc`, `docs`: For any update in documentation (README, etc...)
And if you `really` need to commit something that is not working `wip` ou `test` are your friends.
-### Install development tools
-* [Go 1.18](https://go.dev/doc/install)
+### 🛠️ Install development tools
+* [Go 1.19](https://go.dev/doc/install)
* [FFMPEG (v5 or up)](https://ffmpeg.org/download.html)
* [gifski](https://github.com/ImageOptim/gifski) (For high quality GIF)
* [ginkgo](https://onsi.github.io/ginkgo/#installing-ginkgo)
* [golangci-lint](https://golangci-lint.run/usage/install/)
* (optional) I recommend using [gow](https://github.com/mitranim/gow)
-### Testing and building
+### 🧪 Testing and 🧱 building
To run the tests (solo execution):
-```golang
+```bash
ginkgo -r --randomize-all --randomize-suites --race --trace -cover
```
To run the tests during development:
-```golang
+```bash
ginkgo watch -r --randomize-all --race --trace
```
To build the program:
-```golang
+```bash
go build
```
-### Running the server
+### 💻 Running the server
To run the server, follow these simple steps:
@@ -174,17 +178,17 @@ To run the server, follow these simple steps:
go run main.go
```
-To run the server in a docker container
+To run the server in a docker container (⚠️ Image should not fully work see [#2](https://github.com/DblK/shottower/issues/2)):
```
docker build --network=host -t shottower .
```
-Once image is built use
+Once image is built use:
```
docker run --rm -it shottower
```
-## Contributors
+## 🤝 Contributors
diff --git a/api/openapi.yaml b/api/openapi.yaml
index 9ce62c4..da5f590 100644
--- a/api/openapi.yaml
+++ b/api/openapi.yaml
@@ -1,6 +1,6 @@
openapi: 3.0.0
info:
- description: "Shottowwer is the open source version of Shotstack which is a video, image and audio editing service that allows\
+ description: "Shottower is the open source version of Shotstack which is a video, image and audio editing service that allows\
\ for the automated\ngeneration of videos, images and audio using JSON and a RESTful\
\ API.\n\nYou arrange and configure an edit and POST it to the API which will\
\ render your media and provide a file \nlocation when complete.\n\nFor more details\
@@ -1402,6 +1402,114 @@ components:
- shuffleTopLeftSlow
- shuffleTopLeftFast
- zoom
+ - fadeBlack
+ - fadeBlackSlow
+ - fadeBlackFast
+ - fadeWhite
+ - fadeWhiteSlow
+ - fadeWhiteFast
+ - distance
+ - distanceSlow
+ - distanceFast
+ - wipeUp
+ - wipeUpSlow
+ - wipeUpFast
+ - wipeDown
+ - wipeDownSlow
+ - wipeDownFast
+ - smoothLeft
+ - smoothLeftSlow
+ - smoothLeftFast
+ - smoothRight
+ - smoothRightSlow
+ - smoothRightFast
+ - smoothUp
+ - smoothUpSlow
+ - smoothUpFast
+ - smoothDown
+ - smoothDownSlow
+ - smoothDownFast
+ - circleCrop
+ - circleCropSlow
+ - circleCropFast
+ - rectCrop
+ - rectCropSlow
+ - rectCropFast
+ - circleClose
+ - circleCloseSlow
+ - circleCloseFast
+ - circleOpen
+ - circleOpenSlow
+ - circleOpenFast
+ - horzClose
+ - horzCloseSlow
+ - horzCloseFast
+ - horzOpen
+ - horzOpenSlow
+ - horzOpenFast
+ - vertClose
+ - vertCloseSlow
+ - vertCloseFast
+ - vertOpen
+ - vertOpenSlow
+ - vertOpenFast
+ - diagBottomLeft
+ - diagBottomLeftSlow
+ - diagBottomLeftFast
+ - diagBottomRight
+ - diagBottomRightSlow
+ - diagBottomRightFast
+ - diagTopLeft
+ - diagTopLeftSlow
+ - diagTopLeftFast
+ - diagTopRight
+ - diagTopRightSlow
+ - diagTopRightFast
+ - horizontalLeftSlice
+ - horizontalLeftSliceSlow
+ - horizontalLeftSliceFast
+ - horizontalRightSlice
+ - horizontalRightSliceSlow
+ - horizontalRightSliceFast
+ - verticalUpSlice
+ - verticalUpSliceSlow
+ - verticalUpSliceFast
+ - verticalDownSlice
+ - verticalDownSliceSlow
+ - verticalDownSliceFast
+ - dissolve
+ - dissolveSlow
+ - dissolveFast
+ - pixelize
+ - pixelizeSlow
+ - pixelizeFast
+ - radial
+ - radialSlow
+ - radialFast
+ - horizontalBlur
+ - horizontalBlurSlow
+ - horizontalBlurFast
+ - wipeTopLeft
+ - wipeTopLeftSlow
+ - wipeTopLeftFast
+ - wipeTopRight
+ - wipeTopRightSlow
+ - wipeTopRightFast
+ - wipeBottomLeft
+ - wipeBottomLeftSlow
+ - wipeBottomLeftFast
+ - wipeBottomRight
+ - wipeBottomRightSlow
+ - wipeBottomRightFast
+ - fadeGrays
+ - fadeGraysSlow
+ - fadeGraysFast
+ - squeezeVertical
+ - squeezeVerticalSlow
+ - squeezeVerticalFast
+ - squeezeHorizontal
+ - squeezeHorizontalSlow
+ - squeezeHorizontalFast
type: string
out:
description: "The transition out. Available transitions are:\n \n \
@@ -1486,6 +1594,114 @@ components:
- shuffleTopLeftSlow
- shuffleTopLeftFast
- zoom
+ - fadeBlack
+ - fadeBlackSlow
+ - fadeBlackFast
+ - fadeWhite
+ - fadeWhiteSlow
+ - fadeWhiteFast
+ - distance
+ - distanceSlow
+ - distanceFast
+ - wipeUp
+ - wipeUpSlow
+ - wipeUpFast
+ - wipeDown
+ - wipeDownSlow
+ - wipeDownFast
+ - smoothLeft
+ - smoothLeftSlow
+ - smoothLeftFast
+ - smoothRight
+ - smoothRightSlow
+ - smoothRightFast
+ - smoothUp
+ - smoothUpSlow
+ - smoothUpFast
+ - smoothDown
+ - smoothDownSlow
+ - smoothDownFast
+ - circleCrop
+ - circleCropSlow
+ - circleCropFast
+ - rectCrop
+ - rectCropSlow
+ - rectCropFast
+ - circleClose
+ - circleCloseSlow
+ - circleCloseFast
+ - circleOpen
+ - circleOpenSlow
+ - circleOpenFast
+ - horzClose
+ - horzCloseSlow
+ - horzCloseFast
+ - horzOpen
+ - horzOpenSlow
+ - horzOpenFast
+ - vertClose
+ - vertCloseSlow
+ - vertCloseFast
+ - vertOpen
+ - vertOpenSlow
+ - vertOpenFast
+ - diagBottomLeft
+ - diagBottomLeftSlow
+ - diagBottomLeftFast
+ - diagBottomRight
+ - diagBottomRightSlow
+ - diagBottomRightFast
+ - diagTopLeft
+ - diagTopLeftSlow
+ - diagTopLeftFast
+ - diagTopRight
+ - diagTopRightSlow
+ - diagTopRightFast
+ - horizontalLeftSlice
+ - horizontalLeftSliceSlow
+ - horizontalLeftSliceFast
+ - horizontalRightSlice
+ - horizontalRightSliceSlow
+ - horizontalRightSliceFast
+ - verticalUpSlice
+ - verticalUpSliceSlow
+ - verticalUpSliceFast
+ - verticalDownSlice
+ - verticalDownSliceSlow
+ - verticalDownSliceFast
+ - dissolve
+ - dissolveSlow
+ - dissolveFast
+ - pixelize
+ - pixelizeSlow
+ - pixelizeFast
+ - radial
+ - radialSlow
+ - radialFast
+ - horizontalBlur
+ - horizontalBlurSlow
+ - horizontalBlurFast
+ - wipeTopLeft
+ - wipeTopLeftSlow
+ - wipeTopLeftFast
+ - wipeTopRight
+ - wipeTopRightSlow
+ - wipeTopRightFast
+ - wipeBottomLeft
+ - wipeBottomLeftSlow
+ - wipeBottomLeftFast
+ - wipeBottomRight
+ - wipeBottomRightSlow
+ - wipeBottomRightFast
+ - fadeGrays
+ - fadeGraysSlow
+ - fadeGraysFast
+ - squeezeVertical
+ - squeezeVerticalSlow
+ - squeezeVerticalFast
+ - squeezeHorizontal
+ - squeezeHorizontalSlow
+ - squeezeHorizontalFast
type: string
type: object
Offset:
diff --git a/config/config.go b/config/config.go
index b9d3bc0..93617cf 100644
--- a/config/config.go
+++ b/config/config.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -24,6 +24,8 @@ const (
Stage
)
+var conf *ShottowerConfig
+
func (s EndpointType) String() string {
switch s {
case V1:
@@ -48,11 +50,25 @@ type ShottowerConfig struct {
endpointType EndpointType
}
-func NewShottowerConfig(baseURL string, endpointType EndpointType) ShottowerConfiguration {
- return &ShottowerConfig{
+func Init(baseURL string, endpointType EndpointType) error {
+
+ // viper.SetConfigName("config")
+
+ // https://github.com/TakasBU/TakasBU/blob/main/initializers/loadEnv.go
+ // https://github.com/laixhe/goimg/blob/c27cdb95bdf9b09f36589c2d465c7a6ebdd44b92/config/config.go
+ // https://github.com/Bikram-Gyawali/LearningGoLang/blob/17f5c3a1048f4857e31652d3a139253be68ec9a9/day24_viper/utils/config.go
+ // https://articles.wesionary.team/environment-variable-configuration-in-your-golang-project-using-viper-4e8289ef664d
+
+ conf = &ShottowerConfig{
rootURL: baseURL,
endpointType: endpointType,
}
+
+ return nil
+}
+
+func Get() *ShottowerConfig {
+ return conf
}
func (s *ShottowerConfig) GetRootURL() string {
diff --git a/go.mod b/go.mod
index c9348b1..9c32058 100644
--- a/go.mod
+++ b/go.mod
@@ -1,19 +1,20 @@
module github.com/DblK/shottower
-go 1.18
+go 1.19
require (
github.com/creasty/defaults v1.6.0
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.7.3
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.20.0
+ github.com/onsi/ginkgo/v2 v2.6.1
+ github.com/onsi/gomega v1.24.2
github.com/spf13/cast v1.5.0
golang.org/x/exp v0.0.0-20220613132600-b0d781184e0d
)
require (
- github.com/google/go-cmp v0.5.8 // indirect
+ github.com/go-logr/logr v1.2.3 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
diff --git a/go.sum b/go.sum
index c2776e7..617c3cc 100644
--- a/go.sum
+++ b/go.sum
@@ -1,19 +1,21 @@
github.com/creasty/defaults v1.6.0 h1:ltuE9cfphUtlrBeomuu8PEyISTXnxqkBIoQfXgv7BSc=
github.com/creasty/defaults v1.6.0/go.mod h1:iGzKe6pbEHnpMPtfDXZEr0NVxWnPTjb1bbDy08fPzYM=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
+github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
+github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
-github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
-github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY=
-github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
-github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q=
-github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo=
+github.com/onsi/ginkgo/v2 v2.6.1 h1:1xQPCjcqYw/J5LchOcp4/2q/jzJFjiAOc25chhnDw+Q=
+github.com/onsi/ginkgo/v2 v2.6.1/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo=
+github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE=
+github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
diff --git a/go/api.go b/go/api.go
index 0bab337..6133489 100644
--- a/go/api.go
+++ b/go/api.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/api_download.go b/go/api_download.go
index 295e67e..fb7ee8f 100644
--- a/go/api_download.go
+++ b/go/api_download.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/api_download_service.go b/go/api_download_service.go
index 111b132..353ec34 100644
--- a/go/api_download_service.go
+++ b/go/api_download_service.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/api_edit.go b/go/api_edit.go
index 99e45bb..e74f9e0 100644
--- a/go/api_edit.go
+++ b/go/api_edit.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/api_edit_service.go b/go/api_edit_service.go
index bdf579d..e73f32b 100644
--- a/go/api_edit_service.go
+++ b/go/api_edit_service.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/api_serve.go b/go/api_serve.go
index f62982a..17fbf05 100644
--- a/go/api_serve.go
+++ b/go/api_serve.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/api_serve_service.go b/go/api_serve_service.go
index d645787..10493b0 100644
--- a/go/api_serve_service.go
+++ b/go/api_serve_service.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/error.go b/go/error.go
index 62bd5bc..91ec633 100644
--- a/go/error.go
+++ b/go/error.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/ffmpeg.go b/go/ffmpeg.go
index dd60c04..1e6f0ad 100644
--- a/go/ffmpeg.go
+++ b/go/ffmpeg.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -548,8 +548,7 @@ func (s *FFMPEG) ToFFMPEG(renderQueue *RenderQueue, queue *ProcessingQueue) erro
_ = s.AddTrack(trackNumber)
for iClip, clip := range track.Clips {
- // for cIndex, clip := range track.Clips {
- // fmt.Println(cIndex)
+ // fmt.Println(iClip)
if clip.Start > lastStart {
// fmt.Println("Add filler clip")
@@ -643,6 +642,12 @@ func (s *FFMPEG) toStringHandleSource(parameters []string) []string {
parameters = append(parameters, s.GenerateFiller("pink@.0"))
}
+ // Add transparent source for transition
+ parameters = append(parameters, "-f")
+ parameters = append(parameters, "lavfi")
+ parameters = append(parameters, "-i")
+ parameters = append(parameters, s.GenerateFiller("blue@.0"))
+
// Add background source
parameters = append(parameters, "-f")
parameters = append(parameters, "lavfi")
@@ -690,6 +695,11 @@ func (s *FFMPEG) ToString() []string {
"[" + cast.ToString(maxSource+addedSources) + "] concat=n=1:v=1,setpts=PTS-STARTPTS,format=yuva420p [overfiller" + cast.ToString(i) + "];"
}
}
+
+ // Add transition stream
+ addedSources = addedSources + 1
+ filterComplex = filterComplex + "[" + cast.ToString(maxSource+addedSources) + "] concat=n=1:v=1,setpts=PTS-STARTPTS,format=yuv420p [transition0]; [transition0] trim=start=0:end=" + cast.ToString(s.duration) + " [transition];"
+
// Add background stream
addedSources = addedSources + 1
filterComplex = filterComplex + "[" + cast.ToString(maxSource+addedSources) + "] concat=n=1:v=1,setpts=PTS-STARTPTS,format=yuv420p [bg0]; [bg0] trim=start=0:end=" + cast.ToString(s.duration) + " [bg];"
diff --git a/go/ffmpeg_test.go b/go/ffmpeg_test.go
index 22c12f3..8e54639 100644
--- a/go/ffmpeg_test.go
+++ b/go/ffmpeg_test.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -276,4 +276,41 @@ var _ = Describe("Ffmpeg", func() {
Expect(res).To(Equal("[1:a] atrim=start=5:end=9.96, asetpts=PTS-STARTPTS [atrack0c1p0];[atrack0c1p0] volume=0.5 [atrack0c1p1];[filler] [atrack0c1p1] amix=inputs=2 [atrack0c1];"))
})
})
+ Describe("ClipSubtitleBurn", func() {
+ var ff openapi.FFMPEGCommand
+ BeforeEach(func() {
+ ff = openapi.NewFFMPEGCommand()
+ _ = ff.AddSource("/dev/test.mkv", false)
+ })
+
+ It("Should merge subtitle track with video", func() {
+ var sourceClip = 0
+ var trackNumber = 0
+ var clipNumber = 0
+ var index = 0
+
+ res := ff.ClipSubtitleBurn(sourceClip, trackNumber, clipNumber, index)
+ Expect(res).To(Equal("subtitles='/dev/test.mkv':stream_index=0[strack0c0]; [0:v] [strack0c0] overlay [vtrack0c0];"))
+ })
+ })
+ XDescribe("CloseTrack", func() {
+ var ff openapi.FFMPEGCommand
+ BeforeEach(func() {
+ ff = openapi.NewFFMPEGCommand()
+ _ = ff.AddSource("/dev/test.mkv", false)
+ })
+
+ It("Should merge subtitle track with video", func() {
+ // var sourceClip = 0
+ var trackNumber = 0
+ // var clipNumber = 0
+ // var index = 0
+ _ = ff.AddTrack(trackNumber)
+ _ = ff.AddClip(trackNumber, "[0] concat=n=1:v=1,setpts=PTS-STARTPTS,format=yuva420p [filler1];")
+ _ = ff.AddClip(trackNumber, "[1] concat=n=1:v=1,setpts=PTS-STARTPTS,format=yuva420p [filler2];")
+ _ = ff.CloseTrack(trackNumber)
+ res := ff.ToString()
+ Expect(res).To(BeNil())
+ })
+ })
})
diff --git a/go/go_suite_test.go b/go/go_suite_test.go
index ce57858..a6f0008 100644
--- a/go/go_suite_test.go
+++ b/go/go_suite_test.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/helpers.go b/go/helpers.go
index 45036e3..9784b5d 100644
--- a/go/helpers.go
+++ b/go/helpers.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/impl.go b/go/impl.go
index 9e9ec6c..c8ad107 100644
--- a/go/impl.go
+++ b/go/impl.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/logger.go b/go/logger.go
index 94f2f3f..5e45b00 100644
--- a/go/logger.go
+++ b/go/logger.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_asset.go b/go/model_asset.go
index 6865080..b226b23 100644
--- a/go/model_asset.go
+++ b/go/model_asset.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_asset_render_response.go b/go/model_asset_render_response.go
index 9d2a8e7..f17d49a 100644
--- a/go/model_asset_render_response.go
+++ b/go/model_asset_render_response.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_asset_response.go b/go/model_asset_response.go
index d901aad..a2ae078 100644
--- a/go/model_asset_response.go
+++ b/go/model_asset_response.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_asset_response_attributes.go b/go/model_asset_response_attributes.go
index 11d30f7..795b0d0 100644
--- a/go/model_asset_response_attributes.go
+++ b/go/model_asset_response_attributes.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_asset_response_data.go b/go/model_asset_response_data.go
index af15c36..8bdaa82 100644
--- a/go/model_asset_response_data.go
+++ b/go/model_asset_response_data.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_audio_asset.go b/go/model_audio_asset.go
index 733fdce..627668f 100644
--- a/go/model_audio_asset.go
+++ b/go/model_audio_asset.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_clip.go b/go/model_clip.go
index a23719c..b264917 100644
--- a/go/model_clip.go
+++ b/go/model_clip.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -211,6 +211,14 @@ func (s *Clip) ToFFMPEG(FFMPEGCommand FFMPEGCommand, sourceClip int, trackNumber
effects = append(effects, FFMPEGCommand.ClipResize(sourceClip, trackNumber, currentClip, 1))
}
+ // Apply Transition between clip and transparent reference
+ if s.Transition != nil {
+ // Use the invisible source "transition" to make the effect based on the current clip and the transparent one
+ // start = invisible + clip
+ // end = clip + invisible
+ fmt.Println("here")
+ }
+
_ = FFMPEGCommand.AddClip(
trackNumber,
FFMPEGCommand.ClipMerge(sourceClip, trackNumber, currentClip, effects),
diff --git a/go/model_crop.go b/go/model_crop.go
index 08a70d2..1100b54 100644
--- a/go/model_crop.go
+++ b/go/model_crop.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_destinations.go b/go/model_destinations.go
index 761c388..1839586 100644
--- a/go/model_destinations.go
+++ b/go/model_destinations.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_edit.go b/go/model_edit.go
index f0458e6..89db44b 100644
--- a/go/model_edit.go
+++ b/go/model_edit.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_ffmpeg.go b/go/model_ffmpeg.go
index a4612ba..045ebfc 100644
--- a/go/model_ffmpeg.go
+++ b/go/model_ffmpeg.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_flip_transformation.go b/go/model_flip_transformation.go
index ec4d85c..d15b36e 100644
--- a/go/model_flip_transformation.go
+++ b/go/model_flip_transformation.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_font.go b/go/model_font.go
index 3f4bd38..3de5401 100644
--- a/go/model_font.go
+++ b/go/model_font.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_html_asset.go b/go/model_html_asset.go
index 7ec8e6f..2cb88b4 100644
--- a/go/model_html_asset.go
+++ b/go/model_html_asset.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_image_asset.go b/go/model_image_asset.go
index ca167b7..e5255b5 100644
--- a/go/model_image_asset.go
+++ b/go/model_image_asset.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_localresource.go b/go/model_localresource.go
index c57be5b..f7ee2b9 100644
--- a/go/model_localresource.go
+++ b/go/model_localresource.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_luma_asset.go b/go/model_luma_asset.go
index 83a88c6..b6ea0a3 100644
--- a/go/model_luma_asset.go
+++ b/go/model_luma_asset.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_merge_field.go b/go/model_merge_field.go
index 8555ef6..dc6a642 100644
--- a/go/model_merge_field.go
+++ b/go/model_merge_field.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_mux_destination.go b/go/model_mux_destination.go
index e8c548b..d6efdfa 100644
--- a/go/model_mux_destination.go
+++ b/go/model_mux_destination.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_mux_destination_options.go b/go/model_mux_destination_options.go
index 1006d3d..6ce0cbe 100644
--- a/go/model_mux_destination_options.go
+++ b/go/model_mux_destination_options.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_offset.go b/go/model_offset.go
index d8f9219..6598c3c 100644
--- a/go/model_offset.go
+++ b/go/model_offset.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_output.go b/go/model_output.go
index e793f8f..ee7ff27 100644
--- a/go/model_output.go
+++ b/go/model_output.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_poster.go b/go/model_poster.go
index b37fe55..4355f30 100644
--- a/go/model_poster.go
+++ b/go/model_poster.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_probe_response.go b/go/model_probe_response.go
index 37c604d..2481835 100644
--- a/go/model_probe_response.go
+++ b/go/model_probe_response.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_queued_response.go b/go/model_queued_response.go
index 998e35d..482da72 100644
--- a/go/model_queued_response.go
+++ b/go/model_queued_response.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_queued_response_data.go b/go/model_queued_response_data.go
index f881979..2b41f1d 100644
--- a/go/model_queued_response_data.go
+++ b/go/model_queued_response_data.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_range.go b/go/model_range.go
index a10bf0d..4b0e3af 100644
--- a/go/model_range.go
+++ b/go/model_range.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_render_queue.go b/go/model_render_queue.go
index 26d875d..b863433 100644
--- a/go/model_render_queue.go
+++ b/go/model_render_queue.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_render_response.go b/go/model_render_response.go
index fb0ee15..5d95834 100644
--- a/go/model_render_response.go
+++ b/go/model_render_response.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_render_response_data.go b/go/model_render_response_data.go
index dab16f0..70da2a3 100644
--- a/go/model_render_response_data.go
+++ b/go/model_render_response_data.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_rotate_transformation.go b/go/model_rotate_transformation.go
index bd3da6c..39b09c3 100644
--- a/go/model_rotate_transformation.go
+++ b/go/model_rotate_transformation.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_shotstack_destination.go b/go/model_shotstack_destination.go
index 3bbbd6f..344e595 100644
--- a/go/model_shotstack_destination.go
+++ b/go/model_shotstack_destination.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_size.go b/go/model_size.go
index 4af01ae..96f8e8f 100644
--- a/go/model_size.go
+++ b/go/model_size.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_skew_transformation.go b/go/model_skew_transformation.go
index 40f3c67..3c32584 100644
--- a/go/model_skew_transformation.go
+++ b/go/model_skew_transformation.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_soundtrack.go b/go/model_soundtrack.go
index 109b2db..d27f8c4 100644
--- a/go/model_soundtrack.go
+++ b/go/model_soundtrack.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_subtitle.go b/go/model_subtitle.go
index 88369a5..21dda27 100644
--- a/go/model_subtitle.go
+++ b/go/model_subtitle.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_template.go b/go/model_template.go
index 05f3556..f4e3cf7 100644
--- a/go/model_template.go
+++ b/go/model_template.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_template_data_response.go b/go/model_template_data_response.go
index cbd8956..a51ba31 100644
--- a/go/model_template_data_response.go
+++ b/go/model_template_data_response.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_template_data_response_data.go b/go/model_template_data_response_data.go
index 637b919..e6482e2 100644
--- a/go/model_template_data_response_data.go
+++ b/go/model_template_data_response_data.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_template_list_response.go b/go/model_template_list_response.go
index 2061e48..d793fcb 100644
--- a/go/model_template_list_response.go
+++ b/go/model_template_list_response.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_template_list_response_data.go b/go/model_template_list_response_data.go
index 8c42983..abeda93 100644
--- a/go/model_template_list_response_data.go
+++ b/go/model_template_list_response_data.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_template_list_response_item.go b/go/model_template_list_response_item.go
index 1fd6d0d..6fbafcb 100644
--- a/go/model_template_list_response_item.go
+++ b/go/model_template_list_response_item.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_template_render.go b/go/model_template_render.go
index 3c515f8..bc3fa2a 100644
--- a/go/model_template_render.go
+++ b/go/model_template_render.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_template_response.go b/go/model_template_response.go
index 9e8fef1..d5abf73 100644
--- a/go/model_template_response.go
+++ b/go/model_template_response.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_template_response_data.go b/go/model_template_response_data.go
index 13e691d..357f061 100644
--- a/go/model_template_response_data.go
+++ b/go/model_template_response_data.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_thumbnail.go b/go/model_thumbnail.go
index 93bc8df..a4288e7 100644
--- a/go/model_thumbnail.go
+++ b/go/model_thumbnail.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_timeline.go b/go/model_timeline.go
index 8dfc200..f0e2be3 100644
--- a/go/model_timeline.go
+++ b/go/model_timeline.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_title_asset.go b/go/model_title_asset.go
index 965181a..e07c96f 100644
--- a/go/model_title_asset.go
+++ b/go/model_title_asset.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_track.go b/go/model_track.go
index 88a94e4..d04f3c4 100644
--- a/go/model_track.go
+++ b/go/model_track.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_transformation.go b/go/model_transformation.go
index 2b9d347..b209b83 100644
--- a/go/model_transformation.go
+++ b/go/model_transformation.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/model_transition.go b/go/model_transition.go
index 1ea3e53..812d850 100644
--- a/go/model_transition.go
+++ b/go/model_transition.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -26,7 +26,11 @@ along with this program. If not, see .
package openapi
-import "golang.org/x/exp/slices"
+import (
+ "strings"
+
+ "golang.org/x/exp/slices"
+)
// Transition - In and out transitions for a clip - i.e. fade in and fade out
type Transition struct {
@@ -50,14 +54,71 @@ func NewTransition(m map[string]interface{}) *Transition {
return transition
}
+func (s *Transition) ConvertTransitionName(t string) string {
+ newTransition := t
+
+ // shotstack renamed transitions
+ if newTransition[0:7] == "carousel" {
+ newTransition = strings.Replace(newTransition, "carousel", "slide", 1)
+ }
+ switch newTransition {
+ case "reveal":
+ newTransition = "wipeLeft"
+ case "zoom":
+ newTransition = "zoomIn"
+ // missing ffmpeg transitions
+ case "diagBottomLeft":
+ newTransition = "diagBl"
+ case "diagBottomRight":
+ newTransition = "diagBr"
+ case "diagTopLeft":
+ newTransition = "diagTl"
+ case "diagTopRight":
+ newTransition = "diagTr"
+ case "horizontalLeftSlice":
+ newTransition = "hlSlice"
+ case "horizontalRightSlice":
+ newTransition = "hrSlice"
+ case "verticalUpSlice":
+ newTransition = "vuSlice"
+ case "verticalDownSlice":
+ newTransition = "vdSlice"
+ case "horizontalBlur":
+ newTransition = "hBlur"
+ case "wipeTopLeft":
+ newTransition = "wipeTl"
+ case "wipeTopRight":
+ newTransition = "wipeTr"
+ case "wipeBottomLeft":
+ newTransition = "wipeBl"
+ case "wipeBottomRight":
+ newTransition = "wipeBr"
+ case "squeezeVertical":
+ newTransition = "squeezeV"
+ case "squeezeHorizontal":
+ newTransition = "squeezeH"
+ }
+
+ return strings.ToLower(newTransition)
+}
+
func (s *Transition) checkEnumValues() error {
- inValues := []string{"fade", "reveal", "wipeLeft", "wipeRight", "slideLeft", "slideRight", "slideUp", "slideDown", "carouselLeft", "carouselRight", "carouselUp", "carouselDown", "shuffleTopRight", "shuffleRightTop", "shuffleRightBottom", "shuffleBottomRight", "shuffleBottomLeft", "shuffleLeftBottom", "shuffleLeftTop", "zoom"}
- if s.In != "" && !slices.Contains(inValues, s.In) {
+ // TODO: Add unsupported "shuffleTopRight", "shuffleRightTop", "shuffleRightBottom", "shuffleBottomRight", "shuffleBottomLeft", "shuffleLeftBottom", "shuffleLeftTop"
+ values := []string{"fade", "reveal", "wipeLeft", "wipeRight", "slideLeft", "slideRight", "slideUp", "slideDown", "carouselLeft", "carouselRight", "carouselUp", "carouselDown", "zoom", "fadeBlack", "fadeWhite", "distance", "wipeUp", "wipeDown", "smoothLeft", "smoothRight", "smoothUp", "smoothDown", "circleCrop", "rectCrop", "circleClose", "circleOpen", "horzClose", "horzOpen", "vertClose", "vertOpen", "diagBottomLeft", "diagBottomRight", "diagTopLeft", "diagTopRight", "horizontalLeftSlice", "horizontalRightSlice", "verticalUpSlice", "verticalDownSlice", "dissolve", "pixelize", "radial", "horizontalBlur", "wipeTopLeft", "wipeTopRight", "wipeBottomLeft", "wipeBottomRight", "fadeGrays", "squeezeVertical", "squeezeHorizontal"}
+ valuesFast := []string{}
+ valuesSlow := []string{}
+ for _, value := range values {
+ if value != "zoom" {
+ valuesFast = append(valuesFast, value+"Fast")
+ valuesSlow = append(valuesSlow, value+"Slow")
+ }
+ }
+
+ if s.In != "" && !slices.Contains(values, s.In) && !slices.Contains(valuesFast, s.In) && !slices.Contains(valuesSlow, s.In) {
return &EnumError{Schema: "Transition", Field: "In", Value: s.In}
}
- outValues := []string{"fade", "reveal", "wipeLeft", "wipeRight", "slideLeft", "slideRight", "slideUp", "slideDown", "carouselLeft", "carouselRight", "carouselUp", "carouselDown", "shuffleTopRight", "shuffleRightTop", "shuffleRightBottom", "shuffleBottomRight", "shuffleBottomLeft", "shuffleLeftBottom", "shuffleLeftTop", "zoom"}
- if s.Out != "" && !slices.Contains(outValues, s.Out) {
+ if s.Out != "" && !slices.Contains(values, s.Out) && !slices.Contains(valuesFast, s.Out) && !slices.Contains(valuesSlow, s.Out) {
return &EnumError{Schema: "Transition", Field: "Out", Value: s.Out}
}
diff --git a/go/model_video_asset.go b/go/model_video_asset.go
index 43644e6..276a76f 100644
--- a/go/model_video_asset.go
+++ b/go/model_video_asset.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/go/queue.go b/go/queue.go
index 7eb8ab8..e8262d5 100644
--- a/go/queue.go
+++ b/go/queue.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -406,7 +406,7 @@ func (s *ProcessingQueue) DownloadFile(url string) (string, error) {
fmt.Println("----" + file.Name())
// Get the data
- resp, err := http.Get(url) // nolint:gosec,G107
+ resp, err := http.Get(url) // nolint:gosec
if err != nil {
return "", err
}
diff --git a/go/routers.go b/go/routers.go
index 844ef9e..ba72956 100644
--- a/go/routers.go
+++ b/go/routers.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
diff --git a/main.go b/main.go
index 9c7ffa0..6117bf9 100644
--- a/main.go
+++ b/main.go
@@ -1,6 +1,6 @@
/*
shottower
-Copyright (C) 2022 Rémy Boulanouar
+Copyright (C) 2022-2023 Rémy Boulanouar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -29,16 +29,23 @@ package main
import (
"log"
"net/http"
+ "time"
"github.com/DblK/shottower/config"
openapi "github.com/DblK/shottower/go"
)
func main() {
+ // TODO: Add test to main
+ // https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d
log.Printf("Server started")
- myConfig := config.NewShottowerConfig("http://0.0.0.0:4000", config.Stage)
+ // Find config file and load it!
+ // Use config
+ config.Init("http://0.0.0.0:4000", config.Stage)
+ myConfig := config.Get()
+ // TODO: Replace myConfig with call to config Package
EditAPIService := openapi.NewEditAPIService(myConfig)
EditAPIController := openapi.NewEditAPIController(EditAPIService)
@@ -53,5 +60,16 @@ func main() {
QueueService := openapi.NewProcessingQueuer(myConfig)
QueueService.StartProcessQueue(EditAPIService)
- log.Fatal(http.ListenAndServe(":4000", router))
+ server := &http.Server{
+ Handler: router,
+ Addr: ":4000",
+
+ // Good practice to set timeouts to avoid Slowloris attacks.
+ WriteTimeout: time.Second * 60,
+ ReadTimeout: time.Second * 15,
+ IdleTimeout: time.Second * 60,
+ }
+ log.Fatal(server.ListenAndServe())
+ // TODO: Add graceful shutdown
+ // https://github.com/miomiora/mio-init/blob/master/main.go
}