command to run with hls-transcoder-2
This commit is contained in:
parent
9b85fdb456
commit
98311e3edf
1 changed files with 4 additions and 19 deletions
|
@ -8,26 +8,11 @@ import (
|
||||||
|
|
||||||
func NewTranscoder(stream_key string) (io.WriteCloser, error) {
|
func NewTranscoder(stream_key string) (io.WriteCloser, error) {
|
||||||
base_dir, _ := os.UserHomeDir()
|
base_dir, _ := os.UserHomeDir()
|
||||||
command := "ffmpeg"
|
command := "hls-transcoder-2"
|
||||||
command_args := []string{
|
command_args := []string{
|
||||||
"-probesize", "500",
|
"4",
|
||||||
"-i", "pipe:0",
|
"/vid/" + stream_key + "/",
|
||||||
"-c:a", "libopus",
|
"4",
|
||||||
"-c:v", "vp9",
|
|
||||||
"-quality", "realtime",
|
|
||||||
"-speed", "7",
|
|
||||||
"-tile-columns", "4",
|
|
||||||
"-frame-parallel", "1",
|
|
||||||
"-threads", "8",
|
|
||||||
"-b:v", "1M",
|
|
||||||
"-g", "30",
|
|
||||||
"-hls_time", "6",
|
|
||||||
"-hls_list_size", "4",
|
|
||||||
"-hls_base_url", "/vid/" + stream_key + "/",
|
|
||||||
"-hls_segment_type", "fmp4",
|
|
||||||
"-hls_flags", "delete_segments",
|
|
||||||
"-hls_flags", "+program_date_time",
|
|
||||||
"stream.m3u8",
|
|
||||||
}
|
}
|
||||||
transcoder := exec.Command(command, command_args...)
|
transcoder := exec.Command(command, command_args...)
|
||||||
transcoder.Dir = base_dir + "/live/" + stream_key + "/"
|
transcoder.Dir = base_dir + "/live/" + stream_key + "/"
|
||||||
|
|
Loading…
Reference in a new issue