New video transcoder (#27)

* New video transcoder

* Set a smaller max muxing size + logging tweaks

* No need to return an err since it wiill panic anyway

* Use a default encoder preset if one is not supplied

* Rename to NewTranscoder.  Add comments.

* Rename Bitrate to VideoBitrate. Config file changes required with this rename.

* Allow overrides of segment length. Allow offline stream to live in a single segment

* Append offline state video to existin HLS stream instead of overwriting because players do not like that

* Make properties private as they do not need to be exported
This commit is contained in:
Gabe Kangas
2020-06-25 17:44:47 -07:00
committed by GitHub
parent 17eb9da30c
commit 04dc0796d8
12 changed files with 390 additions and 229 deletions

View File

@@ -13,7 +13,6 @@ import (
"github.com/radovskyb/watcher"
"github.com/gabek/owncast/config"
"github.com/gabek/owncast/core/ffmpeg"
"github.com/gabek/owncast/models"
"github.com/gabek/owncast/utils"
)
@@ -159,5 +158,5 @@ func updateVariantPlaylist(fullPath string) error {
playlistString = _storage.GenerateRemotePlaylist(playlistString, variant)
return ffmpeg.WritePlaylist(playlistString, path.Join(config.Config.PublicHLSPath, relativePath))
return WritePlaylist(playlistString, path.Join(config.Config.PublicHLSPath, relativePath))
}

18
core/playlist/writer.go Normal file
View File

@@ -0,0 +1,18 @@
package playlist
import "os"
//WritePlaylist writes the playlist to disk
func WritePlaylist(data string, filePath string) error {
f, err := os.Create(filePath)
if err != nil {
return err
}
defer f.Close()
if _, err := f.WriteString(data); err != nil {
return err
}
return nil
}