Simple STR video player library

Programming examples for the Psy-Q SDK
Post Reply
User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Simple STR video player library

Post by LameGuy64 » January 16th, 2014, 10:01 pm

One thing that I find somewhat missing here is a decent piece of code for playing STR video files easily. So, what I did was take the old and messy PsyQ STR player example, clean it up entirely, and finally make it into a cute little c library for easy implementation.

Download it here (43MB):
http://www.mediafire.com/download/s61u8 ... strplay.7z

Screenshot:
Image

My tutorial on how to make STR video files:
http://www.psxdev.net/forum/viewtopic.php?f=51&t=277
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

Orion_
Verified
Legendary Programmer
Legendary Programmer
Posts: 240
Joined: Aug 13, 2012
I am a: Programmer
PlayStation Model: Net Yaroze
Location: France
Contact:

Post by Orion_ » January 17th, 2014, 1:20 am

I have a "PlayMovie(filename)" function in my psx lib, easier than that ... ;)
Retro game development on Playstation and other consoles http://orionsoft.free.fr/

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » January 17th, 2014, 10:12 am

But at least my player takes up 192KB only when the PlayStr() function is called and the code is a lot cleaner than yours! :P (no offense though)
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

wp22
What is PSXDEV?
What is PSXDEV?
Posts: 3
Joined: Feb 24, 2014

Post by wp22 » February 24th, 2014, 1:42 pm

Hello,
Please could you someone help me with video on PlayStation PSX PSOne?
User LameGuy64 created this test on PSOne and it works video.
Download it here (43 megabytes)
http://www.mediafire.com/download/s61u8 ... strplay.7z
I need a program or instruction, assistance in case of cooperation in making videos on PSX PSone, PlayStation'm a lover and I wish to create movies on PSOne, if you please help me really good too please.English can not, translate via google translator.
Please answer my e-mail: [email protected].
Sincerely,

Thank you very much.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » February 24th, 2014, 10:26 pm

This old tutorial I made should help you:
http://www.psxdev.net/forum/viewtopic.php?f=51&t=277

(next time, please try to learn to be good at English)
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

Megadance
What is PSXDEV?
What is PSXDEV?
Posts: 3
Joined: Apr 13, 2014

Post by Megadance » April 13th, 2014, 8:23 am

Hi LameGuy64, I compiled your strplayer with success and I am able to create now vcd's.
But there is one thing that is annoying. the str file can only have max 9000 frames.
30 minutes of video is not possible, this way. but it would be possible to play 3 str files
for example one behind the other without noticeable breaks.
My question is how to mod the strtest.c file to be able to play 3 str files one behind the other?

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » April 13th, 2014, 10:41 am

You don't need to modify my strplay library to play through a sequence of str files seamlessly, you'll just have to pass the total number of frames of all the str files when playing the first str file but make sure that your str files are ordered sequentially.
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

Megadance
What is PSXDEV?
What is PSXDEV?
Posts: 3
Joined: Apr 13, 2014

Post by Megadance » April 13th, 2014, 12:57 pm

Thank's LameGuy64 for your advice. It's working good. But when the third str file ends the emulator says readsector
out of range and the emulator crashes. is there an elegant way to make the psx recognize that there is an end?
and how to write in the strtest.c file to make a loop after the 3 str's?
so far how i changed it as you said:

// STR file entry (it is a lot easier to deal with STR files this way)
STRFILE StrFile[] = {
// File name Resolution Frame count
"\\1.STR;1", 320, 240, 26370
};


main() {

// Reset and initialize stuff
ResetCallback();
CdInit();
PadInit(0);
ResetGraph(0);
SetGraphDebug(0);

// Play the video in loop
while (1) {

if (PlayStr(320, 240, 0, 0, &StrFile[0]) == 0) // If player presses Start
break; // Exit the loop

}

}

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » April 17th, 2014, 9:46 pm

Sorry for the late reply but, I haven't figured out yet on how to make a str player that automatically stops whenever the end of the video is reached.

Try decrementing the overall frame count by 10 or 20 units until the sector out of range errors are gone.
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

User avatar
NITROYUASH
Verified
Serious PSXDEV User
Serious PSXDEV User
Posts: 124
Joined: Jan 07, 2018
I am a: Game Designer
PlayStation Model: SCPH-5502
Location: Russian Federation
Contact:

Post by NITROYUASH » January 27th, 2018, 6:52 pm

for some reason, i can't compile your code.
Image

Did I do something wrong?
► Show Spoiler

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » January 27th, 2018, 9:40 pm

You need to add libds.lib and libpress.lib onto the stdlib strings in psyq.ini.
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

User avatar
NITROYUASH
Verified
Serious PSXDEV User
Serious PSXDEV User
Posts: 124
Joined: Jan 07, 2018
I am a: Game Designer
PlayStation Model: SCPH-5502
Location: Russian Federation
Contact:

Post by NITROYUASH » January 28th, 2018, 12:24 am

It's working! :)
Thank you, LameGuy64.
► Show Spoiler

User avatar
MihaiGamerXD
Active PSXDEV User
Active PSXDEV User
Posts: 38
Joined: Mar 09, 2019
I am a: Programmer
PlayStation Model: SCPH-1001

Post by MihaiGamerXD » March 9th, 2019, 7:20 am

Your code works fine. Good job! But I want to play the STR file one time. To play the STR file one tine, replace:

while (1) {

if (PlayStr(320, 240, 0, 0, &StrFile[0]) == 0) // If player presses Start
break; // Exit the loop

}

to:

PlayStr(320, 240, 0, 0, &StrFile[0]);

I tested and it worked perfectly!

HatMusic
Curious PSXDEV User
Curious PSXDEV User
Posts: 17
Joined: May 29, 2014

Post by HatMusic » April 14th, 2019, 1:59 am

I've been trying for hours to get this to do anything - I just have no idea what I'm doing with regards to compiling it, or indeed if i'm meant to compile this rather than stuff it into another program somewhere.
I tried following a tutorial [https://www.youtube.com/watch?v=ITXleeBpic8] on how to make an exe hoping I could get it into buildcd (which I'm sure I won't be able to work out), but there are 2 ".c" files with different names and I don't have a clue how to make a makefile that lets psymake do its thing (why isn't this included?). Currently getting lots of "not defined" errors when I run it.

I renamed things in strtest.c and .cti to reference an str I have made in the folder, and the makefile (I think I got this badly wrong because I don't know what each bit is doing) but this is as far as I can get.

What do I do? I feel so stupid - I must be missing something really obvious about this whole thing.


Before this, I did try to use a tool called PSXMODE2 to replace an STR file in a game with mine but I just couldn't get it to do anything - it kept saying every image file I gave it was an invalid format (I used .bin and .iso, and tried it with games and with the video player example).

tomek
What is PSXDEV?
What is PSXDEV?
Posts: 1
Joined: Apr 01, 2020

Post by tomek » April 1st, 2020, 7:40 am

There's an easy way to do it with BuildCD with GUI or with some front-end on windows ?

I dont know how to use it on console command.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest