brownchow / go-hls-transcoder

Simple golang HLS transcoder with ffmpeg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go HLS Transcoder

GoDoc

Simple golang HLS transcoder with ffmpeg

Prerequisite

  • Golang 1.14
  • ffmpeg

Examples

Generate HLS files + playlist from a mov file.

package main

import (
	hls "github.com/rendyfebry/go-hls-transcoder"
	hlsPlaylist "github.com/rendyfebry/go-hls-transcoder/playlist"
)

func main() {
	srcPath := "/assets/raw/movie.mov"
	targetPath := "/assets/hls"
	resOptions := []string{"480p", "720p"}

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

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

License

MIT licensed. See the LICENSE.md file for details.

About

Simple golang HLS transcoder with ffmpeg

License:MIT License


Languages

Language:Go 100.0%