Add readme, license and screenshot. Update CLI banner.

This commit is contained in:
Alf
2021-03-07 12:40:17 -08:00
parent 1681bb7bce
commit f5a145fafb
4 changed files with 79 additions and 7 deletions

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Alfred Gutierrez
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,11 +1,59 @@
# `ffmpegd`
An FFmpeg server with a websocket API for [FFmpeg Commander](https://github.com/alfg/ffmpeg-commander).
The goal is to provide a simple interface for sending FFmpeg jobs from the browser (and other supported clients in the future) while reporting realtime progress details.
**Currently a work-in-progress!*
## Install
TODO
```
$ go get -u github.com/alfg/ffmpegd
```
Release binaries coming soon.
## Usage
TODO
* [ffmpeg](https://www.ffmpeg.org/download.html) must be installed and available on your `$PATH`.
* Run `ffmpegd`:
```
$ ffmpegd
```
This wil start the websocket server in your current working directory and wait for a connection.
* Go to https://alfg.github.io/ffmpeg-commander/ in the browser
* Enable `ffmpegd` in Options.
* Once connected, you can start sending encode jobs to ffmpegd!
## Example
### `ffmpegd` with a job in progress from `ffmpeg-commander`
```
$ ffmpegd
███████╗███████╗███╗ ███╗██████╗ ███████╗ ██████╗ ██████╗
██╔════╝██╔════╝████╗ ████║██╔══██╗██╔════╝██╔════╝ ██╔══██╗
█████╗ █████╗ ██╔████╔██║██████╔╝█████╗ ██║ ███╗██║ ██║
██╔══╝ ██╔══╝ ██║╚██╔╝██║██╔═══╝ ██╔══╝ ██║ ██║██║ ██║
██║ ██║ ██║ ╚═╝ ██║██║ ███████╗╚██████╔╝██████╔╝
╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚══════╝ ╚═════╝ ╚═════╝
v0.0.1
[ffmpegd] - websocket server for ffmpeg-commander.
Server started on port :8080.
Go to https://alfg.github.io/ffmpeg-commander to connect!
Encoding... 6111 / 17620 (34.68%) 3.37x @ 80.77
```
![ffmpeg-commander](screenshot.png)
## TODO
* Support all `ffmpeg-comamnder` JSON options.
* More CLI flags for server, ports, cwd and daemon mode.
* Logging options and output
* API documentation
* Docker
## License
MIT

13
main.go
View File

@@ -19,15 +19,15 @@ const (
██╔══╝ ██╔══╝ ██║╚██╔╝██║██╔═══╝ ██╔══╝ ██║ ██║██║ ██║
██║ ██║ ██║ ╚═╝ ██║██║ ███████╗╚██████╔╝██████╔╝
╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚══════╝ ╚═════╝ ╚═════╝
v0.0.1
`
Banner = "[\u001b[32mffmpegd\u001b[0m] - websocket server for ffmpeg-commander.\n"
Usage = `
Version = "0.0.1"
Description = "[\u001b[32mffmpegd\u001b[0m] - websocket server for ffmpeg-commander.\n"
Usage = `
Usage:
ffmpegd [port]
ffmpegd version -- This version.
`
Version = "0.0.1"
)
var clients = make(map[*websocket.Conn]bool)
@@ -59,16 +59,19 @@ var progressCh chan struct{}
func main() {
printBanner()
// HTTP/WS Server.
startServer()
}
func printBanner() {
fmt.Println(Logo)
fmt.Println(Banner)
fmt.Println(Description)
}
func startServer() {
http.HandleFunc("/ws", handleConnections)
// Handles incoming WS messages from client.
go handleMessages()
fmt.Println("Server started on port :8080.")

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB