Fix a few cases where ffmpeg produces no output (#3161)

* Treat no output from ffmpeg as an error condition
* Distinguish file vs. video duration, and use later where appropriate
* Check for empty file in generateFile

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
alexandra-3
2022-11-21 16:21:27 +10:00
committed by GitHub
parent 045ba55def
commit abc9ec648a
6 changed files with 44 additions and 20 deletions

View File

@@ -40,7 +40,7 @@ func (t *GeneratePreviewTask) Start(ctx context.Context) {
videoChecksum := t.Scene.GetHash(t.fileNamingAlgorithm)
if err := t.generateVideo(videoChecksum, videoFile.Duration); err != nil {
if err := t.generateVideo(videoChecksum, videoFile.VideoStreamDuration); err != nil {
logger.Errorf("error generating preview: %v", err)
logErrorOutput(err)
return