More tuning
parent
5b5a5afe78
commit
22e6715b2a
10
manager.go
10
manager.go
|
@ -58,12 +58,12 @@ func NewManager(c *Config, path string, id string, close chan string) (*Manager,
|
|||
m.numChunks = int(math.Ceil(m.probe.Duration.Seconds() / float64(c.chunkSize)))
|
||||
|
||||
// Possible streams
|
||||
m.streams["360p"] = &Stream{c: c, m: m, quality: "360p", height: 360, width: 640, bitrate: 750000}
|
||||
m.streams["360p"] = &Stream{c: c, m: m, quality: "360p", height: 360, width: 640, bitrate: 500000}
|
||||
m.streams["480p"] = &Stream{c: c, m: m, quality: "480p", height: 480, width: 640, bitrate: 1000000}
|
||||
m.streams["720p"] = &Stream{c: c, m: m, quality: "720p", height: 720, width: 1280, bitrate: 2500000}
|
||||
m.streams["1080p"] = &Stream{c: c, m: m, quality: "1080p", height: 1080, width: 1920, bitrate: 4500000}
|
||||
m.streams["1440p"] = &Stream{c: c, m: m, quality: "1440p", height: 1440, width: 2560, bitrate: 9000000}
|
||||
m.streams["2160p"] = &Stream{c: c, m: m, quality: "2160p", height: 2160, width: 3840, bitrate: 14000000}
|
||||
m.streams["720p"] = &Stream{c: c, m: m, quality: "720p", height: 720, width: 1280, bitrate: 2000000}
|
||||
m.streams["1080p"] = &Stream{c: c, m: m, quality: "1080p", height: 1080, width: 1920, bitrate: 3500000}
|
||||
m.streams["1440p"] = &Stream{c: c, m: m, quality: "1440p", height: 1440, width: 2560, bitrate: 6000000}
|
||||
m.streams["2160p"] = &Stream{c: c, m: m, quality: "2160p", height: 2160, width: 3840, bitrate: 10000000}
|
||||
|
||||
// Only keep streams that are smaller than the video
|
||||
var highest int
|
||||
|
|
10
stream.go
10
stream.go
|
@ -317,8 +317,12 @@ func (s *Stream) transcode(startId int) {
|
|||
"-profile:v", "high",
|
||||
}...)
|
||||
|
||||
// Extra args only for x264
|
||||
if !VAAPI {
|
||||
// Device specific output args
|
||||
if VAAPI {
|
||||
args = append(args, []string{
|
||||
"-low_power", "1",
|
||||
}...)
|
||||
} else {
|
||||
args = append(args, []string{
|
||||
"-preset", "faster",
|
||||
"-level:v", "4.0",
|
||||
|
@ -342,7 +346,7 @@ func (s *Stream) transcode(startId int) {
|
|||
"-avoid_negative_ts", "disabled",
|
||||
"-f", "hls",
|
||||
"-hls_time", fmt.Sprintf("%d", s.c.chunkSize),
|
||||
"-g", fmt.Sprintf("%d", s.c.chunkSize),
|
||||
"-g", "64", "-keyint_min", "64",
|
||||
"-hls_segment_type", "mpegts",
|
||||
"-start_number", fmt.Sprintf("%d", startId),
|
||||
"-hls_segment_filename", s.getTsPath(-1),
|
||||
|
|
Loading…
Reference in New Issue