Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

coderabbit bits

Richie McIlroyc79f8de1ff5f
diff --git a/.claude/settings.local.json b/.claude/settings.local.json
index 5babcbf0a..f2037c92c 100644
--- a/.claude/settings.local.json
+++ b/.claude/settings.local.json
@@ -51,7 +51,8 @@
"Bash(footprint:*)",
"Bash(RUST_LOG=info,cap_recording=debug ./target/release/examples/memory-leak-detector:*)",
"Bash(git rm:*)",
- "Bash(./target/release/examples/decode-benchmark:*)"
+ "Bash(./target/release/examples/decode-benchmark:*)",
+ "Bash(RUST_LOG=warn ./target/release/examples/decode-benchmark:*)"
],
"deny": [],
"ask": []
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index 7622b69ff..2f0811a48 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -125,7 +125,9 @@ impl FinalizingRecordings {
pub fn finish_finalizing(&self, path: &Path) {
let mut recordings = self.recordings.lock().unwrap();
if let Some((tx, _)) = recordings.remove(path) {
- tx.send(true).ok();
+ if tx.send(true).is_err() {
+ debug!("Finalizing receiver dropped for path: {:?}", path);
+ }
}
}
diff --git a/apps/desktop/src/routes/editor/index.tsx b/apps/desktop/src/routes/editor/index.tsx
index 1d45af3ca..ecfb44763 100644
--- a/apps/desktop/src/routes/editor/index.tsx
+++ b/apps/desktop/src/routes/editor/index.tsx
@@ -2,10 +2,10 @@ import { Effect, getCurrentWindow } from "@tauri-apps/api/window";
import { type as ostype } from "@tauri-apps/plugin-os";
import { cx } from "cva";
import { createEffect, Suspense } from "solid-js";
-import { AbsoluteInsetLoader } from "~/components/Loader";
import { generalSettingsStore } from "~/store";
import { commands } from "~/utils/tauri";
import { Editor } from "./Editor";
+import { EditorSkeleton } from "./EditorSkeleton";
export default function () {
const generalSettings = generalSettingsStore.createQuery();
@@ -27,7 +27,7 @@ export default function () {
) && "bg-transparent-window",
)}
>
- <Suspense fallback={<AbsoluteInsetLoader />}>
+ <Suspense fallback={<EditorSkeleton />}>
<Editor />
</Suspense>
</div>
diff --git a/crates/editor/examples/decode-benchmark.rs b/crates/editor/examples/decode-benchmark.rs
index 8cde55b94..60106567b 100644
--- a/crates/editor/examples/decode-benchmark.rs
+++ b/crates/editor/examples/decode-benchmark.rs
@@ -1,8 +1,38 @@
use cap_rendering::decoder::{AsyncVideoDecoderHandle, spawn_decoder};
use std::path::{Path, PathBuf};
+use std::process::Command;
use std::time::Instant;
use tokio::runtime::Runtime;
+const DEFAULT_DURATION_SECS: f32 = 60.0;
+
+fn get_video_duration(path: &Path) -> f32 {
+ let output = Command::new("ffprobe")
+ .args([
+ "-v",
+ "error",
+ "-show_entries",
+ "format=duration",
+ "-of",
+ "default=noprint_wrappers=1:nokey=1",
+ ])
+ .arg(path)
+ .output();
+
+ match output {
+ Ok(output) if output.status.success() => {
+ let duration_str = String::from_utf8_lossy(&output.stdout);
+ duration_str.trim().parse().unwrap_or(DEFAULT_DURATION_SECS)
+ }
+ _ => {
+ eprintln!(
+ "Warning: Could not determine video duration via ffprobe, using default {DEFAULT_DURATION_SECS}s"
+ );
+ DEFAULT_DURATION_SECS
+ }
+ }
+}
+
#[derive(Debug, Clone)]
struct BenchmarkConfig {
video_path: PathBuf,
@@ -15,9 +45,12 @@ struct BenchmarkResults {
decoder_creation_ms: f64,
sequential_decode_times_ms: Vec<f64>,
sequential_fps: f64,
+ sequential_failures: usize,
seek_times_by_distance: Vec<(f32, f64)>,
+ seek_failures: usize,
random_access_times_ms: Vec<f64>,
random_access_avg_ms: f64,
+ random_access_failures: usize,
cache_hits: usize,
cache_misses: usize,
}
@@ -36,9 +69,13 @@ impl BenchmarkResults {
println!();
println!("SEQUENTIAL DECODE PERFORMANCE");
- if !self.sequential_decode_times_ms.is_empty() {
- let avg: f64 = self.sequential_decode_times_ms.iter().sum::<f64>()
- / self.sequential_decode_times_ms.len() as f64;
+ if !self.sequential_decode_times_ms.is_empty() || self.sequential_failures > 0 {
+ let avg: f64 = if self.sequential_decode_times_ms.is_empty() {
+ 0.0
+ } else {
+ self.sequential_decode_times_ms.iter().sum::<f64>()
+ / self.sequential_decode_times_ms.len() as f64
+ };
let min = self
.sequential_decode_times_ms
.iter()
@@ -53,6 +90,9 @@ impl BenchmarkResults {
" Frames decoded: {}",
self.sequential_decode_times_ms.len()
);
+ if self.sequential_failures > 0 {
+ println!(" Frames failed: {}", self.sequential_failures);
+ }
println!(" Avg decode time: {avg:.2}ms");
println!(" Min decode time: {min:.2}ms");
println!(" Max decode time: {max:.2}ms");
@@ -61,19 +101,26 @@ impl BenchmarkResults {
println!();
println!("SEEK PERFORMANCE (by distance)");
- if !self.seek_times_by_distance.is_empty() {
+ if !self.seek_times_by_distance.is_empty() || self.seek_failures > 0 {
println!(" {:>10} | {:>12}", "Distance(s)", "Time(ms)");
println!(" {}-+-{}", "-".repeat(10), "-".repeat(12));
for (distance, time) in &self.seek_times_by_distance {
println!(" {distance:>10.1} | {time:>12.2}");
}
+ if self.seek_failures > 0 {
+ println!(" Seek failures: {}", self.seek_failures);
+ }
}
println!();
println!("RANDOM ACCESS PERFORMANCE");
- if !self.random_access_times_ms.is_empty() {
- let avg = self.random_access_times_ms.iter().sum::<f64>()
- / self.random_access_times_ms.len() as f64;
+ if !self.random_access_times_ms.is_empty() || self.random_access_failures > 0 {
+ let avg = if self.random_access_times_ms.is_empty() {
+ 0.0
+ } else {
+ self.random_access_times_ms.iter().sum::<f64>()
+ / self.random_access_times_ms.len() as f64
+ };
let min = self
.random_access_times_ms
.iter()
@@ -85,6 +132,9 @@ impl BenchmarkResults {
.cloned()
.fold(f64::NEG_INFINITY, f64::max);
println!(" Samples: {}", self.random_access_times_ms.len());
+ if self.random_access_failures > 0 {
+ println!(" Failures: {}", self.random_access_failures);
+ }
println!(" Avg access time: {avg:.2}ms");
println!(" Min access time: {min:.2}ms");
println!(" Max access time: {max:.2}ms");
@@ -123,11 +173,15 @@ impl BenchmarkResults {
}
fn percentile(data: &[f64], p: f64) -> f64 {
- if data.is_empty() {
+ let filtered: Vec<f64> = data.iter().copied().filter(|x| !x.is_nan()).collect();
+ if filtered.is_empty() {
return 0.0;
}
- let mut sorted: Vec<f64> = data.to_vec();
- sorted.sort_by(|a, b| a.partial_cmp(b).unwrap());
+ let mut sorted = filtered;
+ sorted.sort_by(|a, b| {
+ a.partial_cmp(b)
+ .expect("NaN values should have been filtered out")
+ });
let idx = ((p / 100.0) * (sorted.len() - 1) as f64).round() as usize;
sorted[idx.min(sorted.len() - 1)]
}
@@ -161,22 +215,35 @@ async fn benchmark_sequential_decode(
fps: u32,
frame_count: usize,
start_time: f32,
-) -> (Vec<f64>, f64) {
+) -> (Vec<f64>, f64, usize) {
let mut times = Vec::with_capacity(frame_count);
+ let mut failures = 0;
let overall_start = Instant::now();
for i in 0..frame_count {
let time = start_time + (i as f32 / fps as f32);
let start = Instant::now();
- let _frame = decoder.get_frame(time).await;
- let elapsed = start.elapsed();
- times.push(elapsed.as_secs_f64() * 1000.0);
+ match decoder.get_frame(time).await {
+ Some(_frame) => {
+ let elapsed = start.elapsed();
+ times.push(elapsed.as_secs_f64() * 1000.0);
+ }
+ None => {
+ failures += 1;
+ eprintln!("Failed to get frame at time {time:.3}s");
+ }
+ }
}
let overall_elapsed = overall_start.elapsed();
- let effective_fps = frame_count as f64 / overall_elapsed.as_secs_f64();
+ let successful_frames = frame_count - failures;
+ let effective_fps = if overall_elapsed.as_secs_f64() > 0.0 {
+ successful_frames as f64 / overall_elapsed.as_secs_f64()
+ } else {
+ 0.0
+ };
- (times, effective_fps)
+ (times, effective_fps, failures)
}
async fn benchmark_seek(
@@ -184,14 +251,23 @@ async fn benchmark_seek(
_fps: u32,
from_time: f32,
to_time: f32,
-) -> f64 {
- let _ = decoder.get_frame(from_time).await;
+) -> Option<f64> {
+ if decoder.get_frame(from_time).await.is_none() {
+ eprintln!("Failed to get initial frame at time {from_time:.3}s for seek benchmark");
+ return None;
+ }
let start = Instant::now();
- let _frame = decoder.get_frame(to_time).await;
- let elapsed = start.elapsed();
-
- elapsed.as_secs_f64() * 1000.0
+ match decoder.get_frame(to_time).await {
+ Some(_frame) => {
+ let elapsed = start.elapsed();
+ Some(elapsed.as_secs_f64() * 1000.0)
+ }
+ None => {
+ eprintln!("Failed to get frame at time {to_time:.3}s for seek benchmark");
+ None
+ }
+ }
}
async fn benchmark_random_access(
@@ -199,8 +275,9 @@ async fn benchmark_random_access(
_fps: u32,
duration_secs: f32,
sample_count: usize,
-) -> Vec<f64> {
+) -> (Vec<f64>, usize) {
let mut times = Vec::with_capacity(sample_count);
+ let mut failures = 0;
let golden_ratio = 1.618_034_f32;
let mut position = 0.0_f32;
@@ -208,12 +285,19 @@ async fn benchmark_random_access(
for _ in 0..sample_count {
position = (position + golden_ratio * duration_secs) % duration_secs;
let start = Instant::now();
- let _frame = decoder.get_frame(position).await;
- let elapsed = start.elapsed();
- times.push(elapsed.as_secs_f64() * 1000.0);
+ match decoder.get_frame(position).await {
+ Some(_frame) => {
+ let elapsed = start.elapsed();
+ times.push(elapsed.as_secs_f64() * 1000.0);
+ }
+ None => {
+ failures += 1;
+ eprintln!("Failed to get frame at position {position:.3}s during random access");
+ }
+ }
}
- times
+ (times, failures)
}
async fn run_full_benchmark(config: BenchmarkConfig) -> BenchmarkResults {
@@ -246,24 +330,44 @@ async fn run_full_benchmark(config: BenchmarkConfig) -> BenchmarkResults {
};
println!(" Done");
+ let video_duration = get_video_duration(&config.video_path);
+ println!("Detected video duration: {video_duration:.2}s");
+ println!();
+
println!("[3/5] Benchmarking sequential decode (100 frames from start)...");
- let (seq_times, seq_fps) = benchmark_sequential_decode(&decoder, config.fps, 100, 0.0).await;
+ let (seq_times, seq_fps, seq_failures) =
+ benchmark_sequential_decode(&decoder, config.fps, 100, 0.0).await;
results.sequential_decode_times_ms = seq_times;
results.sequential_fps = seq_fps;
+ results.sequential_failures = seq_failures;
println!(" Done: {seq_fps:.1} effective FPS");
+ if seq_failures > 0 {
+ println!(" Warning: {seq_failures} frames failed to decode");
+ }
println!("[4/5] Benchmarking seek performance...");
- let seek_distances = vec![0.5, 1.0, 2.0, 5.0, 10.0, 30.0];
+ let seek_distances: Vec<f32> = vec![0.5, 1.0, 2.0, 5.0, 10.0, 30.0]
+ .into_iter()
+ .filter(|&d| d <= video_duration)
+ .collect();
for distance in seek_distances {
- let seek_time = benchmark_seek(&decoder, config.fps, 0.0, distance).await;
- results.seek_times_by_distance.push((distance, seek_time));
- println!(" {distance:.1}s seek: {seek_time:.2}ms");
+ match benchmark_seek(&decoder, config.fps, 0.0, distance).await {
+ Some(seek_time) => {
+ results.seek_times_by_distance.push((distance, seek_time));
+ println!(" {distance:.1}s seek: {seek_time:.2}ms");
+ }
+ None => {
+ results.seek_failures += 1;
+ println!(" {distance:.1}s seek: FAILED");
+ }
+ }
}
println!("[5/5] Benchmarking random access (50 samples)...");
- let video_duration = 60.0f32;
- results.random_access_times_ms =
+ let (random_times, random_failures) =
benchmark_random_access(&decoder, config.fps, video_duration, 50).await;
+ results.random_access_times_ms = random_times;
+ results.random_access_failures = random_failures;
results.random_access_avg_ms = if results.random_access_times_ms.is_empty() {
0.0
} else {
@@ -271,6 +375,9 @@ async fn run_full_benchmark(config: BenchmarkConfig) -> BenchmarkResults {
/ results.random_access_times_ms.len() as f64
};
println!(" Done: {:.2}ms avg", results.random_access_avg_ms);
+ if random_failures > 0 {
+ println!(" Warning: {random_failures} random accesses failed");
+ }
results
}
diff --git a/crates/enc-ffmpeg/src/remux.rs b/crates/enc-ffmpeg/src/remux.rs
index 5c658fff9..f7c420905 100644
--- a/crates/enc-ffmpeg/src/remux.rs
+++ b/crates/enc-ffmpeg/src/remux.rs
@@ -103,16 +103,10 @@ fn open_input_with_format(
}
}
-fn concatenate_with_concat_demuxer(
- concat_list_path: &Path,
- output: &Path,
+fn remux_streams(
+ ictx: &mut avformat::context::Input,
+ octx: &mut avformat::context::Output,
) -> Result<(), RemuxError> {
- let mut options = ffmpeg::Dictionary::new();
- options.set("safe", "0");
-
- let mut ictx = open_input_with_format(concat_list_path, "concat", options)?;
- let mut octx = avformat::output(output)?;
-
let mut stream_mapping: Vec<Option<usize>> = Vec::new();
let mut output_stream_index = 0usize;
@@ -171,7 +165,7 @@ fn concatenate_with_concat_demuxer(
packet.set_stream(output_index);
packet.set_position(-1);
- packet.write_interleaved(&mut octx)?;
+ packet.write_interleaved(octx)?;
}
}
@@ -180,6 +174,19 @@ fn concatenate_with_concat_demuxer(
Ok(())
}
+fn concatenate_with_concat_demuxer(
+ concat_list_path: &Path,
+ output: &Path,
+) -> Result<(), RemuxError> {
+ let mut options = ffmpeg::Dictionary::new();
+ options.set("safe", "0");
+
+ let mut ictx = open_input_with_format(concat_list_path, "concat", options)?;
+ let mut octx = avformat::output(output)?;
+
+ remux_streams(&mut ictx, &mut octx)
+}
+
pub fn concatenate_audio_to_ogg(fragments: &[PathBuf], output: &Path) -> Result<(), RemuxError> {
if fragments.is_empty() {
return Err(RemuxError::NoFragments);
@@ -432,7 +439,13 @@ pub fn concatenate_m4s_segments_with_init(
let result = remux_to_regular_mp4(&combined_path, output);
- let _ = std::fs::remove_file(&combined_path);
+ if let Err(e) = std::fs::remove_file(&combined_path) {
+ tracing::warn!(
+ "failed to remove combined file {}: {}",
+ combined_path.display(),
+ e
+ );
+ }
result
}
@@ -441,69 +454,5 @@ fn remux_to_regular_mp4(input_path: &Path, output_path: &Path) -> Result<(), Rem
let mut ictx = avformat::input(input_path)?;
let mut octx = avformat::output(output_path)?;
- let mut stream_mapping: Vec<Option<usize>> = Vec::new();
- let mut output_stream_index = 0usize;
-
- for input_stream in ictx.streams() {
- let codec_params = input_stream.parameters();
- let medium = codec_params.medium();
-
- if medium == ffmpeg::media::Type::Video || medium == ffmpeg::media::Type::Audio {
- stream_mapping.push(Some(output_stream_index));
- output_stream_index += 1;
-
- let mut output_stream = octx.add_stream(None)?;
- output_stream.set_parameters(codec_params);
- unsafe {
- (*output_stream.as_mut_ptr()).time_base = (*input_stream.as_ptr()).time_base;
- }
- } else {
- stream_mapping.push(None);
- }
- }
-
- octx.write_header()?;
-
- let mut last_dts: Vec<i64> = vec![i64::MIN; output_stream_index];
- let mut dts_offset: Vec<i64> = vec![0; output_stream_index];
-
- for (input_stream, packet) in ictx.packets() {
- let input_stream_index = input_stream.index();
-
- if let Some(Some(output_index)) = stream_mapping.get(input_stream_index) {
- let output_index = *output_index;
- let mut packet = packet;
- let input_time_base = input_stream.time_base();
- let output_time_base = octx.stream(output_index).unwrap().time_base();
-
- packet.rescale_ts(input_time_base, output_time_base);
-
- let current_dts = packet.dts().unwrap_or(0);
-
- if last_dts[output_index] != i64::MIN && current_dts <= last_dts[output_index] {
- dts_offset[output_index] = last_dts[output_index] - current_dts + 1;
- }
-
- let adjusted_dts = current_dts + dts_offset[output_index];
- let adjusted_pts = packet.pts().map(|pts| pts + dts_offset[output_index]);
-
- unsafe {
- (*packet.as_mut_ptr()).dts = adjusted_dts;
- if let Some(pts) = adjusted_pts {
- (*packet.as_mut_ptr()).pts = pts;
- }
- }
-
- last_dts[output_index] = adjusted_dts;
-
- packet.set_stream(output_index);
- packet.set_position(-1);
-
- packet.write_interleaved(&mut octx)?;
- }
- }
-
- octx.write_trailer()?;
-
- Ok(())
+ remux_streams(&mut ictx, &mut octx)
}
diff --git a/crates/enc-ffmpeg/src/video/h264.rs b/crates/enc-ffmpeg/src/video/h264.rs
index d8e76718c..bd566f2e3 100644
--- a/crates/enc-ffmpeg/src/video/h264.rs
+++ b/crates/enc-ffmpeg/src/video/h264.rs
@@ -8,7 +8,7 @@ use ffmpeg::{
frame,
threading::Config,
};
-use tracing::{debug, error, trace};
+use tracing::{debug, error, trace, warn};
use crate::base::EncoderBase;
@@ -130,7 +130,7 @@ impl H264EncoderBuilder {
"Selected hardware H264 encoder"
);
} else {
- error!(
+ warn!(
encoder = %codec_name,
input_width = input_config.width,
input_height = input_config.height,
diff --git a/crates/recording/src/output_pipeline/macos_fragmented_m4s.rs b/crates/recording/src/output_pipeline/macos_fragmented_m4s.rs
index b091b9278..6d7c7532c 100644
--- a/crates/recording/src/output_pipeline/macos_fragmented_m4s.rs
+++ b/crates/recording/src/output_pipeline/macos_fragmented_m4s.rs
@@ -96,6 +96,8 @@ pub struct MacOSFragmentedM4SMuxer {
base_path: PathBuf,
video_config: VideoInfo,
segment_duration: Duration,
+ preset: H264Preset,
+ output_size: Option<(u32, u32)>,
state: Option<EncoderState>,
pause: SharedPauseState,
frame_drops: FrameDropTracker,
@@ -148,6 +150,8 @@ impl Muxer for MacOSFragmentedM4SMuxer {
base_path: output_path,
video_config,
segment_duration: config.segment_duration,
+ preset: config.preset,
+ output_size: config.output_size,
state: None,
pause,
frame_drops: FrameDropTracker::new(),
@@ -174,11 +178,17 @@ impl Muxer for MacOSFragmentedM4SMuxer {
let start = std::time::Instant::now();
loop {
if handle.is_finished() {
- if let Err(panic_payload) = handle.join() {
- warn!(
- "M4S encoder thread panicked during finish: {:?}",
- panic_payload
- );
+ match handle.join() {
+ Err(panic_payload) => {
+ warn!(
+ "M4S encoder thread panicked during finish: {:?}",
+ panic_payload
+ );
+ }
+ Ok(Err(e)) => {
+ warn!("M4S encoder thread returned error: {e}");
+ }
+ Ok(Ok(())) => {}
}
break;
}
@@ -218,9 +228,9 @@ impl MacOSFragmentedM4SMuxer {
let encoder_config = SegmentedVideoEncoderConfig {
segment_duration: self.segment_duration,
- preset: H264Preset::Ultrafast,
+ preset: self.preset,
bpp: H264EncoderBuilder::QUALITY_BPP,
- output_size: None,
+ output_size: self.output_size,
};
let encoder =
@@ -550,7 +560,7 @@ impl<'a> BaseAddrLockGuard<'a> {
impl Drop for BaseAddrLockGuard<'_> {
fn drop(&mut self) {
- let _ = unsafe { self.0.unlock_lock_base_addr(self.1) };
+ unsafe { self.0.unlock_lock_base_addr(self.1) };
}
}
@@ -558,6 +568,8 @@ pub struct MacOSFragmentedM4SCameraMuxer {
base_path: PathBuf,
video_config: VideoInfo,
segment_duration: Duration,
+ preset: H264Preset,
+ output_size: Option<(u32, u32)>,
state: Option<EncoderState>,
pause: SharedPauseState,
frame_drops: FrameDropTracker,
@@ -611,6 +623,8 @@ impl Muxer for MacOSFragmentedM4SCameraMuxer {
base_path: output_path,
video_config,
segment_duration: config.segment_duration,
+ preset: config.preset,
+ output_size: config.output_size,
state: None,
pause,
frame_drops: FrameDropTracker::new(),
@@ -637,11 +651,17 @@ impl Muxer for MacOSFragmentedM4SCameraMuxer {
let start = std::time::Instant::now();
loop {
if handle.is_finished() {
- if let Err(panic_payload) = handle.join() {
- warn!(
- "M4S camera encoder thread panicked during finish: {:?}",
- panic_payload
- );
+ match handle.join() {
+ Err(panic_payload) => {
+ warn!(
+ "M4S camera encoder thread panicked during finish: {:?}",
+ panic_payload
+ );
+ }
+ Ok(Err(e)) => {
+ warn!("M4S camera encoder thread returned error: {e}");
+ }
+ Ok(Ok(())) => {}
}
break;
}
@@ -681,9 +701,9 @@ impl MacOSFragmentedM4SCameraMuxer {
let encoder_config = SegmentedVideoEncoderConfig {
segment_duration: self.segment_duration,
- preset: H264Preset::Ultrafast,
+ preset: self.preset,
bpp: H264EncoderBuilder::QUALITY_BPP,
- output_size: None,
+ output_size: self.output_size,
};
let encoder =
diff --git a/crates/rendering/src/decoder/avassetreader.rs b/crates/rendering/src/decoder/avassetreader.rs
index f3b3f0a44..c7dcf1189 100644
--- a/crates/rendering/src/decoder/avassetreader.rs
+++ b/crates/rendering/src/decoder/avassetreader.rs
@@ -226,7 +226,7 @@ impl ImageBufProcessor {
}
impl CachedFrame {
- fn new(_processor: &ImageBufProcessor, image_buf: R<cv::ImageBuf>, number: u32) -> Self {
+ fn new(processor: &ImageBufProcessor, image_buf: R<cv::ImageBuf>, number: u32) -> Self {
let width = image_buf.width() as u32;
let height = image_buf.height() as u32;
@@ -246,7 +246,7 @@ impl CachedFrame {
}
format::Pixel::RGBA | format::Pixel::BGRA | format::Pixel::YUV420P => {
let mut img = image_buf;
- let (data, fmt, y_str, uv_str) = _processor.extract_raw(&mut img);
+ let (data, fmt, y_str, uv_str) = processor.extract_raw(&mut img);
return Self(ProcessedFrame {
_number: number,
width,