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