Skip to content

Commit

Permalink
Fix xpsnr reference vfilter usage (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic authored Jan 1, 2025
1 parent 7804833 commit a11cf6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased (v0.9.1)
* Fix xpsnr inf score parsing.
* Fix xpsnr reference vfilter usage.
* Add `--xpsnr-fps`: Frame rate override used to analyse both reference & distorted videos. Default 60.

# v0.9.0
Expand Down
6 changes: 3 additions & 3 deletions src/command/xpsnr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub async fn xpsnr(
pub fn lavfi(ref_vfilter: Option<&str>) -> Cow<'static, str> {
match ref_vfilter {
None => "xpsnr=stats_file=-".into(),
Some(vf) => format!("[1:v]{vf}[ref];[0:v][ref]xpsnr=stats_file=-").into(),
Some(vf) => format!("[0:v]{vf}[ref];[ref][1:v]xpsnr=stats_file=-").into(),
}
}

Expand All @@ -118,7 +118,7 @@ fn test_lavfi_default() {
fn test_lavfi_ref_vfilter() {
assert_eq!(
lavfi(Some("scale=1280:-1")),
"[1:v]scale=1280:-1[ref];\
[0:v][ref]xpsnr=stats_file=-"
"[0:v]scale=1280:-1[ref];\
[ref][1:v]xpsnr=stats_file=-"
);
}

0 comments on commit a11cf6b

Please sign in to comment.