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

bundle macOS App and upload it as artifact #13529

Merged
merged 12 commits into from
Feb 24, 2024
Merged

Conversation

Akemi
Copy link
Member

@Akemi Akemi commented Feb 21, 2024

No description provided.

Copy link

github-actions bot commented Feb 21, 2024

Download the artifacts for this pull request:

Windows

@Akemi Akemi force-pushed the mac_bundle branch 5 times, most recently from 079325f to 65922db Compare February 22, 2024 00:05
@ottob
Copy link

ottob commented Feb 22, 2024

Really nice to see this. Would it be possible to create a macOS arm64 binary also?

@Akemi
Copy link
Member Author

Akemi commented Feb 22, 2024

yes definitely possible, that was my plan. i have everything 'planned' out, just need to test a few more things in the workers, test that everything works properly and then will add arm builds too.

there will be some limitations though, eg the bundles will only work on systems of the same version, eg the min macOS version is set to the one where it was built on. because of that i want 4 runners+builds. newest macOS version and the one 2 versions prior, for arm and intel. though there are only arm runners for macOS 13+14 atm.

@Akemi Akemi force-pushed the mac_bundle branch 3 times, most recently from ba91447 to 6c8b6d4 Compare February 22, 2024 19:49
@Akemi Akemi force-pushed the mac_bundle branch 8 times, most recently from e179478 to fa113e7 Compare February 23, 2024 22:01
@ottob
Copy link

ottob commented Feb 23, 2024

The latest arm64 artifact works well on my MacBook with m2 processor. 🎉 Though I had to run xattr -d com.apple.quarantine ./mpv.app before I could start it.

I have only found one small issue. If I play a hevc mp4 file from the terminal or drop it on the mpv.app bundle the video plays correctly. But if I start the app and then drop the same file on the window that says "Drop files or URLs to play here", the file starts playing (I get sound) but the window only shows flashing colors. This was using config:
vo=gpu-next
gpu-api=vulkan
gpu-context=macvk

If I use the default config instead the window is only black (sound playing).

@Akemi
Copy link
Member Author

Akemi commented Feb 23, 2024

The latest arm64 artifact works well on my MacBook with m2 processor. 🎉 Though I had to run xattr -d com.apple.quarantine ./mpv.app before I could start it.

that's normal, the app is signed with a pseudo identity. you can also just hold the option key, right click mpv.app and then click on open (all while holding the option key).

I have only found one small issue. If I play a hevc mp4 file from the terminal or drop it on the mpv.app bundle the video plays correctly. But if I start the app and then drop the same file on the window that says "Drop files or URLs to play here", the file starts playing (I get sound) but the window only shows flashing colors. This was using config: vo=gpu-next gpu-api=vulkan gpu-context=macvk

If I use the default config instead the window is only black (sound playing).

this issue has already been reported #13505, though the title is still a bit misleading. seems to be introduced with a newer moltenvk version.

you can work around that by toggling the video, shortcut is _ (underscore)

before errors and outputs where ignored from the subscript and the main
script didn't fail nor did it output anything.

with this change the script properly outputs everything to stdout and
stderr. in the case the dylib script fails the whole script fails now.

the main function in dylib_unhell was kept since it can still be used
individually without the oscbundle script. the script had to be renamed
with an underscore to make it importable.
@Akemi Akemi force-pushed the mac_bundle branch 3 times, most recently from 2bfc9da to 4585819 Compare February 24, 2024 16:00
@Akemi
Copy link
Member Author

Akemi commented Feb 24, 2024

for now we only have 2 intel builds for macOS 12 and 13, and 1 arm build for macOS 14, because there are only runners for those macOS versions and architectures.

if we want more/need more combinations, we probably need to cross compile. though that is out of scope of this PR.

i tested the comment changes on my fork here Akemi#13

@ottob
Copy link

ottob commented Feb 24, 2024

Just curious, is hw acceleration with videotoolbox enabled in this build?
Like how its done here: m154k1/mpv-build-macOS@d4667a7

If I play a hevc file with verbose log I got:

[vd] Codec list:
[vd]     hevc - HEVC (High Efficiency Video Coding)
[vd] Opening decoder hevc
[vd] No hardware decoding requested.
[vd] Using software decoding.
[vd] Detected 8 logical cores.
[vd] Requesting 9 threads for decoding.
[vd] Selected codec: HEVC (High Efficiency Video Coding)

Is that expected?

@Akemi
Copy link
Member Author

Akemi commented Feb 24, 2024

it uses the standard ffmpeg from homebrew, how exactly it is configured i don't know. but yes hardware decoding is working with those builds.

but like your log says No hardware decoding requested., you are not requesting hwdec, hence why it is not using it. you have to at least set --hwdec=auto, since hwdec is disabled by default.

here a log with --hwdec=auto:

[vd] Codec list:
[vd]     hevc - HEVC (High Efficiency Video Coding)
[vd] Opening decoder hevc
[vd] Looking at hwdec hevc-videotoolbox...
[vo/gpu-next] Loading hwdec drivers for format: 'videotoolbox'
[vo/gpu-next] Loading hwdec driver 'videotoolbox'
[vd] Trying hardware decoding via hevc-videotoolbox.
[vd] Selected codec: HEVC (High Efficiency Video Coding)
...
[vd] Pixel formats supported by decoder: videotoolbox_vld yuv420p10le
[vd] Codec profile: Main 10 (0x2)
[vd] Requesting pixfmt 'videotoolbox_vld' from decoder.
[vd] Using hardware decoding (videotoolbox).

@Akemi Akemi changed the title WIP: bundle macOS App and upload it as artifact bundle macOS App and upload it as artifact Feb 24, 2024
@ottob
Copy link

ottob commented Feb 24, 2024

you have to at least set --hwdec=auto, since hwdec is disabled by default.

I see. Thanks for the tip. With hwdec=auto I also get:

[vd] Codec list:
[vd]     hevc - HEVC (High Efficiency Video Coding)
[vd] Opening decoder hevc
[vd] Looking at hwdec hevc-videotoolbox...
[vo/gpu-next] Loading hwdec drivers for format: 'videotoolbox'
[vo/gpu-next] Loading hwdec driver 'videotoolbox'
[vd] Trying hardware decoding via hevc-videotoolbox.
...
[vd] Using hardware decoding (videotoolbox).

@Akemi Akemi merged commit f9b8f15 into mpv-player:master Feb 24, 2024
12 checks passed
@Akemi Akemi deleted the mac_bundle branch February 24, 2024 19:04
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.

3 participants