mirror of
https://github.com/owncast/owncast.git
synced 2024-11-24 13:50:06 +03:00
feat(log): point to passthrough as a potential issue when unable to generate thumbnails
Re: #3433 and #3431
This commit is contained in:
parent
dfe5dd494e
commit
b4c73315fa
3 changed files with 12 additions and 6 deletions
|
@ -620,14 +620,14 @@ func VerifySettings() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// FindHighestVideoQualityIndex will return the highest quality from a slice of variants.
|
// FindHighestVideoQualityIndex will return the highest quality from a slice of variants.
|
||||||
func FindHighestVideoQualityIndex(qualities []models.StreamOutputVariant) int {
|
func FindHighestVideoQualityIndex(qualities []models.StreamOutputVariant) (int, bool) {
|
||||||
type IndexedQuality struct {
|
type IndexedQuality struct {
|
||||||
quality models.StreamOutputVariant
|
quality models.StreamOutputVariant
|
||||||
index int
|
index int
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(qualities) < 2 {
|
if len(qualities) < 2 {
|
||||||
return 0
|
return 0, qualities[0].IsVideoPassthrough
|
||||||
}
|
}
|
||||||
|
|
||||||
indexedQualities := make([]IndexedQuality, 0)
|
indexedQualities := make([]IndexedQuality, 0)
|
||||||
|
@ -649,7 +649,8 @@ func FindHighestVideoQualityIndex(qualities []models.StreamOutputVariant) int {
|
||||||
})
|
})
|
||||||
|
|
||||||
// nolint:gosec
|
// nolint:gosec
|
||||||
return indexedQualities[0].index
|
selectedQuality := indexedQualities[0]
|
||||||
|
return selectedQuality.index, selectedQuality.quality.IsVideoPassthrough
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetForbiddenUsernameList will return the blocked usernames as a comma separated string.
|
// GetForbiddenUsernameList will return the blocked usernames as a comma separated string.
|
||||||
|
|
|
@ -69,7 +69,8 @@ func setStreamAsConnected(rtmpOut *io.PipeReader) {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
go webhooks.SendStreamStatusEvent(models.StreamStarted)
|
go webhooks.SendStreamStatusEvent(models.StreamStarted)
|
||||||
transcoder.StartThumbnailGenerator(segmentPath, data.FindHighestVideoQualityIndex(_currentBroadcast.OutputSettings))
|
selectedThumbnailVideoQualityIndex, isVideoPassthrough := data.FindHighestVideoQualityIndex(_currentBroadcast.OutputSettings)
|
||||||
|
transcoder.StartThumbnailGenerator(segmentPath, selectedThumbnailVideoQualityIndex, isVideoPassthrough)
|
||||||
|
|
||||||
_ = chat.SendSystemAction("Stay tuned, the stream is **starting**!", true)
|
_ = chat.SendSystemAction("Stay tuned, the stream is **starting**!", true)
|
||||||
chat.SendAllWelcomeMessage()
|
chat.SendAllWelcomeMessage()
|
||||||
|
|
|
@ -25,7 +25,7 @@ func StopThumbnailGenerator() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartThumbnailGenerator starts generating thumbnails.
|
// StartThumbnailGenerator starts generating thumbnails.
|
||||||
func StartThumbnailGenerator(chunkPath string, variantIndex int) {
|
func StartThumbnailGenerator(chunkPath string, variantIndex int, isVideoPassthrough bool) {
|
||||||
// Every 20 seconds create a thumbnail from the most
|
// Every 20 seconds create a thumbnail from the most
|
||||||
// recent video segment.
|
// recent video segment.
|
||||||
_timer = time.NewTicker(20 * time.Second)
|
_timer = time.NewTicker(20 * time.Second)
|
||||||
|
@ -36,7 +36,11 @@ func StartThumbnailGenerator(chunkPath string, variantIndex int) {
|
||||||
select {
|
select {
|
||||||
case <-_timer.C:
|
case <-_timer.C:
|
||||||
if err := fireThumbnailGenerator(chunkPath, variantIndex); err != nil {
|
if err := fireThumbnailGenerator(chunkPath, variantIndex); err != nil {
|
||||||
log.Errorln("Unable to generate thumbnail:", err)
|
logMsg := "Unable to generate thumbnail: " + err.Error()
|
||||||
|
if isVideoPassthrough {
|
||||||
|
logMsg += ". Video Passthrough is enabled. You should disable it to fix this, and other, streaming errors. https://owncast.online/troubleshoot"
|
||||||
|
}
|
||||||
|
log.Errorln("Unable to generate thumbnail:", logMsg)
|
||||||
}
|
}
|
||||||
case <-quit:
|
case <-quit:
|
||||||
log.Debug("thumbnail generator has stopped")
|
log.Debug("thumbnail generator has stopped")
|
||||||
|
|
Loading…
Reference in a new issue