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

mpv unusable on default asahi #269

Open
nsklaus opened this issue Feb 17, 2024 · 2 comments
Open

mpv unusable on default asahi #269

nsklaus opened this issue Feb 17, 2024 · 2 comments

Comments

@nsklaus
Copy link

nsklaus commented Feb 17, 2024

with base asahi if i install mpv, the experience is pretty bad.
when i seek into the video, the playback gets stuck, it freezes, mpv is struggling to cope up with seeking fastforward/rewind actions. the normal playback too (withtout seeking) is also often suffering from stuttering and frameskip issues.

if i install rpmfusion, with multimedia libs and codecs, the situation gets a lot better. but i suspect there is a problem with asahi and what i see with default libs/codecs/repo should not happen.

here's a 54mb video that showcase what is mpv behavior on default asahi,
when you see the osd onscreen, (the white bar toward the bottom of the picture, it means i'm seeking into the video. when you see the play/pause button getting toggled back and forth, it means i'm pressing spacebar to pause/play the video.)
you'll notice many point when the video should be playing but the picture is frozen instead. of course there is also a large audio sync problem when seeking into the video. i mean that often time i hear the audio playing but the image is frozen. there are also cases where the image plays but audio is stuck.

https://file.io/eoAIh2LIQ4xC <-- this is base asahi (54mb vid)
https://file.io/utmTznY9cSwf <-- this is rpmfusion (47mb vid)

let me know if you need more infos or context, or logs or more tests, whatever you need.

@DavidBuchanan314
Copy link

I was seeing similar behaviors in web-based video players in firefox, which went away after installing the rpmfusion codecs. Particularly, seeking backwards in a video would often freeze it until a page refresh.

@eiln
Copy link

eiln commented Feb 28, 2024

From the file name ("BrRip.x264...mp4") I will assume the video is encoded in H.264. This is not a player error (can repro on mpv, vlc, firefox) but a decoder error. Before manually installing the RPM Fusion codecs (install rpm fusion then install libavcodec-freeworld; this enables ffmpeg's native h264 decoder), Asahi configures H.264 videos to be decoded with Cisco's openh264 codec by default. The thing is openh264 is at best an interim solution; it has no SIMD and it's missing support for many features in higher profiles. I just helped another person debug a missing feature issue.

Even if openh264 supports every feature, another thing is decoding speed, and why that impacts seeking. The thing with inter-frame codecs (e.g. H.264) is that (most) frames are encoded as deltas from previously decoded frames existing in memory, so, in order to seek to a frame, you have to decode starting from the last standalone intra-frame all the way up to the frame to seek to, which means a lot more decoding. If things get slow enough it can cause the sync issues in your recording.

TLDR install rpm fusion then install libavcodec-freeworld. From what I can tell manual action will be needed to enable the hardware decoder too (once that driver comes) for the same legal reasons we can't hook rpm fusion by default.

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

No branches or pull requests

3 participants