{"id":31534031,"url":"https://github.com/tr4cks/ffmpeg-vmaf-gpu-benchmark","last_synced_at":"2026-04-15T15:33:09.873Z","repository":{"id":315286343,"uuid":"1058848768","full_name":"tr4cks/ffmpeg-vmaf-gpu-benchmark","owner":"tr4cks","description":"Benchmarking FFmpeg GPU encodings with VMAF","archived":false,"fork":false,"pushed_at":"2025-09-17T18:26:05.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-17T19:51:23.740Z","etag":null,"topics":["benchmark","docker","ffmpeg","gpu","nvidia","vmaf"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tr4cks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-17T16:21:53.000Z","updated_at":"2025-09-17T18:26:09.000Z","dependencies_parsed_at":"2025-09-17T20:02:29.296Z","dependency_job_id":null,"html_url":"https://github.com/tr4cks/ffmpeg-vmaf-gpu-benchmark","commit_stats":null,"previous_names":["tr4cks/ffmpeg-vmaf-gpu-benchmark"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tr4cks/ffmpeg-vmaf-gpu-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr4cks%2Fffmpeg-vmaf-gpu-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr4cks%2Fffmpeg-vmaf-gpu-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr4cks%2Fffmpeg-vmaf-gpu-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr4cks%2Fffmpeg-vmaf-gpu-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tr4cks","download_url":"https://codeload.github.com/tr4cks/ffmpeg-vmaf-gpu-benchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tr4cks%2Fffmpeg-vmaf-gpu-benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278266896,"owners_count":25958733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","docker","ffmpeg","gpu","nvidia","vmaf"],"created_at":"2025-10-04T05:16:23.296Z","updated_at":"2025-10-04T05:16:30.187Z","avatar_url":"https://github.com/tr4cks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FFmpeg GPU Transcoding \u0026 VMAF Benchmark\n\nThis project allows testing different **FFmpeg** configurations using GPU acceleration with an **NVIDIA Quadro P400**, and evaluating the visual quality of the generated videos with **VMAF**.\n\nThe goal is to compare multiple encoding settings on the same source video (containing diverse scenes: motion, static, dark, etc.), and produce a CSV report with both performance and quality metrics.\n\n---\n\n## 🎯 Goals\n\n* Test different encoding configurations with **FFmpeg** and NVENC/NVDEC\n* Measure the impact of each setting on:\n\n  * output file size\n  * encoding speed\n  * perceived quality (**VMAF** and **VMAF NEG**)\n* Generate a consolidated CSV report\n\n---\n\n## 📦 Project Contents\n\n* **Dockerfile**\n\n  * Builds **FFmpeg 8.0** with NVENC/NVDEC, libx264/libx265, and libvmaf support\n  * Installs **VMAF v3.0.0** and NVENC headers\n  * Based on CUDA, adapted for the **NVIDIA Quadro P400**\n\n* **Python script (`ffmpeg_vmaf_benchmark.py`)**\n\n  * Reads a CSV file describing FFmpeg encoding settings\n  * Runs GPU-accelerated transcodes\n  * Automatically computes **VMAF** and **VMAF NEG**\n  * Produces a CSV report (file size, ratio, encoding time, quality metrics)\n\n* **Examples**\n\n  * Input CSV with encoding parameters\n  * Output CSV with performance and quality results\n\n---\n\n## 🛠️ Requirements\n\n* **NVIDIA GPU** with NVENC support (tested with Quadro P400)\n* **Docker** and **NVIDIA Container Toolkit** installed\n* A **source video** with varied scenes (motion, static, different lighting)\n\n---\n\n## 📦 Build the Docker image\n\n```bash\ndocker build -t ffmpeg-vmaf-nvidia .\n```\n\n---\n\n## ▶️ Usage\n\n### 1. Prepare a configuration CSV\n\nExample (`encoding_settings.csv`):\n\n```csv\nquality;flags\n22;-c:v hevc_nvenc -cq:v 22\n23;-c:v hevc_nvenc -cq:v 23\n24;-c:v hevc_nvenc -cq:v 24\n25;-c:v hevc_nvenc -cq:v 25\n```\n\nEach line defines a configuration to test:\n\n* **quality**: identifier/quality parameter\n* **flags**: FFmpeg options\n\n---\n\n### 2. Run the container\n\n```bash\ndocker run --gpus all -it --rm \\\n    -v $(pwd):/workspace \\\n    ffmpeg-vmaf-nvidia bash\n```\n\n---\n\n### 3. Launch the tests\n\nInside the container:\n\n```bash\ncd /workspace\npython3 ffmpeg_vmaf_benchmark.py \\\n    --input_csv encoding_settings.csv \\\n    --source_video input.mp4 \\\n    --output_dir results_videos \\\n    --output_csv results.csv \\\n    --max_transcode_workers 1 \\\n    --max_vmaf_workers 2\n```\n\n---\n\n## 📊 Example Results\n\n### Example of generated CSV (`results.csv`):\n\n```csv\nindex,quality,flags,size,ratio_size,walltime,usertime,vmaf_min,vmaf_max,vmaf_mean,vmaf_harmonic_mean,vmaf_neg_min,vmaf_neg_max,vmaf_neg_mean,vmaf_neg_harmonic_mean\n0,22,\"-c:v hevc_nvenc -cq:v 22\",\"13706.75 KB\",0.926,00:00:02:943:430,00:00:00:000:424,95.48,100.0,97.88,97.87,91.57,100.0,97.11,97.10\n1,23,\"-c:v hevc_nvenc -cq:v 23\",\"11826.97 KB\",0.799,00:00:02:929:708,00:00:00:001:107,95.35,100.0,97.86,97.85,91.70,100.0,97.01,97.00\n```\n\nKey columns:\n\n* **size**: generated file size\n* **ratio\\_size**: output size / source size ratio\n* **walltime**: actual transcoding time\n* **usertime**: CPU time consumed\n* **vmaf / vmaf\\_neg**: min, max, mean, harmonic mean scores\n\n---\n\n## ⚙️ Script Options\n\n| Option                    | Description                    | Default              |\n| ------------------------- | ------------------------------ | -------------------- |\n| `--input_csv`             | CSV file with FFmpeg configs   | **required**         |\n| `--source_video`          | Source video path              | **required**         |\n| `--output_dir`            | Directory for encoded videos   | `out`                |\n| `--output_csv`            | CSV results file               | `output_results.csv` |\n| `--max_transcode_workers` | Max parallel transcodes        | `1`                  |\n| `--max_vmaf_workers`      | Max parallel VMAF calculations | `2`                  |\n| `--sequential`            | Sequential execution           | `false`              |\n| `--vmaf_threads`          | Number of CPU threads for VMAF | `1`                  |\n\n---\n\n## 📝 Notes\n\n* The Dockerfile includes CUDA and dependencies for the Quadro P400.\n* The project can be used with any NVIDIA GPU supporting NVENC.\n* VMAF is computed twice:\n\n  * **Standard VMAF**\n  * **VMAF NEG** (stricter model).\n\n---\n\n## 🔗 Inspired by\n\nThis project was inspired by the article: [Benchmarking FFMPEG's H.265 Options](https://scottstuff.net/posts/2025/03/17/benchmarking-ffmpeg-h265/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftr4cks%2Fffmpeg-vmaf-gpu-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftr4cks%2Fffmpeg-vmaf-gpu-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftr4cks%2Fffmpeg-vmaf-gpu-benchmark/lists"}