From b15f62a49ebd371e2bbbbe46e12b7931d8e6bd8e Mon Sep 17 00:00:00 2001 From: Heinrich 'Henrik' Langos Date: Sun, 12 Feb 2023 11:20:18 +0100 Subject: chore: Reorder arguments to ffmpeg --- app/app.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'app/app.go') diff --git a/app/app.go b/app/app.go index 3028edf..f44375d 100644 --- a/app/app.go +++ b/app/app.go @@ -394,7 +394,6 @@ func createScaledVideo(videoFile string, scaledVideoFile string, timeout, "ffmpeg", "-y", - "-i", videoFile, "-s", size, "-c:v", "libx264", "-c:a", "aac", @@ -403,6 +402,7 @@ func createScaledVideo(videoFile string, scaledVideoFile string, "-loglevel", "verbose", "-metadata", fmt.Sprintf("title=%s", videoTitle), "-metadata", fmt.Sprintf("comment=%s", videoDescription), + "-i", videoFile, scaledVideoFile, ); err != nil { err := fmt.Errorf("error transcoding video: %w", err) @@ -420,13 +420,13 @@ func createVideo(videoFile string, transcodedVideoPath string, timeout, "ffmpeg", "-y", - "-i", videoFile, "-vcodec", "h264", "-acodec", "aac", "-strict", "-2", "-loglevel", "quiet", "-metadata", fmt.Sprintf("title=%s", videoTitle), "-metadata", fmt.Sprintf("comment=%s", videoDescription), + "-i", videoFile, transcodedVideoPath, ); err != nil { err := fmt.Errorf("error transcoding video: %w", err) @@ -445,13 +445,13 @@ func createThumbnail(videoFile string, thumbnailPath string, if err := utils.RunCmd( timeout, "ffmpeg", - "-i", videoFile, "-y", "-vf", "thumbnail", "-t", fmt.Sprint(secondsFromStart), "-vframes", "1", "-strict", "-2", "-loglevel", "quiet", + "-i", videoFile, thumbnailPath, ); err != nil { err := fmt.Errorf("error generating thumbnail: %w", err) @@ -906,7 +906,10 @@ func (a *App) videoHandler(w http.ResponseWriter, r *http.Request) { if ok { id = path.Join(prefix, id) } - + log. + WithField("Method", r.Method). + WithField("RequestURI", r.URL). + Debug(r) log.Printf("/v/%s", id) m, ok := a.Library.Videos[id] -- cgit v1.2.3