Page 1 of 1

Simple STR video player library

Posted: January 16th, 2014, 10:01 pm
by LameGuy64
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

Re: Simple STR video player library

Posted: January 17th, 2014, 1:20 am
by Orion_
I have a "PlayMovie(filename)" function in my psx lib, easier than that ... ;)

Re: Simple STR video player library

Posted: January 17th, 2014, 10:12 am
by LameGuy64
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)

Re: Simple STR video player library

Posted: February 24th, 2014, 1:42 pm
by wp22
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.

Re: Simple STR video player library

Posted: February 24th, 2014, 10:26 pm
by LameGuy64
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)

Re: Simple STR video player library

Posted: April 13th, 2014, 8:23 am
by Megadance
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?

Re: Simple STR video player library

Posted: April 13th, 2014, 10:41 am
by LameGuy64
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.

Re: Simple STR video player library

Posted: April 13th, 2014, 12:57 pm
by Megadance
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

}

}

Re: Simple STR video player library

Posted: April 17th, 2014, 9:46 pm
by LameGuy64
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.

Re: Simple STR video player library

Posted: January 27th, 2018, 6:52 pm
by NITROYUASH
for some reason, i can't compile your code.
Image

Did I do something wrong?
► Show Spoiler

Re: Simple STR video player library

Posted: January 27th, 2018, 9:40 pm
by LameGuy64
You need to add libds.lib and libpress.lib onto the stdlib strings in psyq.ini.

Re: Simple STR video player library

Posted: January 28th, 2018, 12:24 am
by NITROYUASH
It's working! :)
Thank you, LameGuy64.
► Show Spoiler

Re: Simple STR video player library

Posted: March 9th, 2019, 7:20 am
by MihaiGamerXD
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!

Re: Simple STR video player library

Posted: April 14th, 2019, 1:59 am
by HatMusic
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).

Re: Simple STR video player library

Posted: April 1st, 2020, 7:40 am
by tomek
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.