From 79fa09bbfc6cb9e45cb0d3cb9b7f62b1c8ec2e1d Mon Sep 17 00:00:00 2001 From: Juris Bune Date: Tue, 7 Oct 2025 10:02:43 +0300 Subject: [PATCH 1/3] Add a sample config to enable phone model for VMAF --- example/ease_conf_phone_model.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 example/ease_conf_phone_model.json diff --git a/example/ease_conf_phone_model.json b/example/ease_conf_phone_model.json new file mode 100644 index 0000000..453c785 --- /dev/null +++ b/example/ease_conf_phone_model.json @@ -0,0 +1,3 @@ +{ + "ffmpeg_vmaf_template": "-hide_banner -i {{.CompressedFile}} -i {{.SourceFile}} -lavfi libvmaf=n_subsample=1:log_path={{.ResultFile}}:feature=name=psnr:log_fmt=json:model=version=vmaf_v0.6.1\\\\\\\\:enable_transform=true:n_threads={{.NThreads}} -f null -" +} From 213843eaa1dac5773ecf8664bb78feb6670b1e93 Mon Sep 17 00:00:00 2001 From: Juris Bune Date: Tue, 7 Oct 2025 11:30:38 +0300 Subject: [PATCH 2/3] Add example/README.md --- example/README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 example/README.md diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..302825f --- /dev/null +++ b/example/README.md @@ -0,0 +1,6 @@ +# Examples in this direcotry + +- [ease_conf_phone_model.json](./ease_conf_phone_model.json) is a sample configuration file to use in case one needs to predirct VMAF scores using "phone model" [1]. + + +[1]: https://github.com/Netflix/vmaf/blob/master/resource/doc/models.md#predict-quality-on-a-cellular-phone-screen From 8e171e116c4121d48d873a6f8e6114bbe11992ce Mon Sep 17 00:00:00 2001 From: Juris Bune Date: Tue, 7 Oct 2025 11:31:32 +0300 Subject: [PATCH 3/3] Minor chores - fix golangci linter complaining about depreciations - minor code modernisations suggested by linter --- .golangci.yaml | 3 ++- bitrate.go | 4 ++-- internal/vqm/vqm.go | 6 +----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 76e32cd..af4c9f9 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -46,6 +46,7 @@ linters: - typecheck - unused # Additional + - copyloopvar - dupl - errname - misspell @@ -54,7 +55,7 @@ linters: - goimports - goheader - gosec - - exportloopref - ireturn - prealloc - reassign + - usestdlibvars diff --git a/bitrate.go b/bitrate.go index 1c9af4d..db54caf 100644 --- a/bitrate.go +++ b/bitrate.go @@ -147,8 +147,8 @@ func run(videoFile, plotFile, ffprobePath string) error { } canvases := plot.Align(plots, t, dc) - for j := 0; j < rows; j++ { - for i := 0; i < cols; i++ { + for j := range rows { + for i := range cols { if plots[j][i] != nil { plots[j][i].Draw(canvases[j][i]) } diff --git a/internal/vqm/vqm.go b/internal/vqm/vqm.go index f588b39..4453e0c 100644 --- a/internal/vqm/vqm.go +++ b/internal/vqm/vqm.go @@ -45,11 +45,7 @@ func NewFfmpegVMAF(cfg *FfmpegVMAFConfig, compressedFile, sourceFile string) (*F // Too much CPU threads are also bad. This was an issue on 128 threaded AMD // EPYC, ffmpeg was deadlocking at some point during VMAF calculations. - nThreads := 32 - - if runtime.NumCPU() < nThreads { - nThreads = runtime.NumCPU() - } + nThreads := min(runtime.NumCPU(), 32) // Template requires a struct with exported fields. tplContext := struct {