screenpipe icon indicating copy to clipboard operation
screenpipe copied to clipboard

[bounty] nextjs loom replacement pipe

Open louis030195 opened this issue 1 year ago • 20 comments

/bounty 100

definition of done:

  • at the end of the day i can go to screenpipe and ask for a loom of a specific time range
  • it should be a nextjs pipe
  • minimum version is taking a time range and stitching together mp4 files (video and audio) and giving me back the video with audio

bonus:

  • highlights, good UX like loom (somehow)

check this nextjs pipe https://github.com/mediar-ai/screenpipe/tree/main/examples/typescript/pipe-simple-nextjs

also be aware nextjs does have some issue with deno sometimes - for example openai streaming failed for me once idk why (we're thinking in switching to bun soon)

related #582

more context: https://github.com/mediar-ai/screenpipe/blob/cf2b374a65252734f840fc6430e8221d6c5a4bda/screenpipe-server/src/server.rs#L967

we have endpoint to merge video but might need some changes, e.g. this task might involve a little bit of rust

my use case:

image

PLEASE say the UX you think of and how you're going to implement this before starting the task plz

louis030195 avatar Oct 25 '24 18:10 louis030195

~~## 💎 $100 bounty • Screenpi.pe~~

~~### Steps to solve:~~ ~~1. Start working: Comment /attempt #583 with your implementation plan~~ ~~2. Submit work: Create a pull request including /claim #583 in the PR body to claim the bounty~~ ~~3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts~~

~~Thank you for contributing to mediar-ai/screenpipe!~~

~~Add a bountyShare on socials~~

Attempt Started (GMT+0) Solution
🟢 @tribhuwan-kumar Oct 25, 2024, 9:43:29 PM #619
🟢 @volfcan Oct 28, 2024, 9:50:57 AM WIP

algora-pbc[bot] avatar Oct 25 '24 18:10 algora-pbc[bot]

/attempt #583

Algora profile Completed bounties Tech Active attempts Options
@tribhuwan-kumar 4 mediar-ai bounties
Rust, JavaScript,
Lua & more
Cancel attempt

tribhuwan-kumar avatar Oct 25 '24 21:10 tribhuwan-kumar

/attempt #583

Options

volkan0x avatar Oct 28 '24 09:10 volkan0x

@louis030195 i'm thinking to implement something like this, there will a time & date option, user can select a time interval for loom, then it'll merge those specific time ranged videos and audio in one video and send back to the user. there will also an option for quick share, so user can directly share that video on whatsapp, x, etc. i might take some inspiration from loom

(extra feature in this pipe could be a quick summary of that time interval and summary of that video, also it'd be great if user can interact with this pipe)

tribhuwan-kumar avatar Oct 28 '24 11:10 tribhuwan-kumar

pretty much the same way with the @tribhuwan-kumar.

there will be a time & date component and when users select the time range for a loom video it'll create the video and send back to the user.

volkan0x avatar Oct 29 '24 13:10 volkan0x

pretty much the same way with the @tribhuwan-kumar.

there will be a time & date component and when users select the time range for a loom video it'll create the video and send back to the user.

the searching and merging are done, i'm currently working on ux, if you have any suggestion for ux we can collaborate!

tribhuwan-kumar avatar Oct 29 '24 13:10 tribhuwan-kumar

pretty much the same way with the @tribhuwan-kumar. there will be a time & date component and when users select the time range for a loom video it'll create the video and send back to the user.

the searching and merging are done, i'm currently working on ux, if you have any suggestion for ux we can collaborate!

check your twitter dms

volkan0x avatar Oct 29 '24 15:10 volkan0x

check your twitter dms

there's nothing

tribhuwan-kumar avatar Oct 29 '24 16:10 tribhuwan-kumar

sounds good

@louis030195 i'm thinking to implement something like this, there will a time & date option, user can select a time interval for loom, then it'll merge those specific time ranged videos and audio in one video and send back to the user. there will also an option for quick share, so user can directly share that video on whatsapp, x, etc. i might take some inspiration from loom

(extra feature in this pipe could be a quick summary of that time interval and summary of that video, also it'd be great if user can interact with this pipe)

louis030195 avatar Oct 29 '24 17:10 louis030195

@louis030195 is this ui is okay ? it will open a dialog of merged video and audio

image

tribhuwan-kumar avatar Oct 30 '24 22:10 tribhuwan-kumar

there was a 500 internal problem with merge frame route, i fixed that. but i noticed some strange behavior while merging videos, imagine this situation, i kill the screenpipe while processing some videos. after killing the screenpipe the video remains uncompleted. and these uncompleted videos are causing errors while merging large amount of videos. maybe i need to add some checks before merging those videos.

i got a corrupt video

PS C:\Users\eirae\Downloads\app\screenpipe> C:\Users\eirae\Downloads\app\screenpipe\screenpipe-app-tauri\src-tauri\ffmpeg\bin\x64\ffmpeg.exe -v error
 -i C:\\Users\\eirae\\.screenpipe\\data\\monitor_65537_2024-10-31_01-32-59.mp4 -f null -
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000022CB0AF1780] moov atom not found
[in#0 @ 0000022CB0ADA540] Error opening input: Invalid data found when processing input
Error opening input file C:\\Users\\eirae\\.screenpipe\\data\\monitor_65537_2024-10-31_01-32-59.mp4.
Error opening input files: Invalid data found when processing input

tribhuwan-kumar avatar Oct 31 '24 06:10 tribhuwan-kumar

@tribhuwan-kumar

nice

video should have audio too at least

i'm actually shipping an endpoint that allows you to stream frames through SSE at high speed for #343

https://github.com/mediar-ai/screenpipe/tree/timeline-ui

i think you might wait i merge this and i'm likely going to do some hacks to stream the audio too so it might solve your problem

louis030195 avatar Oct 31 '24 15:10 louis030195

@tribhuwan-kumar

nice

video should have audio too at least

right now, i'm able to merge video to video and audio to audio, (merged video and merged audio are separate)
i tried to merge video to audio but the problem i'm getting is order correction, some audio have only beep sound, some have sound but how can i merge those audio with their corresponding video frame.

i'm actually shipping an endpoint that allows you to stream frames through SSE at high speed for #343

https://github.com/mediar-ai/screenpipe/tree/timeline-ui

i think you might wait i merge this and i'm likely going to do some hacks to stream the audio too so it might solve your problem

for now, i fixed those corrupt video error, by filtering out those video. it prevents corrupt videos getting in input_list.txt, this can be slow bcz it adds an extra check before merging them

tribhuwan-kumar avatar Oct 31 '24 16:10 tribhuwan-kumar

@louis030195 a working beta version:

https://github.com/user-attachments/assets/44f985bd-172d-4595-b140-e4d30fbe7f77

tribhuwan-kumar avatar Oct 31 '24 20:10 tribhuwan-kumar

💡 @tribhuwan-kumar submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar Nov 01 '24 08:11 algora-pbc[bot]

@louis030195 a working beta version:

a.mp4

thats cool

is there audio in it?

louis030195 avatar Nov 01 '24 17:11 louis030195

@louis030195 a working beta version:

a.mp4

thats cool

is there audio in it?

no, that merged video doesn't have audio, it's just a series of video concatenated by ffmpeg, it doesn't have embedded audio. I tried to embed video with audio but I'm facing issues of order synchronizing :(

tribhuwan-kumar avatar Nov 01 '24 21:11 tribhuwan-kumar

@louis030195 a working beta version:

a.mp4

thats cool is there audio in it?

no, that merged video doesn't have audio, it's just a series of video concatenated by ffmpeg, it doesn't have embedded audio. I tried to embed video with audio but I'm facing issues of order synchronizing :(

are you using database metadata?

you can fetch all the things and order by time

i guess it's possible to have 1-3 seconds of audio desync because we capture timestamp not right sync

also if you try to create a loom over too long range things that i expect to happen:

  • say i closed my lid (screen capture stop but mic keeps going i think) -> will have weird desync with audio

although this should be only for short times

i guess a version 10.0 of this would be to feed this to a voice LLM and fix all the things automatically and comment on the video haha

louis030195 avatar Nov 01 '24 23:11 louis030195

are you using database metadata?

you can fetch all the things and order by time

i guess it's possible to have 1-3 seconds of audio desync because we capture timestamp not right sync

also if you try to create a loom over too long range things that i expect to happen:

  • say i closed my lid (screen capture stop but mic keeps going i think) -> will have weird desync with audio

although this should be only for short times

i guess a version 10.0 of this would be to feed this to a voice LLM and fix all the things automatically and comment on the video haha

then i've to create an another route for embedding audio in video bcz this can only concatenate the videos and audios. & thanks for the metadata it would be helpful for embedding :)

tribhuwan-kumar avatar Nov 02 '24 09:11 tribhuwan-kumar

🎉🎈 @tribhuwan-kumar has been awarded $100! 🎈🎊

algora-pbc[bot] avatar Nov 29 '24 18:11 algora-pbc[bot]