diff --git a/internal/photoprism/convert.go b/internal/photoprism/convert.go index 2dd4b18ed..ea2353e3e 100644 --- a/internal/photoprism/convert.go +++ b/internal/photoprism/convert.go @@ -319,8 +319,8 @@ func (c *Convert) AvcBitrate(f *MediaFile) string { if bitrate <= 0 { return "8M" - } else if bitrate >= 50 { - return "50M" + } else if bitrate >= 100 { + return "100M" } return fmt.Sprintf("%dM", bitrate) @@ -337,13 +337,17 @@ func (c *Convert) AvcConvertCommand(f *MediaFile, avcName, codecName string) (re c.conf.FFmpegBin(), "-i", f.FileName(), "-c:v", codecName, - "-c:a", "copy", + "-c:a", "libmp3lame", "-vf", format, "-num_output_buffers", strconv.Itoa(c.conf.FFmpegBuffers()+8), "-num_capture_buffers", strconv.Itoa(c.conf.FFmpegBuffers()), + "-max_muxing_queue_size", "1024", "-crf", "23", + "-vsync", "vfr", + "-r", "30", "-b:v", c.AvcBitrate(f), "-f", "mp4", + "-y", avcName, ) } else { diff --git a/internal/photoprism/convert_test.go b/internal/photoprism/convert_test.go index e4094d4a1..85d167ebf 100644 --- a/internal/photoprism/convert_test.go +++ b/internal/photoprism/convert_test.go @@ -311,6 +311,6 @@ func TestConvert_AvcBitrate(t *testing.T) { mf.width = 4096 mf.height = 2160 - assert.Equal(t, "50M", convert.AvcBitrate(mf)) + assert.Equal(t, "100M", convert.AvcBitrate(mf)) }) } diff --git a/internal/photoprism/convert_worker.go b/internal/photoprism/convert_worker.go index d49befe0e..d31763a90 100644 --- a/internal/photoprism/convert_worker.go +++ b/internal/photoprism/convert_worker.go @@ -24,9 +24,9 @@ func ConvertWorker(jobs <-chan ConvertJob) { case job.convert == nil: continue case job.file.IsVideo(): - if _, err := job.convert.ToJson(job.file); err != nil { - logError(err, job) - } else if _, err := job.convert.ToJpeg(job.file); err != nil { + _, _ = job.convert.ToJson(job.file) + + if _, err := job.convert.ToJpeg(job.file); err != nil { logError(err, job) } else if metaData := job.file.MetaData(); metaData.CodecAvc() { continue