fix(avplayer): report frame rate and colour info in extended video details #7412

Closed
maozdemir wants to merge 3 commits from upstream-pr/7412 into main
maozdemir commented 2026-10-18 05:12:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by maozdemir on 2026-10-18T05:12:16Z.


What

sceAvPlayerGetStreamInfoEx now fills the video details that titles read from SceAvPlayerVideoEx:

  • frame_rate: a double at byte 48 of the video details. It was left zero. BloodRayne 2: ReVamped (Unity) reads it,
    computes 1000 / fps = inf and treats the video as ended after the first frame, so it pauses forever on a black screen. It
    now reports the stream's frame rate.
  • colour_primaries (byte 56) and transfer_characteristics (byte 60): two uint32 fields filled from the codec's
    colour primaries and transfer characteristic. The layout follows
    KytyPS5. reserved2[24] became these two
    fields plus reserved2[16]. A static_assert pins both offsets, and sizeof stays 80.
  • Docs: docs/dev/debt/libSceAvPlayer.md and docs/dev/debt/libs.md are updated.

Not covered, and listed as technical debt:

  • The colour field layout is unconfirmed on a console. BloodRayne 2 never reads it.
  • Frame info (sceAvPlayerGetVideoDataEx) does not fill frame_rate or the colour fields.
  • Padding bytes 43-47 and 64-79 are left zero.

