Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: video rendering #208

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/videos/create-bs-posts.mp4
Binary file not shown.
Binary file modified docs/videos/discovery.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/agent-explore/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
}
video {
max-height: 640px;
max-width: 50vw;
max-width: 100%;
}
9 changes: 6 additions & 3 deletions scripts/upload-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ const destPath = path.join(__dirname, '../docs/videos');
videos.forEach((video) => {
console.log('Cropping video: ', video)
const videoName = video.split('.')[0];
// ffmpeg -i input.mp4 -c:v libvpx -b:v 1M -c:a libopus -b:a 128k output.mp4

const command = `ffmpeg -y -hide_banner -loglevel error -i ${videosPath}/${video} -ss 3 -vf "crop=960:720:(in_w-960)/2:0" ${destPath}/${videoName}.mp4`;
const length = String(execSync(`ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 ${videosPath}/${video}`))
.slice(0, -1)
console.log(`Original length: ${length} seconds`)
const command = `ffmpeg -y -hide_banner -loglevel error -ss 3 -to ${parseInt(length, 10) - 0.1} -i ${videosPath}/${video} -vf "crop=960:720:(in_w-960)/2:0" ${destPath}/${videoName}.mp4`;
execSync(command);
const length2 = String(execSync(`ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 ${destPath}/${videoName}.mp4`)).slice(0, -1)
console.log(`Trimmed length: ${length2}`)
const size = String(execSync(`du -sh ${destPath}/${videoName}.mp4`)).slice(0, -1)
console.log(`Size: ${size}`)
});
Expand Down