Skip to content

azanium/go-transcoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go HLS Transcoder

GoDoc

Golang transcoder using ffmpeg

Supports

  • HTTP Live Streaming
  • MPEG DASH

Prerequisite

  • Golang 1.14
  • ffmpeg

Examples

Generate HLS files + playlist from a mov file.

package main

import (
	"os/exec"

	"github.com/azanium/go-transcoder/hls"
)

func main() {
	srcPath := "./Love.mov"
	targetPath := "hls/"
	resOptions := []string{"480p", "720p"}
	ffmpeg, err := exec.LookPath("ffmpeg")
	if err != nil {
		panic(err)
	}

	variants, _ := hls.GenerateHLSVariant(resOptions, "")
	hls.GeneratePlaylist(variants, targetPath, "")

	for _, res := range resOptions {
		hls.GenerateHLS(ffmpeg, srcPath, targetPath, res)
	}
}

License

MIT licensed. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages