From e19a7ef541ff5a1cf4539aab82999455719f9f44 Mon Sep 17 00:00:00 2001 From: Fran <35836929+xfrr@users.noreply.github.com> Date: Mon, 5 Feb 2018 11:39:06 +0100 Subject: [PATCH] Update README.md --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6217e74..8b49774 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,66 @@ -# goffmpeg +# Goffmpeg FFMPEG wrapper written in GO -> Building \ No newline at end of file + +# Dependencies +- [FFmpeg](https://www.ffmpeg.org/) + +# Getting started +How to transcode a media file +```go +package main + +import ( + "goffmpeg/transcoder" +) + +var inputPath = "/data/testmov" +var outputPath = "/data/testmp4.mp4" + +func main() { + + // Create new instance of transcoder + trans := new(transcoder.Transcoder) + + // Initialize transcoder passing the input file path and output file path + err := trans.Initialize( inputPath, outputPath ) + // Handle error... + + // Start transcoder process + done, err := trans.Run() + + // This channel is used to wait for the process to end + <-done + +} +``` +How to get the transcoding progress +```go +... +func main() { + + // Create new instance of transcoder + trans := new(transcoder.Transcoder) + + // Initialize transcoder passing the input file path and output file path + err := trans.Initialize( inputPath, outputPath ) + // Handle error... + + // Start transcoder process + done, err := trans.Run() + + // Returns a channel to get the transcoding progress + progress, err := trans.Output() + + // Example of printing transcoding progress + for msg := range progress { + fmt.Println(msg) + } + + // This channel is used to wait for the transcoding process to end + <-done + +} +``` +Manipulating media file +> Building