fix: issues

This commit is contained in:
Rogee
2024-12-07 23:20:30 +08:00
parent 8f88929575
commit c54d7896ef
2 changed files with 6 additions and 6 deletions

Binary file not shown.

View File

@@ -97,6 +97,12 @@ func (d *DiscoverMedias) processVideo(video string, to string) (media_store.Vide
return info, errors.Wrapf(err, "ensure directory: %s", to) return info, errors.Wrapf(err, "ensure directory: %s", to)
} }
// extract poster
posterFile := filepath.Join(to, "poster.jpg")
if err := d.ffmpegVideoToPoster(video, posterFile); err != nil {
return info, errors.Wrapf(err, "ffmpeg video to poster: %s", video)
}
// extract audio from video // extract audio from video
audioFile := filepath.Join(to, "audio.mp3") audioFile := filepath.Join(to, "audio.mp3")
if err := d.extractAudio(video, audioFile); err != nil { if err := d.extractAudio(video, audioFile); err != nil {
@@ -114,12 +120,6 @@ func (d *DiscoverMedias) processVideo(video string, to string) (media_store.Vide
return info, errors.Wrapf(err, "ffmpeg audio to m3u8: %s", audioFile) return info, errors.Wrapf(err, "ffmpeg audio to m3u8: %s", audioFile)
} }
// extract poster
posterFile := filepath.Join(to, "poster.jpg")
if err := d.ffmpegVideoToPoster(video, posterFile); err != nil {
return info, errors.Wrapf(err, "ffmpeg video to poster: %s", video)
}
// get media duration // get media duration
duration, err := d.getMediaDuration(video) duration, err := d.getMediaDuration(video)
if err != nil { if err != nil {