[FFmpeg-devel] [PATCH 1/4] avcodec/mdec: DC reading for STRv1 is like STRv2

aybe aybe aybe.one at hotmail.com
Sat Jan 13 04:28:52 EET 2024


Here are the two STR files I have used when writing this patch: https://github.com/aybe/FFmpeg-PSX-STR-tests
Fanatics would probably say that 30 FPS for NTSC is wrong (i.e. should be 29.97)...
However, as the reversed-engineered docs in jpsxdec mentions, it is sort of impossible to figure out which value to snap to from how frames spans across CD-ROM sectors.
The sector count per video frame always seem to juggle between two values, e.g. 6 sectors, then 7 sectors, rinse/repeat. i.e. it's never constant.

Also, as one can see in the various code samples online on writing a PSX program that plays MDEC videos, it is the responsibility of the coder to present the frames on screen.
i.e. there is not definitive way on how to do so, and even if there was, you can be sure some folks did not play by the rules back then.
The only way to figure out how a movie was intended to be played is to reverse engineer a game to see what values they did cram in.
In short, the computed frame rate is 99% good, not 100%. But for mere mortals, they are unlikely to notice it at all.

As for the movies in the samples repository, they are corrupt and FFmpeg fails at them, obviously.
I figured these ones were by checking them in a hex-editor but also by loading them in https://github.com/m35/jpsxdec<https://> which has great logging.
Not sure why these samples were corrupt in first instance, maybe it was intentional for testing? I can't tell.

------ Original Message ------
From "Michael Niedermayer" <michael at niedermayer.cc<mailto:michael at niedermayer.cc>>
To "FFmpeg development discussions and patches" <ffmpeg-devel at ffmpeg.org<mailto:ffmpeg-devel at ffmpeg.org>>
Date 1/10/2024 3:46:02 AM
Subject Re: [FFmpeg-devel] [PATCH 1/4] avcodec/mdec: DC reading for STRv1 is like STRv2

On Tue, Jan 02, 2024 at 02:49:26AM +0000, aybe aybe wrote:
Hi,

As I understand, support for .STR files is broken for almost 10 years now (since 161442ff2c4b0dd8a5072c6bbe6bf55303fffccf it seems).

Currently, ffmpeg fails with tons of errors like this on version 1 STRs, e.g. Wipeout 1:
[mdec @ 00000000027c72c0] ac-tex damaged at 1 9

where can i find a psxstr file to test this ?
the psxstr files i find on https://samples.ffmpeg.org/ seem not affected by this

thx

[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.


More information about the ffmpeg-devel mailing list