Skip to content

🎥 Make videos programmatically with React

`@remotion/renderer`: Fix video with 180° rotation

Jonny Burger5728b9cd7854
diff --git a/packages/renderer/rust/rotation.rs b/packages/renderer/rust/rotation.rs
index 3e6c47f42e..486c43023d 100644
--- a/packages/renderer/rust/rotation.rs
+++ b/packages/renderer/rust/rotation.rs
@@ -6,10 +6,7 @@ pub fn get_from_side_data(value: &[u8]) -> Result<f64, ErrorWithBacktrace> {
let mut i32_values: Vec<i32> = Vec::new();
for bytes in value.chunks(4) {
- let i32_value = ((bytes[0] as i32) << 24)
- + ((bytes[1] as i32) << 16)
- + ((bytes[2] as i32) << 8)
- + (bytes[3] as i32);
+ let i32_value = i32::from_le_bytes(bytes.try_into().unwrap());
i32_values.push(i32_value);
}