-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
writing videos to local data and (hardcoded) reading a frame and pres…
…enting it in timeline
- Loading branch information
1 parent
257482c
commit 34c17b3
Showing
9 changed files
with
492 additions
and
45 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
use std::env; | ||
use std::path::PathBuf; | ||
|
||
fn main() { | ||
// // Get the manifest directory (location of Cargo.toml) | ||
// let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); | ||
// | ||
// // Construct the path to the ffmpeg binary | ||
// let ffmpeg_binary_path = PathBuf::from(manifest_dir) | ||
// .join("binaries") | ||
// .join("ffmpeg"); | ||
// | ||
// // Convert the path to a string and add it to the linker search path | ||
// let ffmpeg_binary_path = ffmpeg_binary_path.to_str().unwrap(); | ||
// println!("cargo:rustc-link-search=native={}", ffmpeg_binary_path); | ||
tauri_build::build() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
mod core; | ||
mod embed; | ||
mod video; | ||
|
||
pub use core::start_recording; | ||
pub use core::CaptureHandles; | ||
pub use video::extract_frames_from_video; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,64 @@ | ||
<h1>Timeline</h1> | ||
<script> | ||
import { onMount } from 'svelte'; | ||
import { pan } from 'svelte-gestures'; | ||
let frameNumber = 0; | ||
let swipePosition = 0; | ||
let imageSrc = ''; | ||
let debounceTimer; | ||
function debounce(func, delay) { | ||
return function(...args) { | ||
clearTimeout(debounceTimer); | ||
debounceTimer = setTimeout(() => func.apply(this, args), delay); | ||
}; | ||
} | ||
const loadImage = debounce(() => { | ||
imageSrc = `http://localhost:3030/get_frame/${frameNumber}`; | ||
console.log(imageSrc); | ||
}, 100); | ||
function updateFrame() { | ||
const newFrame = Math.round(swipePosition); | ||
if (newFrame !== frameNumber) { | ||
frameNumber = newFrame; | ||
loadImage(); | ||
} | ||
} | ||
function handlePan(event) { | ||
const { deltaX } = event; | ||
swipePosition = Math.min(Math.max(0, swipePosition + (deltaX / 20)), 10) | ||
updateFrame(); | ||
} | ||
// Set up and tear down the scroll event listener | ||
onMount(() => { | ||
window.onwheel = (event) => { | ||
handlePan(event); | ||
event.stopPropagation(); | ||
}; | ||
loadImage(); | ||
}); | ||
</script> | ||
|
||
<div class="frame-container"> | ||
{#if imageSrc} | ||
<img draggable={false} src={imageSrc} alt="Video Frame" /> | ||
{:else} | ||
<p>Loading frame...</p> | ||
{/if} | ||
</div> | ||
|
||
<style> | ||
.frame-container { | ||
/* Your styling here */ | ||
overflow: hidden; | ||
user-select: none; | ||
} | ||
img { | ||
/* Style for the image */ | ||
} | ||
</style> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters