Skip to content

Commit

Permalink
strand-cam: be more robust to NVENC failure
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw committed Apr 17, 2024
1 parent 7c7e9d0 commit 15e8ed0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion strand-cam/src/strand-cam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,13 @@ fn test_nvenc_save(frame: DynamicFrame) -> Result<bool> {
};

let mut mp4_writer = mp4_writer::Mp4Writer::new(&mut buf, nv_cfg_test, Some(nv_enc))?;
mp4_writer.write_dynamic(&frame, chrono::Utc::now())?;
match mp4_writer.write_dynamic(&frame, chrono::Utc::now()) {
Ok(()) => {}
Err(e) => {
debug!("nvidia NvEnc could not be initialized: {:?}", e);
return Ok(false);
}
}
mp4_writer.finish()?;

debug!("MP4 video with nvenc h264 encoding succeeded.");
Expand Down

0 comments on commit 15e8ed0

Please sign in to comment.