Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Ponyboy47/TranscodeVideo
A Swift wrapper around the transcode-video command
https://github.com/Ponyboy47/TranscodeVideo
Last synced: 27 days ago
JSON representation
A Swift wrapper around the transcode-video command
- Host: GitHub
- URL: https://github.com/Ponyboy47/TranscodeVideo
- Owner: Ponyboy47
- License: mit
- Created: 2019-02-01T18:43:26.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-02T20:14:27.000Z (over 5 years ago)
- Last Synced: 2024-11-08T21:02:55.651Z (about 1 month ago)
- Language: Swift
- Size: 46.9 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-video - Ponyboy47/TranscodeVideo - A Swift wrapper around the transcode-video command - Ponyboy47/TranscodeVideo (Encoding / Talks Presentations Podcasts)
README
# TranscodeVideo
A Swift wrapper around the `transcode-video` command.
## Installation (SPM)
```swift
.package(url: "https://github.com/Ponyboy47/TranscodeVideo.git", from: "0.3.1")
```
NOTES:
Due to the intricacies of supporting all the various command line options, each
version of this library will be locked down to a version of the transcode-video
utility.
Version 0.3.1 is locked to version 0.25.x of transcode-video## Usage
```swift
import TranscodeVideo
import TrailBlazerlet videoFile = FilePath("/path/to/file.avi")!
let transcoder = Transcoder(for: videoFile)
// Begin transcoding asynchronously
transcoder.start()// Check progress
let progress: Double = transcoder.progress// Get ETA
let eta: (hours: Int, minutes: Int, seconds: Int) = transcoder.eta// Forcefully stop transcoding
transcoder.stop()// Gracefully stop transcoding
transcoder.interrupt()// Pause transcoding
let succeeded = transcoder.suspend()// Resume a paused transcoding
let succeeded = transcoder.resume()// Block until transcoding completes
transcoder.wait()// Also block until a transcoding completes, but includes exit code and termination reason
let finish: (exitcode: Int, reason: Process.TerminationReason) = transcoder.finish()// Get transcoder output
let output: (stdout: ReadableStream, stderr: ReadableStream) = transcoder.output()
print(output.stdout.read())
```## License
MIT