mirror of
https://github.com/alfg/ffmpegd.git
synced 2025-09-26 19:41:15 +08:00
Add readme, license and screenshot. Update CLI banner.
This commit is contained in:
21
LICENSE
Normal file
21
LICENSE
Normal 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.
|
52
README.md
52
README.md
@@ -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
|
||||
```
|
||||

|
||||
|
||||
|
||||
## 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
13
main.go
@@ -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
BIN
screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 70 KiB |
Reference in New Issue
Block a user