go-transcoder

module
v0.0.0-...-742043b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: MIT

README

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL