Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add transitions between clips #13

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: git checkout master
- uses: BobAnkh/[email protected]
with:
CONTRIBUTOR: "## Contributors"
CONTRIBUTOR: "## 🤝 Contributors"
COLUMN_PER_ROW: "6"
ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
IMG_WIDTH: "100"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ginkgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.*
Expand All @@ -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
Expand All @@ -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.*
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ 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.*
**/*.go

- 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
version: v1.52.2
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -78,7 +90,8 @@
"webm",
"wipeleft",
"xfade",
"yuva"
"yuva",
"zoomin"
],
"go.lintTool": "golangci-lint",
"go.lintOnSave": "workspace"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .
Expand Down
48 changes: 26 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,27 @@ 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.

Everything in ShotStack is Open Source, except the Dashboard and the backend server.

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)
Expand All @@ -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:[email protected]/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` 😇.
Expand All @@ -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 | |
Expand Down Expand Up @@ -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.

Expand All @@ -111,80 +113,82 @@ 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:

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:

```
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

<table>
<tr>
Expand Down
Loading
Loading