feat(libSceAvPlayer): accept VP9 video and Opus audio streams #7200

Merged
mrfelek merged 1 commit from upstream-pr/7200 into main 2026-10-17 20:59:25 +00:00
mrfelek commented 2026-10-17 16:04:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-17T16:04:01Z.


What

sceAvPlayerAddSource now accepts VP9 video and Opus audio streams. IsStreamSupported only took H.264, HEVC and AAC, so a WebM source had no usable streams, and the player reported an error instead of playing.

Metal Gear Solid: Peace Walker (PPSA18216) passes its opening movies to sceAvPlayerAddSource as WebM files with VP9 and Opus, for example /app0/mgspw/mlg/data/mov/pw_op_eng.webm (1280x720). On main the movie gets no streams, and the game shows a black screen where it should play. Since the title hands these files to the system player, the console's AvPlayer accepts VP9 and Opus.

The bundled FFmpeg already has the VP9 and Opus decoders and the Matroska/WebM demuxer, so the change is the codec list. The decoded frames take the existing paths: video is converted to NV12 at the 256-byte pitch, and audio to 16-bit PCM.

VP8 and other codecs stay out, because I haven't seen a title use them.

guest_avplayer gets a VP9/Opus case. The test embeds a 1.6 KB WebM (100x60, 30 fps, 6 frames, silent stereo Opus at 48 kHz) with the same picture as the MP4 test movie. It checks the stream info, then checks every delivered frame with the existing picture and audio checks, until the end of the stream.

Tested

Release builds of this branch (main f51724078 plus this commit):

Linux Windows
System Ubuntu 26.10, GCC 15.3.0 Windows 11 Pro (build 26200), MinGW-w64 GCC 15.2.0 (winlibs, UCRT)
guest_avplayer, guest_avplayer_callback_close (ctest) pass pass
guest_avplayer_tests repeated 20 of 20 20 of 20
Negative control: main's Source.cpp new case fails with WebM ready event missing same
  • PPSA18216 on an RTX 3080 Ti, on main c9e6c45de with #6196, #6014, #6237, #6842 and #7072. With this change the opening movies decode and play through the 4-minute run. Without it the screen stays black after the Kant quote.
    • The movie picture itself still needs a local probe for a separate stop: the game reads a 4-sample render target with a plain 2D image instruction. That's covered in #5268 and isn't part of this PR.

Not tested on macOS or on a console. The title run was on Linux only.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA18216 #5268 (opening movies; the picture also needs the MSAA read described there)
  • GPUs tested: n/a
  • AI-assisted: yes

AI-assisted; the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4901662710 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7200). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-17T16:04:01Z. --- ### What `sceAvPlayerAddSource` now accepts VP9 video and Opus audio streams. `IsStreamSupported` only took H.264, HEVC and AAC, so a WebM source had no usable streams, and the player reported an error instead of playing. Metal Gear Solid: Peace Walker (PPSA18216) passes its opening movies to `sceAvPlayerAddSource` as WebM files with VP9 and Opus, for example `/app0/mgspw/mlg/data/mov/pw_op_eng.webm` (1280x720). On `main` the movie gets no streams, and the game shows a black screen where it should play. Since the title hands these files to the system player, the console's AvPlayer accepts VP9 and Opus. The bundled FFmpeg already has the VP9 and Opus decoders and the Matroska/WebM demuxer, so the change is the codec list. The decoded frames take the existing paths: video is converted to NV12 at the 256-byte pitch, and audio to 16-bit PCM. VP8 and other codecs stay out, because I haven't seen a title use them. `guest_avplayer` gets a VP9/Opus case. The test embeds a 1.6 KB WebM (100x60, 30 fps, 6 frames, silent stereo Opus at 48 kHz) with the same picture as the MP4 test movie. It checks the stream info, then checks every delivered frame with the existing picture and audio checks, until the end of the stream. ### Tested Release builds of this branch (`main` f51724078 plus this commit): | | Linux | Windows | |---|---|---| | System | Ubuntu 26.10, GCC 15.3.0 | Windows 11 Pro (build 26200), MinGW-w64 GCC 15.2.0 (winlibs, UCRT) | | `guest_avplayer`, `guest_avplayer_callback_close` (ctest) | pass | pass | | `guest_avplayer_tests` repeated | 20 of 20 | 20 of 20 | | Negative control: `main`'s `Source.cpp` | new case fails with `WebM ready event missing` | same | - PPSA18216 on an RTX 3080 Ti, on `main` c9e6c45de with #6196, #6014, #6237, #6842 and #7072. With this change the opening movies decode and play through the 4-minute run. Without it the screen stays black after the Kant quote. - The movie picture itself still needs a local probe for a separate stop: the game reads a 4-sample render target with a plain 2D image instruction. That's covered in [#5268](https://github.com/boykopovar/AnyPS5/discussions/5268#discussioncomment-19000435) and isn't part of this PR. Not tested on macOS or on a console. The title run was on Linux only. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: PPSA18216 #5268 (opening movies; the picture also needs the MSAA read described there) - [x] GPUs tested: n/a - [x] AI-assisted: yes AI-assisted; the runs are from my machine.
github-actions[bot] commented 2026-10-17 16:38:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T16:38:19Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1601 core/libs/prx/libSceAvPlayer/src/Source.cpp
core/libs/tests/GuestAvPlayer.cpp
PR 6044 core/libs/tests/GuestAvPlayer.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6236811408 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7200#issuecomment-6236811408). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T16:38:19Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1601](https://www.github.com/boykopovar/AnyPS5/pull/1601) | `core/libs/prx/libSceAvPlayer/src/Source.cpp`<br>`core/libs/tests/GuestAvPlayer.cpp` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestAvPlayer.cpp` |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7200
No description provided.