Skip to content

Fix FF decode by miniMax AI - #21012

Open
sum2012 wants to merge 2 commits into
hrydgard:masterfrom
sum2012:video-fix
Open

Fix FF decode by miniMax AI#21012
sum2012 wants to merge 2 commits into
hrydgard:masterfrom
sum2012:video-fix

Conversation

@sum2012

@sum2012 sum2012 commented Nov 16, 2025

Copy link
Copy Markdown
Collaborator

by https://agent.minimax.io/share/334835562430541?chat_type=1
fix #15203

original bad log (v1.19.3-1105-g636e5b33b6)
v1.19.3-1105-g636e5b33b6-bad-ppsspplog.txt.zip
Modify good log:
fixed-ppsspplog.zip

The data at offset 2048 shows:
008800 00 00 01 ba 44 00 05 86 d5 c3 01 86 a3 f8 00 00
The pattern 00 00 01 ba is the MPEG-2 transport stream sync marker! This means the video data after the 2048-byte PSMF header is in MPEG-TS format.

@sum2012 sum2012 added the PSMF / MPEG Issue involves scePsmf or sceMpeg video playback. label Nov 16, 2025
@anr2me

anr2me commented Nov 16, 2025

Copy link
Copy Markdown
Collaborator

Hmm.. I saw that the AI is mentioning "sync marker bytes 00 00 01 ba" at the end.

But according to this (page 7) https://ossrs.net/lts/zh-cn/assets/files/hls-mpeg-ts-VB_WhitePaper_TransportStreamVSProgramStream_rd2-54391b430dd4df50a827467e80854828.pdf

The first byte (Sync Byte) in MPEG-TS header supposed to be 0x47 🤔 which matched the answer at https://stackoverflow.com/questions/35974281/mpeg2-ts-sync-byte-and-continuity-error

@sum2012

sum2012 commented Nov 16, 2025

Copy link
Copy Markdown
Collaborator Author

Hmm.. I saw that the AI is mentioning "sync marker bytes" at the end.

But according to this (page 7) https://ossrs.net/lts/zh-cn/assets/files/hls-mpeg-ts-VB_WhitePaper_TransportStreamVSProgramStream_rd2-54391b430dd4df50a827467e80854828.pdf

The first byte (Sync Byte) in MPEG-TS header supposed to be 0x47 🤔 which matched the answer at https://stackoverflow.com/questions/35974281/mpeg2-ts-sync-byte-and-continuity-error

MPEG-TS header check is in here
https://github.com/hrydgard/ppsspp/pull/21012/files#diff-72f58d004beb4c29fe682970ebc40289bfd08d1ddbbf8cdd450a8338ac925d07R493

@sum2012
sum2012 requested a review from hrydgard November 22, 2025 10:25
@hrydgard

Copy link
Copy Markdown
Owner

Interesting, will look at this soon.

@sum2012

sum2012 commented Feb 18, 2026

Copy link
Copy Markdown
Collaborator Author

@hrydgard do you plan merge this patch after v1.20 ?

@hrydgard

Copy link
Copy Markdown
Owner

Possibly. My problem is that I don't really understand if all the new logic is actually correct, or just a bunch of AI-invented stuff that happens to work in this case (and could easily break other things).

The latter part is why we can't merge before 1.20.

@sum2012

sum2012 commented Mar 7, 2026

Copy link
Copy Markdown
Collaborator Author

@hrydgard JPCSP has identical logic for "Need to read additional data to reach stream offset" in https://github.com/jpcsp/jpcsp/blob/cd20cf312b358b4260f26f6754f9c62926c70ba6/src/jpcsp/HLE/modules/scePsmfPlayer.java#L482

@hrydgard hrydgard added this to the v1.21 milestone Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PSMF / MPEG Issue involves scePsmf or sceMpeg video playback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unavoidable freeze in Machi

3 participants