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 issue in windows #372

Merged
merged 7 commits into from
Sep 28, 2024

Conversation

tribhuwan-kumar
Copy link
Contributor

i tested with multiple video encoding for windows but none them are working like H.264 / MPEG 4 Part 10 encoding

eg:

VP8 encoding:

if env::consts::OS == "windows" {
    //VP8 encoding (WebM format)
    args.extend_from_slice(&[
        "-vcodec", "libvpx", 
        "-qmin", "10",  
        "-qmax", "42", 
        "-crf",  "10",       
        "-b:v", "1M", 
    ]);
}

AV1 encoding

if env::consts::OS == "windows" {
    //  AV1 encoder  (mp4 format)
    args.extend_from_slice(&[
        "-vcodec", "libsvtav1",
        "-preset", "medium",
        "-crf", "32",
        "-b:v", "2M",
        "-maxrate", "3M",
    ]);
}

/claim #319
/fix: #319

Copy link

vercel bot commented Sep 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
screenpipe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 28, 2024 9:26am

args.extend_from_slice(&["-vcodec", "libx264", "-preset", "ultrafast", "-crf", "23"]);
}
// Use libx264 for all platforms
args.extend_from_slice(&["-vcodec", "libx264", "-preset", "ultrafast", "-crf", "23", ]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how did you install ffmpeg? @tribhuwan-kumar

Copy link
Contributor Author

@tribhuwan-kumar tribhuwan-kumar Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ffmpeg is available in window's official package manager winget also for development purpose I installed ffmpeg from vcpkg.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this will crash

you should use the ffmpeg version from the pre_build.js which is packaged in the release of the app (or change this to use a "better" version of ffmpeg) the if i did is because the ffmpeg does not support the arg given here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#194 would probably resolve all the problems i guess

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this will crash

you should use the ffmpeg version from the pre_build.js which is packaged in the release of the app (or change this to use a "better" version of ffmpeg) the if i did is because the ffmpeg does not support the arg given here

Okay, I'm uninstalling the downloaded version of ffmpeg from winget & vcpkg and try to rebuild it with pre_build.js version of ffmpeg.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should use the ffmpeg version from the pre_build.js

I did some digging about the avbuild/windows-desktop/ffmpeg-7.0-windows-desktop and find out it doesn't supports the libx264 encoder:

so I test with multiple encoder and decided to use h264_mf (Microsoft Media Foundation) which is supported by avbuild version of ffmpeg & its working:

Let me know if any problem occurs :)

@louis030195
Copy link
Collaborator

louis030195 commented Sep 28, 2024

@tribhuwan-kumar nice amazing! trusting you, merging

PS: does audio transcription work for you on windows?

@louis030195 louis030195 merged commit 21ebe20 into mediar-ai:main Sep 28, 2024
1 check passed
@louis030195
Copy link
Collaborator

@tribhuwan-kumar CI broke :( https://github.com/mediar-ai/screenpipe/actions/runs/11085491539/job/30801967809

@tribhuwan-kumar
Copy link
Contributor Author

tribhuwan-kumar commented Sep 28, 2024

@tribhuwan-kumar CI broke :( https://github.com/mediar-ai/screenpipe/actions/runs/11085491539/job/30801967809

Let me fix it in real quick!

Update: I'm sorry, I created a func. in named exePath in pre_build.js which seems doesn't work well in github workflows!!

@tribhuwan-kumar
Copy link
Contributor Author

PS: does audio transcription work for you on windows?

Yes, the audio transcription is working, If any issue occurs i'll let you know.

@mediar-ai mediar-ai deleted a comment from algora-pbc bot Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

($150, Typescript) video embedding in UI app does not render properly on windows
2 participants