Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Files

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Latest commit

792804f · Jul 21, 2022

History

History
92 lines (67 loc) · 1.81 KB

README.md

File metadata and controls

92 lines (67 loc) · 1.81 KB

Golang Transcoding Library



Created by FlooStack.

Features

Ease use
Implement your own business logic around easy interfaces
Transcoding progress
Obtain progress events generated by transcoding application process

Download from Github

go get git.code.oa.com/yt-media-ai-videounderstanding/gh-floostack-transcoder

Example

package main

import (
	"log"

	ffmpeg "git.code.oa.com/yt-media-ai-videounderstanding/gh-floostack-transcoder/ffmpeg"
)

func main() {


	hwaccel := "cuvid"
	videoCodec := "h264_cuvid"

	inputOpts := ffmpeg.Options{
		Hwaccel:      &hwaccel,
		VideoCodec:   &videoCodec,
	}
	
	format := "mp4"
	overwrite := true

	outputOpts := ffmpeg.Options{
		OutputFormat: &format,
		Overwrite:    &overwrite,
	}

	ffmpegConf := &ffmpeg.Config{
		FfmpegBinPath:   "/usr/local/bin/ffmpeg",
		FfprobeBinPath:  "/usr/local/bin/ffprobe",
		ProgressEnabled: true,
	}

	progress, err := ffmpeg.
		New(ffmpegConf).
		Input("/tmp/avi").
		Output("/tmp/mp4").
		WithInputOptions(inputOpts).
		WithOutputOptions(outputOpts).
		Start()

	if err != nil {
		log.Fatal(err)
	}

	for msg := range progress {
		log.Printf("%+v", msg)
	}
}