Skip to content

🎥 Make videos programmatically with React

`@remotion/compositor`: Make video seek to beginning if

Jonny Burger32c74b5776d0
diff --git a/packages/compositor-darwin-arm64/remotion b/packages/compositor-darwin-arm64/remotion
index 000c7e298c..110e269e02 100755
Binary files a/packages/compositor-darwin-arm64/remotion and b/packages/compositor-darwin-arm64/remotion differ
diff --git a/packages/compositor-darwin-x64/remotion b/packages/compositor-darwin-x64/remotion
index 41a0a314c3..af38a2821b 100755
Binary files a/packages/compositor-darwin-x64/remotion and b/packages/compositor-darwin-x64/remotion differ
diff --git a/packages/compositor-linux-arm64-gnu/remotion b/packages/compositor-linux-arm64-gnu/remotion
index d70d616e51..e9fc08e921 100755
Binary files a/packages/compositor-linux-arm64-gnu/remotion and b/packages/compositor-linux-arm64-gnu/remotion differ
diff --git a/packages/compositor-linux-arm64-musl/remotion b/packages/compositor-linux-arm64-musl/remotion
index dc2e533e59..48c11bbf54 100755
Binary files a/packages/compositor-linux-arm64-musl/remotion and b/packages/compositor-linux-arm64-musl/remotion differ
diff --git a/packages/compositor-linux-x64-gnu/remotion b/packages/compositor-linux-x64-gnu/remotion
index d199261d72..3eea7e0aff 100755
Binary files a/packages/compositor-linux-x64-gnu/remotion and b/packages/compositor-linux-x64-gnu/remotion differ
diff --git a/packages/compositor-linux-x64-musl/remotion b/packages/compositor-linux-x64-musl/remotion
index c87d7f2212..927db89187 100755
Binary files a/packages/compositor-linux-x64-musl/remotion and b/packages/compositor-linux-x64-musl/remotion differ
diff --git a/packages/compositor-win32-x64-msvc/remotion.exe b/packages/compositor-win32-x64-msvc/remotion.exe
index 169f67deba..e4b770cd42 100755
Binary files a/packages/compositor-win32-x64-msvc/remotion.exe and b/packages/compositor-win32-x64-msvc/remotion.exe differ
diff --git a/packages/compositor/rust/opened_stream.rs b/packages/compositor/rust/opened_stream.rs
index cdd8ba17d8..e3cc593b68 100644
--- a/packages/compositor/rust/opened_stream.rs
+++ b/packages/compositor/rust/opened_stream.rs
@@ -1,6 +1,6 @@
use std::{io::ErrorKind, time::SystemTime};
-use ffmpeg_next:: Rational;
+use ffmpeg_next::{ ffi::AVSEEK_FLAG_ANY, Rational};
use remotionffmpeg::{codec::Id, frame::Video, media::Type, Dictionary, StreamMut};
extern crate ffmpeg_next as remotionffmpeg;
use std::time::UNIX_EPOCH;
@@ -200,11 +200,19 @@ impl OpenedStream {
Err(err) => {
if err.to_string().contains("Operation not permitted") {
_print_verbose(&format!(
- "Seeking into a part of the file that contains executable code."
+ "Could not perform seek. Got 'Operation not permitted' error."
))?;
- _print_verbose(&format!("FFmpeg is unwilling to execute it."))?;
-
- Ok(())
+ _print_verbose(&format!("Attempting to seek to the beginning of the file."))?;
+ match self.input.seek(
+ self.stream_index as i32,
+ 0,
+ target_position,
+ 0,
+ AVSEEK_FLAG_ANY ,
+ ) {
+ Ok(_) => Ok(()),
+ Err(err) => Err(err)
+ }
} else {
Err(err)
}