Tested

  • OS: Windows 11, GCC 15.2 (WinLibs) build.
  • Automated: guest_avplayer_tests passed (ctest -R guest_avplayer, 1/1). It does not assert the colour fields, because
    the test video's colour tags are unknown.
  • Homebrew: BloodRayne 2: ReVamped (Unity, PS5). I attached a debugger right after Unity's GetStreamInfoEx call and
    dumped the struct. For the 1280x960 video stream:
    • frame_rate is 29.970029, matching ffprobe.
    • colour_primaries and transfer_characteristics are both 2 (ffmpeg "unspecified"), matching ffprobe's unknown for
      these untagged videos.
    • Luma/chroma depth is 8/8, pitch is 0x500, and the padding is zero.
    • The audio stream entries have all-zero video fields.
  • Retail titles: not tested.
  • Colour values: no stream tagged with real colour values (for example bt709 → 1/1) was captured in-game.

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 (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: BloodRayne 2: ReVamped (title ID and Game bring-up discussion number to be added)
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4906566436 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7412). Originally posted by [maozdemir](https://github.com/maozdemir) on 2026-10-18T05:12:16Z. --- ### What `sceAvPlayerGetStreamInfoEx` now fills the video details that titles read from `SceAvPlayerVideoEx`: - **`frame_rate`:** a double at byte 48 of the video details. It was left zero. BloodRayne 2: ReVamped (Unity) reads it, computes `1000 / fps = inf` and treats the video as ended after the first frame, so it pauses forever on a black screen. It now reports the stream's frame rate. - **`colour_primaries` (byte 56) and `transfer_characteristics` (byte 60):** two `uint32` fields filled from the codec's colour primaries and transfer characteristic. The layout follows [KytyPS5](https://github.com/KytyPS5/KytyPS5/blob/main/src/libs/avPlayer.cpp#L231-L250). `reserved2[24]` became these two fields plus `reserved2[16]`. A `static_assert` pins both offsets, and `sizeof` stays 80. - **Docs:** `docs/dev/debt/libSceAvPlayer.md` and `docs/dev/debt/libs.md` are updated. Not covered, and listed as technical debt: - The colour field layout is unconfirmed on a console. BloodRayne 2 never reads it. - Frame info (`sceAvPlayerGetVideoDataEx`) does not fill `frame_rate` or the colour fields. - Padding bytes 43-47 and 64-79 are left zero. ### Tested - **OS:** Windows 11, GCC 15.2 (WinLibs) build. - **Automated:** `guest_avplayer_tests` passed (`ctest -R guest_avplayer`, 1/1). It does not assert the colour fields, because the test video's colour tags are unknown. - **Homebrew:** BloodRayne 2: ReVamped (Unity, PS5). I attached a debugger right after Unity's `GetStreamInfoEx` call and dumped the struct. For the 1280x960 video stream: - `frame_rate` is 29.970029, matching ffprobe. - `colour_primaries` and `transfer_characteristics` are both 2 (ffmpeg "unspecified"), matching ffprobe's `unknown` for these untagged videos. - Luma/chroma depth is 8/8, `pitch` is 0x500, and the padding is zero. - The audio stream entries have all-zero video fields. - **Retail titles:** not tested. - **Colour values:** no stream tagged with real colour values (for example bt709 → 1/1) was captured in-game. ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical 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 (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: BloodRayne 2: ReVamped (title ID and Game bring-up discussion number to be added) - [x] GPUs tested: n/a - [x] AI-assisted: yes
copilot-pull-request-reviewer[bot] commented 2026-10-18 05:12:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-18T05:12:21Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5561539436 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7412#pullrequestreview-5561539436). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-10-18T05:12:21Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
MarcZX10 commented 2026-10-18 05:33:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T05:33:03Z.


The conventions run on head 7a0cba2d is failing because the PR body still has the template placeholders: What and Tested are empty, all checklist items are unchecked, and AI-assisted / Depends on are unanswered. The title Fix/avplayer video ex frame rate also fails the repository’s Conventional Commits title check. The full output is in the failed job. Please fill the template and retitle it (for example, fix(avplayer): ...) to get the conventions check green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246135853 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7412#issuecomment-6246135853). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T05:33:03Z. --- The conventions run on head `7a0cba2d` is failing because the PR body still has the template placeholders: `What` and `Tested` are empty, all checklist items are unchecked, and `AI-assisted` / `Depends on` are unanswered. The title `Fix/avplayer video ex frame rate` also fails the repository’s Conventional Commits title check. The full output is in [the failed job](https://github.com/boykopovar/AnyPS5/actions/runs/39099822421/job/117593617796). Please fill the template and retitle it (for example, `fix(avplayer): ...`) to get the conventions check green.
jotitadev commented 2026-10-18 21:04:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-18T21:04:11Z.

Review: COMMENTED


Head 7a0cba2de contains a change to core/libs/prx/libSceNpManager/Export.cpp that the description does not mention. It looks unrelated to the AvPlayer fix:

  • Export.cpp:97-101: sceNpGetAccountIdA used to return SCE_NP_ERROR_SIGNED_OUT. It now sleeps 100 ms (line 99) and returns success with a made-up id, 0x1000000000000000 | user_id (line 100).
  • The rest of the module still reports a signed-out user. sceNpGetState writes NP_STATE_SIGNED_OUT (line 126), and sceNpGetNpId, sceNpGetOnlineId, sceNpGetAccountCountryA and sceNpCheckPremium still return SCE_NP_ERROR_SIGNED_OUT. A title that checks the account id therefore sees a signed-in user, and every other NP query says the opposite.
  • docs/dev/debt/libSceUserService.md:5 still says that sceNpGetAccountIdA "answers the same question with SCE_NP_ERROR_SIGNED_OUT". No test covers the new return value or the delay, and neither has a source in the debt files.

If this was left over from debugging BloodRayne 2, I'd drop the libSceNpManager hunk, along with the <chrono> and <thread> includes. If a title does need it, it would fit better as its own PR, with the title that needs it, a source for the id format and the delay, and the libSceUserService.md entry updated.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5564937151 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7412#pullrequestreview-5564937151). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-18T21:04:11Z. **Review:** COMMENTED --- Head `7a0cba2de` contains a change to `core/libs/prx/libSceNpManager/Export.cpp` that the description does not mention. It looks unrelated to the AvPlayer fix: - `Export.cpp:97-101`: `sceNpGetAccountIdA` used to return `SCE_NP_ERROR_SIGNED_OUT`. It now sleeps 100 ms (line 99) and returns success with a made-up id, `0x1000000000000000 | user_id` (line 100). - The rest of the module still reports a signed-out user. `sceNpGetState` writes `NP_STATE_SIGNED_OUT` (line 126), and `sceNpGetNpId`, `sceNpGetOnlineId`, `sceNpGetAccountCountryA` and `sceNpCheckPremium` still return `SCE_NP_ERROR_SIGNED_OUT`. A title that checks the account id therefore sees a signed-in user, and every other NP query says the opposite. - `docs/dev/debt/libSceUserService.md:5` still says that `sceNpGetAccountIdA` "answers the same question with `SCE_NP_ERROR_SIGNED_OUT`". No test covers the new return value or the delay, and neither has a source in the debt files. If this was left over from debugging BloodRayne 2, I'd drop the `libSceNpManager` hunk, along with the `<chrono>` and `<thread>` includes. If a title does need it, it would fit better as its own PR, with the title that needs it, a source for the id format and the delay, and the `libSceUserService.md` entry updated. AI-assisted: yes (Claude Code)
adriadam10 commented 2026-10-19 14:36:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T14:36:12Z.

Review: CHANGES_REQUESTED


Thanks for the PR. Points to fix:

  • core/libs/prx/libSceNpManager/Export.cpp:97-101 (commit f9f8a24f5, "stub sceNpGetAccountIdA"): unrelated to AvPlayer and not in the description. It returns success with an invented account id plus a 100 ms sleep, while sceNpGetState, sceNpGetNpId, etc. still report signed-out. Offline/PSN calls return the documented offline error, not success. Please drop this commit; if a title really needs it, open a separate PR with the evidence and a test.
  • frame_rate at byte 48 is already filled on main (Source.cpp:583-584 for stream info, static_assert on offset 48 in SceTypes.hpp). Please check the claim "it was left zero" against current main; if the black screen persists on main, say what the debugger shows there. Replacing av_guess_frame_rate with avg/r_frame_rate also changes behaviour and the description does not justify it; keep av_guess_frame_rate unless you can show a case where it is wrong.
  • The colour fields at bytes 56/60 follow KytyPS5 only, and BloodRayne 2 never reads them. Keep them only with a test pinning values from a stream tagged bt709 (1/1), or drop them from this PR.
  • The branch conflicts with main; please rebase after the above.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5573182454 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7412#pullrequestreview-5573182454). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T14:36:12Z. **Review:** CHANGES_REQUESTED --- Thanks for the PR. Points to fix: - `core/libs/prx/libSceNpManager/Export.cpp:97-101` (commit f9f8a24f5, "stub sceNpGetAccountIdA"): unrelated to AvPlayer and not in the description. It returns success with an invented account id plus a 100 ms sleep, while `sceNpGetState`, `sceNpGetNpId`, etc. still report signed-out. Offline/PSN calls return the documented offline error, not success. Please drop this commit; if a title really needs it, open a separate PR with the evidence and a test. - `frame_rate` at byte 48 is already filled on `main` (`Source.cpp:583-584` for stream info, `static_assert` on offset 48 in `SceTypes.hpp`). Please check the claim "it was left zero" against current `main`; if the black screen persists on `main`, say what the debugger shows there. Replacing `av_guess_frame_rate` with avg/r_frame_rate also changes behaviour and the description does not justify it; keep `av_guess_frame_rate` unless you can show a case where it is wrong. - The colour fields at bytes 56/60 follow KytyPS5 only, and BloodRayne 2 never reads them. Keep them only with a test pinning values from a stream tagged bt709 (1/1), or drop them from this PR. - The branch conflicts with `main`; please rebase after the above.

Pull request closed

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!7412
No description provided.