0

Remove hardcoded urls

This commit is contained in:
Gabe Kangas 2020-06-14 22:26:31 -07:00
parent 5d8bb53e4b
commit d9ce2c0575
2 changed files with 3 additions and 5 deletions

View File

@ -40,11 +40,9 @@ func startFfmpeg(configuration Config) {
var streamMappingString = ""
if configuration.VideoSettings.EnablePassthrough || len(configuration.VideoSettings.StreamQualities) == 0 {
fmt.Println("Enabling passthrough video")
// videoMaps = append(videoMaps, fmt.Sprintf("-map 0:v -c:v copy"))
streamMaps = append(streamMaps, fmt.Sprintf("v:%d,a:%d", 0, 0))
} else {
for index, quality := range configuration.VideoSettings.StreamQualities {
// minRate := math.Floor(float64(quality.Bitrate) / 2)
maxRate := math.Floor(float64(quality.Bitrate) * 0.8)
videoMaps = append(videoMaps, fmt.Sprintf("-map v:0 -c:v:%d libx264 -b:v:%d %dk -maxrate %dk -bufsize %dk", index, index, int(quality.Bitrate), int(maxRate), int(maxRate)))
streamMaps = append(streamMaps, fmt.Sprintf("v:%d,a:%d", index, index))
@ -54,7 +52,7 @@ func startFfmpeg(configuration Config) {
}
}
framerate := 30
framerate := 25
streamMappingString = "-var_stream_map \"" + strings.Join(streamMaps, " ") + "\""
ffmpegFlags := []string{

View File

@ -59,10 +59,10 @@
autoplay
playsinline
muted
poster="https://goth.land/thumbnail.png"
poster="/thumbnail.png"
data-setup='{}'
>
<source src="https://goth.land/hls/stream.m3u8" type="application/x-mpegURL"/>
<source src="hls/stream.m3u8" type="application/x-mpegURL"/>
</video>
</div>