Skip to content

Allow static ffmpeg linking - #57

Open
WhySoBad wants to merge 5 commits into
colinmarc:mainfrom
WhySoBad:main
Open

WhySoBad wants to merge 5 commits into
colinmarc:mainfrom
WhySoBad:main

Conversation

@WhySoBad

Copy link
Copy Markdown

Hi,
I've had issues with running the client on Arch since the project relies on ffmpeg7.0 and the Arch repositories only include ffmpeg8.0

This pull request adds the possibility to statically link ffmpeg into the client using the following two features

  • ffmpeg_build: Downloads the correct ffmpeg source, compiles it and statically links it
  • ffmpeg_static: Statically links against system ffmpeg

@colinmarc

Copy link
Copy Markdown
Owner

Hi @WhySoBad, thanks, this looks reasonable. If it works locally and in CI we can probably just make it the default.

@WhySoBad

Copy link
Copy Markdown
Author

Sure, sounds good to me. Should I already add it as the default or do you want to do some local testing as well?

@WhySoBad

WhySoBad commented Feb 3, 2026

Copy link
Copy Markdown
Author

Hi,
I've now also enabled the feature on ffmpeg-sys-next which allows vulkan hardware acceleration. However, I still run into this problem:
https://github.com/WhySoBad/magic-mirror/blob/6672c65e778ade8281c1616f37ce00aa85baab11/mm-client/src/video.rs#L1063

Is this a problem or does this mean that the application uses hardware decoding?

I get the following get_hw_format debug logs:

 
2026-02-03T15:54:58.876592Z DEBUG mm_client::video: get_hw_format formats=[VULKAN, YUV420P] sw_pix_fmt=AV_PIX_FMT_YUV420P
2026-02-03T15:54:58.876612Z DEBUG mm_client::video: get_hw_format formats=[YUV420P, YUV420P] sw_pix_fmt=AV_PIX_FMT_YUV420P
2026-02-03T15:58:02.180163Z DEBUG mm_client::video: get_hw_format formats=[VULKAN, YUV420P] sw_pix_fmt=AV_PIX_FMT_YUV420P
2026-02-03T15:58:02.180186Z DEBUG mm_client::video: get_hw_format formats=[YUV420P, YUV420P] sw_pix_fmt=AV_PIX_FMT_YUV420P

@colinmarc

Copy link
Copy Markdown
Owner

It could be a problem - it could mean that the "custom" build didn't have hardware decoding enabled at build time.

I'm away from my linux workstation atm, which is why I haven't managed to test this yet.

@WhySoBad

WhySoBad commented Feb 3, 2026

Copy link
Copy Markdown
Author

No worries, also I forgot to mention that I needed to update the ffmpeg-sys-next dependency by a minor version since those feature flags weren't available before.

I think it's now running with hardware decoding since my laptop (with a i7 8th gen) was able to "playback" with about 50% cpu utilization on a single core without much variation between constant and moving scenes.

Also, I'm not an expert with vulkan and stuff, so if you find something in your testing, those are the features available: https://docs.rs/crate/ffmpeg-sys-next/7.1.3/features
If you could tell me which ones to additionally enable this would be great :)

@WhySoBad

WhySoBad commented Apr 5, 2026

Copy link
Copy Markdown
Author

Hi,
I've been using this version for quite some time now and everything seems to work fine. I don't want to stress, but did you manage to review thise changes? I'd like to create an AUR package once this pull request is merged :)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants