Skip to content

Commit

Permalink
Use mkv for all lossless samples (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic committed Dec 5, 2022
1 parent f02328c commit 398c6bb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,7 @@
# Unreleased (v0.5.3)
* Support decimal crf values in _sample-encode_, _encode_ subcommands (note svt-av1 only supports integer crf).
* Use mkv containers for all lossless samples. Previously mp4 samples were used for mp4 inputs, however in all test cases
mkv 20s samples were better quality. This change improves accuracy for all mp4 input files.

# v0.5.2
* Fix ffprobe duration conversion error scenarios panicking.
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/sample.rs
@@ -1,6 +1,5 @@
//! ffmpeg logic
use crate::{
command::encode::default_output_ext,
process::{ensure_success, CommandExt},
temporary::{self, TempKind},
};
Expand All @@ -21,9 +20,9 @@ pub async fn copy(
frames: u32,
temp_dir: Option<PathBuf>,
) -> anyhow::Result<PathBuf> {
let ext = default_output_ext(input, false); // not an image
let mut dest =
input.with_extension(format!("sample{}+{frames}f.{ext}", sample_start.as_secs()));
// Always using mkv for the samples works better than, e.g. using mp4 for mp4s
// see https://github.com/alexheretic/ab-av1/issues/82#issuecomment-1337306325
let mut dest = input.with_extension(format!("sample{}+{frames}f.mkv", sample_start.as_secs()));
if let (Some(mut temp), Some(name)) = (temp_dir, dest.file_name()) {
temp.push(name);
dest = temp;
Expand Down

0 comments on commit 398c6bb

Please sign in to comment.