Source code to Simple Media System, originally designed by Eugene Plotnikov. SMS is capable of playing DivX/XviD videos on PS2 very well, along with MP3/FLAC audio. It supports loading from USB, DVD, SMB and HDD, and it comes equipped with features such as built-in 720p/1080i support and its own data disc storage format (CDDAFS).
NOTE: master branch will have the original source code. I will have my own branch with modifications when/if I see fit.
Encoding
Simple Media System supports DivX, XviD and MPEG-2 videos up to 1024x1024, due to PS2 texture size limits. The highest stable resolution is about 1024x920. However, this is still more pixels than 1280x720, so with the right encoding you can get very good quality from SMS.
Recommended encoding resolutions:
- For 60FPS content: 640x360 seems to keep 60FPS reasonably well, so 640x360 or below for 60FPS. Not heavily tested. Plotnikov reported that a 640x464 movie averages at around 60FPS, so that is also an option.
- For 480i/p displays: 640x480 (or 720x480 if 16:9)
- For 720p displays: Use the 720p output option in SMS and encode at any resolution you like. 960x720 works, but has glitches in the bottom left. 1024x768 may work best.
- For VGA displays: Select a VGA option in SMS and encode at either 640x480, 800x600 or 1024x768.
- For Full HD displays: Select the 1080i output option in SMS and encode at 960x540, to ensure the scaling is as smooth as possible. You may also choose to encode at a slightly higher resolution, such as 1024x576 or anamorphic 1024x920 for the highest possible pixel count, but this is personal preference.
- For USB devices: Try to avoid high bitrates. USB 1.1 is quite slow, and as a result I don’t recommend anything above 960x540. You can still get perfectly passable experiences with USB, just don’t expect miracles.
- For HDD-enabled PS2s: The best possible way to use SMS. Bitrate is not really an issue, and you can follow the guide below written by “pitrz” from the original SMS site (http://web.archive.org/web/20200817003240/http://members.casema.nl/eugene_plotnikov/) for a high quality encode. If you wish to do it yourself, basically use the highest resolution you can; 960x540 is a good spot, but 1024x576 also works and so does 1024x768 and so on (maximum 1024x1024).
Encoding Guide
Originally written by Pitrz.
(from http://web.archive.org/web/20200816043804/http://members.casema.nl/eugene_plotnikov/pitrz/manual.htm)
- Install avisynth from the tools folder;
- Unpack quenc anywhere you'd like;
- Copy sagit.xcm to the folder where quenc is (or somewhere where you can find it later when you will be setting up quenc);
- Copy the avisynth sample script somewhere and open it in you favourite text editor.
You will see two commands; change the first one to point to the file you want to encode, and the second one to the resolution you want to use.
With the resolution settings you see there, you will get CORRUPTION.
You can't have bigger horizontal width then 1024 because of maximum ps2 texture size limit.
So my recommendation is probably 960x540 or a little bit more, try a few tests to get picture without any corruption.
- After you have edited this file, fire up quenc, select the avisynth script, and set everything exactly as it is in Quenc_Settings.jpg.
This settings are actually optimal to encode to 720p mpeg2, so you can probably lower the bitrate a little bit.
You have to select the Custom quant matrix sagit.xcm from the archive.
There is also utility qmatrix in the archive which is a editor of custom matrices, with plenty of examples.
However, the matrix I use is especially good for high resolutions.
So if you have set up everything correctly you can start your encode.
In the way I have it set up, it is slow, but the quality at the bitrate you get is comparable if not equal to h.264.
Try playing with some small sample files and you will see what you can get.
Peter
Thanks to all authors of the used programs, doom9.org forums and
doom9.org forum users.
Original Readme
---------------------------------------------------------
Copyright 2001-2005, ps2dev - http://www.ps2dev.org
All rights reserved.
Created by Eugene Plotnikov <[email protected]>
-----------------------------------------------------------------------
Introduction
-----------------------------------------------------------------------
Simple Media System (SMS) is a result of my curiosity about Sony's Playstation2,
MIPS, DivX and MP3. My original goal was to create a simplest DivX player able
to play good resolution movies at good frame rate on the unmodded PS2 without
any extra equipment such as HDD and network adapter. Why "system"? Just because
having only a player program is not enough. Since PS2 is forced to ignore "illegal"
disks, I've took an idea of Drakonite with his UMCDR and developed my own "UMCDR".
(I called it CDDAFS). It just stores data on CD audio disk, which can be read on
(I hope) any PS2. So this is a first component of SMS. Second component is a PC
program that makes cue/bin files in order to burn such a disk. And, finally, comes
a player program itself. This system is not complete yet, but it can play DivX movies
with sound at good frame rate already. Player's base is a famous ffmpeg project.
I took just some parts of it (DivX 5XX and MP3) and made some modifications specific
to PS2 hardware. I've tested it with a couple of DivX/XviD movies with different
screen resolutions and encoding methods and it seems to be working. So, I've decided
to put all this stuff to the CVS at ps2dev in hope that it could be interesting for
PS2 enthusiasts who use it as base for their development. This "document" provides
basic info about SMS.
CDDAFS
----------------------------------------------------------------------
It's just a method of storing a data on audio CD, so PS2 hardware can authenticate
such a CD as "valid" one. Logical structure of such a CD is quite simple. Audio tracks
are "directories". Track 0 is a control track, which stores global disk information.
Following "diagram" presents a logical disk structure:
Track 0:
GUID - 16 bytes
Disk name - 64 bytes
Disk description - 512 bytes
Disk picture - 9216 bytes (48x48x4 raw RGB image)*
; then follows image table
Number of images - 2 bytes (short, little endian)*
Image 1 - 4096 bytes (32*32*4 raw RGB image)*
.......
Image N - 4096 bytes (32*32*4 raw RGB image)*
; then follows "directory" table (number of directories is number of tracks from
; CD TOC minus one)
Track name 1 - 32 bytes
Track image index 1 - 2 bytes (short, little endian, zero based)
Reserved 1 - 30 bytes (just for possible future enhancements)
Track name 2 - 32 bytes
Track image index 2 - 2 bytes (short, little endian, zero based)
Reserved 2 - 30 bytes (just for possible future enhancements)
.......
Other tracks:
; Directory entry 1
Number of files - 2 bytes (short, little endian)
File name - 32 bytes
File image index - 2 bytes (short, little endian, zero based)
Reserved - 30 bytes
Start offset - 4 bytes (physical sector relative to start sector of
the current track, int, little endian, zero based
)
File size(in bytes) - 4 bytes (int, little endian)
; Directory entry 2
; etc.
; File data
* these "pictures" and "images" are in fact RGBA raw bitmaps, so future browser
can be decorated with them;
Such a disk (without extra ECC codes) proved reliable enough in my configuration.
Source code that handles CD I/O located in CDDA.c (low level sector read operations)
and in FileContext.c (logical read operations). I've also started implementation of
"standard" I/O (STIO_xxx routines). Well, for me CDDA is enough. So anyone can
finish "standard" I/O (perhaps, using asynchronous fileXio routines from ps2sdk).
PC program
----------------------------------------------------------------------
I've called it CDXplorer. Not fully completed yet, but it does its job of
making cue/bin pair. This program is uses Win32 API, so it is not compatible with
linux (even WINE has troubles running it). I'm using Nero's Disk-At-Once/96 burning
option. It is also possible to read CDDAFS using this proggy. Just insert CDDAFS disk
in the drive and run the program. Maybe someone would like to create fs driver to
support it :)?
SMS Player
----------------------------------------------------------------------
Just a test program for now and PS2 optimized ffmpeg. No GUI. It is possible to
benchmark video/audio decoding process (I've got sometimes peak ~70 fps with
640x464 movie (~60fps is average)). I was able to play 720x528 DivX with sound
at 25fps (but in this case there're slight sound distortions on scenes with a
lot of motions (mainly "global" ones). Just watching a movie is also possible.
Modify main's source at your taste. For sound output I'm using 'audsrv' 0.75
(magnificent work of gawd).
ffmpeg modificat
提示:代码过长已自动截断
评论