All Projects → modfy → Go Fluent Ffmpeg

modfy / Go Fluent Ffmpeg

Licence: apache-2.0
A Go implementation of fluent-ffmpeg

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Go Fluent Ffmpeg

Weixinrecordeddemo
仿微信视频拍摄UI, 基于ffmpeg的视频录制编辑
Stars: ✭ 2,197 (+846.98%)
Mutual labels:  ffmpeg
Cloud Morph
Decentralize, Self-host Cloud Gaming/Application
Stars: ✭ 207 (-10.78%)
Mutual labels:  ffmpeg
Gifine
Quickly record and edit gifs and videos of your desktop
Stars: ✭ 225 (-3.02%)
Mutual labels:  ffmpeg
Giph
simple gif recorder
Stars: ✭ 193 (-16.81%)
Mutual labels:  ffmpeg
Ffmpeg Android Maker
Contains a script that assembles FFmpeg library for Android
Stars: ✭ 207 (-10.78%)
Mutual labels:  ffmpeg
Ffmpeg Aws Lambda Layer
FFmpeg/FFprobe AWS Lambda layer
Stars: ✭ 222 (-4.31%)
Mutual labels:  ffmpeg
Gear360pano
Simple script to create equirectangular panorama by stitching images from Samsung Gear 360
Stars: ✭ 178 (-23.28%)
Mutual labels:  ffmpeg
Fanplayer
A portable video player based on ffmpeg for windows and android platform.
Stars: ✭ 229 (-1.29%)
Mutual labels:  ffmpeg
Ffplayer
a video player based on ffmpeg for win32 and android platform.
Stars: ✭ 210 (-9.48%)
Mutual labels:  ffmpeg
Videocalling
局域网p2p视频聊天
Stars: ✭ 223 (-3.88%)
Mutual labels:  ffmpeg
Puppeteer Lottie
Renders Lottie animations via Puppeteer to image, GIF, or MP4.
Stars: ✭ 208 (-10.34%)
Mutual labels:  ffmpeg
Ffmpegandroid
android端基于FFmpeg实现音频剪切、拼接、转码、编解码;视频剪切、水印、截图、转码、编解码、转Gif动图;音视频合成与分离,配音;音视频解码、同步与播放;FFmpeg本地推流、H264与RTMP实时推流直播;FFmpeg滤镜:素描、色彩平衡、hue、lut、模糊、九宫格等;歌词解析与显示
Stars: ✭ 2,858 (+1131.9%)
Mutual labels:  ffmpeg
Hls Vod
HTTP Live Streaming with on-the-fly encoding of any video file for Web/Apple TV/iPhone/iPad/iPod
Stars: ✭ 221 (-4.74%)
Mutual labels:  ffmpeg
Ffmpegrecorder
An Android video recorder using JavaCV and FFmpeg.
Stars: ✭ 184 (-20.69%)
Mutual labels:  ffmpeg
Mpv
🎥 Command line video player
Stars: ✭ 17,018 (+7235.34%)
Mutual labels:  ffmpeg
Jaffree
Java ffmpeg and ffprobe command-line wrapper
Stars: ✭ 184 (-20.69%)
Mutual labels:  ffmpeg
Avcpp
C++ wrapper for FFmpeg
Stars: ✭ 219 (-5.6%)
Mutual labels:  ffmpeg
Ccapture.js
A library to capture canvas-based animations at a fixed framerate
Stars: ✭ 2,836 (+1122.41%)
Mutual labels:  ffmpeg
Candy
🍭 Cross-platform YouTube-downloader with playlist and channel support as well as build-in audio / video converter.
Stars: ✭ 229 (-1.29%)
Mutual labels:  ffmpeg
Video Srt
这是一个可以识别视频语音自动生成字幕SRT文件的开源命令行工具。
Stars: ✭ 222 (-4.31%)
Mutual labels:  ffmpeg

Go Fluent FFmpeg GoDoc

A Go version of node-fluent-ffmpeg.

Installation

go get -u github.com/modfy/fluent-ffmpeg

Requirements

You will need FFmpeg installed on your machine, or you can specify a path to a binary:

// Provide an empty string to use default FFmpeg path
cmd := fluentffmpeg.NewCommand("")

// Specify a path
cmd = fluentffmpeg.NewCommand("/path/to/ffmpeg/binary")

Quick Start

Create and run commands using an API similar to node-fluent-ffmpeg:

err := fluentffmpeg.NewCommand(""). 
		InputPath("/path/to/video.avi").
		OutputFormat("mp4").
		OutputPath("/path/to/video.mp4").
		Run()

You could use context to set the timeout:

ctx, cancel := context.WithTimeout(context.Background(), time.Second * 5)
defer cancel()
err := fluentffmpeg.NewCommand(""). 
		InputPath("/path/to/video.avi").
		OutputFormat("mp4").
		OutputPath("/path/to/video.mp4").
		RunWithContext(ctx)

If you want to view the errors/logs returned from FFmpeg, provide an io.Writer to receive the data.

buf := &bytes.Buffer{}
err := fluentffmpeg.NewCommand("").
		InputPath("./video.avi").
		OutputFormat("mp4").
		OutputPath("./video.mp4").
		Overwrite(true).
		OutputLogs(buf). // provide a io.Writer
		Run()

out, _ := ioutil.ReadAll(buf) // read logs
fmt.Println(string(out))

You can also get the command in the form of an exec.Cmd struct, with which you can have better control over the running process. For example, you can conditionally kill the FFmpeg command:

done := make(chan error, 1)
cmd := fluentffmpeg.NewCommand("").
		InputPath("./video.avi").
		OutputFormat("mp4").
		OutputPath("./video.mp4").
		Overwrite(true).
		Build()
cmd.Start()

go func() {
    done <- cmd.Wait()
}()

select {
case <-time.After(time.Second * 5):
    fmt.Println("Timed out")
    cmd.Process.Kill()
case <-done:
}

FFprobe is also available for use and returns a map[string]interface{} of JSON data:

data := fluentffmpeg.Probe("./video.avi")

Credits

This repo was inspired by node-fluent-ffmpeg and was built upon the work done by @bitcodr in the https://github.com/bitcodr/gompeg

Managed Version

You can deploy this codebase yourself or you an entirely managed api from the creators at https://api.modfy.video

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].