Commit b8272ae 1 parent fe585ac commit b8272ae Copy full SHA for b8272ae
File tree 1 file changed +15
-7
lines changed
1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -427,20 +427,28 @@ impl EncodeArgs {
427
427
}
428
428
429
429
if current_pass == passes {
430
- let encoded_frames = num_frames ( chunk. output ( ) . as_ref ( ) ) . unwrap ( ) ;
430
+ let encoded_frames = num_frames ( chunk. output ( ) . as_ref ( ) ) ;
431
+
432
+ let err_str = match encoded_frames {
433
+ Ok ( encoded_frames) if encoded_frames != chunk. frames => Some ( format ! (
434
+ "FRAME MISMATCH: chunk {}: {}/{} (actual/expected frames)" ,
435
+ chunk. index, encoded_frames, chunk. frames
436
+ ) ) ,
437
+ Err ( error) => Some ( format ! (
438
+ "FAILED TO COUNT FRAMES: chunk {}: {}" ,
439
+ chunk. index, error
440
+ ) ) ,
441
+ _ => None ,
442
+ } ;
431
443
432
- if encoded_frames != chunk . frames {
444
+ if let Some ( err_str ) = err_str {
433
445
return Err ( (
434
446
EncoderCrash {
435
447
exit_status : enc_output. status ,
436
448
source_pipe_stderr : source_pipe_stderr. into ( ) ,
437
449
ffmpeg_pipe_stderr : ffmpeg_pipe_stderr. map ( Into :: into) ,
438
450
stderr : enc_stderr. into ( ) ,
439
- stdout : format ! (
440
- "FRAME MISMATCH: chunk {}: {}/{} (actual/expected frames)" ,
441
- chunk. index, encoded_frames, chunk. frames
442
- )
443
- . into ( ) ,
451
+ stdout : err_str. into ( ) ,
444
452
} ,
445
453
frame,
446
454
) ) ;
You can’t perform that action at this time.
0 commit comments