How to encode STR video files

Graphic based area of development (Graphics Processing Unit), including the Geometry Transform Engine (GTE), TIM, STR (MDEC), etc.
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:

How to encode STR video files

Post by LameGuy64 » April 25th, 2013, 10:54 am

While bored and doing some meddling on one of the development tools yesterday, I managed to convert a video file into a MDEC compatible STR video file complete with sound using the included MC32 program. No one seems to have bothered about this but I'll explain how I did it anyway.


First, you're going to need the following tools:
- FFmpeg which you can find it here: http://www.ffmpeg.org/
- MC32 located in psxgraph\bin if you're using the Programmers Tool devkit or the bin folder if you're using PsyQ.

Once we have the tools ready, we should begin converting the video file into a format that MC32 only supports which is just an uncompressed AVI file.

To do that, we're going to execute FFmpeg like this:

Code: Select all

ffmpeg -i <infile> -vcodec rawvideo -s 320x240 -r 30 -an <outfile>
Where <infile> is the file name of the video file to convert while <outfile> is the output name and must end with .avi. -s defines the resolution of the output and -r defines the frame rate of the output which you may change it to a lower value if you want.

The maximum video resolution the PlayStation can handle is 320x256 (higher resolutions yet to be tested) and the maximum frame rate is 30FPS. However, FMVs in most games run at 15FPS in favor of video quality because the PlayStation's drive speed is not enough to maintain high quality video at 30FPS so if you want high quality FMVs, go for 15FPS. If you want smooth FMVs, go for 30FPS.

Now that we have an uncompressed video-only file ready to be converted, we're also going to need the video file's audio data to go with it. So, we'll execute ffmpeg again but like this:

Code: Select all

ffmpeg -i <infile> -acodec pcm_s16le -vn <outfile>
Where <infile> is the file name of the video file to convert and <outfile> is the output file name which must end with .wav.


Now comes the most interesting part, open MC32 inside your bin folder. On the conversion window, browse for the uncompressed video-only file in the left text box. A preview window should appear after selecting the file:
Image

Inside the preview window, clicking on the Encode button will show a preview of what the encoded frame will look like. The Play button obviously plays the video at 15FPS by default and the horizontal slider controls what part of the video is to be played.

On the right side of the conversion window, click on the blank drop-down list and make sure it is selected to str (MDEC). Once set, click on the Attributes button to bring up this window:
Image
Using the Custom options is the best one since you get to control the frame size (a.k.a. bitrate) in sectors or bytes. For 30FPS videos, set it to 4 sectors or 8 for 15FPS videos. The Variable Frame Size option is pretty useless as the file size reduction when using it is very little and may cause some frame skipping issues during playback. As for the Sound options and the MDEC Image Version, I haven't meddled with those yet so better not touch it.

Finally, click Go and wait for the conversion process to finish. Once done, you now have a video-only str file.

Now for the sound, select the wav file as the input in the same conversion window. Some small window should pop-up displaying the sample rate and the number of channels the wav file you've selected has. After that, click Go and wait for the conversion to finish. Once done, you now have an xa file ready to be interleaved into the video-only str file.


All we have to do now is to interleave the str and xa files together. To do that, click on the View menu and click on the Video + Sound option which should bring up this window:
Image
On the Vide File Name (typos in professional tools? :lol:) box, browse for the video-only str file and select str (MDEC) in the drop-down box just below it. On the Sound File box, browse for the xa file to go with the video and don't forget to set the proper type and frequency of when the wav file was converted.

On the output file name box, browse for where the output will be stored and named as. Once set, make sure the Frame Rate is set to a proper value and then click Go. Once the interleaving process is finished, you now have a str file with sound ready to be played on the PlayStation.

Select the str file you've encoded in the Video File Name box and select 'str (MDEC)' on the Format drop-down box. Select the xa audio file in the Sound File Name text box and make sure the Frequency and Type match those of the attributes window when you encoded the xa file. And finally, enter the output file name of your video file in the Output Str text box then click Go.


Now, how do we play the str file on the PlayStation? Here's a link to my little STR player library with sample code and script for BuildCD:
http://www.psxdev.net/forum/viewtopic.p ... 3645#p3645

Take note that str files are only playable if it is embedded into the iso as XASource which can only be done using BuildCD.
Last edited by LameGuy64 on January 16th, 2014, 11:03 pm, edited 8 times in total.
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
bizarro2011
Serious PSXDEV User
Serious PSXDEV User
Posts: 118
Joined: Mar 27, 2012
Location: Brazil

Post by bizarro2011 » April 25th, 2013, 1:42 pm

very good, write a program to run this video and post.

User avatar
t0rxe
C Programming Expert
C Programming Expert
Posts: 139
Joined: Dec 19, 2012
Motto: /\OX[]
PlayStation Model: SCPH-5502
Location: Australia

Post by t0rxe » April 25th, 2013, 2:54 pm

Nice tutorial. I will make a guide on how to burn XA and STR to a CD-ROM correctly, so it plays on your PSX. This means you can make your own VCD's basically and watch movies on your PlayStation 1. I will include the source code too.
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"

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 25th, 2013, 5:39 pm

t0rxe wrote:Nice tutorial. I will make a guide on how to burn XA and STR to a CD-ROM correctly, so it plays on your PSX. This means you can make your own VCD's basically and watch movies on your PlayStation 1. I will include the source code too.
I've now included a link in the tutorial for a sample STR file for you to test with...I hope it helps.
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
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 » May 11th, 2013, 11:12 am

t0rxe wrote:Nice tutorial. I will make a guide on how to burn XA and STR to a CD-ROM correctly, so it plays on your PSX. This means you can make your own VCD's basically and watch movies on your PlayStation 1. I will include the source code too.
So, how's the player code going?
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
inc^lightforce
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 248
Joined: Mar 07, 2013
I am a: Programmer Windows+PS1, GFX Artist
PlayStation Model: Black
Location: Germany

Post by inc^lightforce » May 11th, 2013, 11:39 am

nicely done. that's the way we made " video Film Discs " for PS1 in the end of the nineties :D
THE MUMMY 1 and some more.

User avatar
t0rxe
C Programming Expert
C Programming Expert
Posts: 139
Joined: Dec 19, 2012
Motto: /\OX[]
PlayStation Model: SCPH-5502
Location: Australia

Post by t0rxe » July 23rd, 2013, 1:52 pm

Well I have made my STR successfully. Problem is though, it only works without audio. If I make the STR with the video stream only, it plays fine. When I interleave the XA audio stream in with the video, the STR won't play at all. In the emulator, I do see CD-ROM access, but no picture or audio playing whatsoever. I have also tried on real hardware with different code that plays the STR.

I tried with your example video Lameguy, and it also failed to work.
I must be doing something wrong with the disc creation... :shrug
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"

User avatar
t0rxe
C Programming Expert
C Programming Expert
Posts: 139
Joined: Dec 19, 2012
Motto: /\OX[]
PlayStation Model: SCPH-5502
Location: Australia

Post by t0rxe » July 23rd, 2013, 5:59 pm

Solved! The problem was in the CTI (disc creation process) as I imagined.

I was using XAFileAttributes Form1 Video. I should have been using just XASource since the XA is interleaved with it now and it is not just plain video data :mrgreen:

I will make a tutorial soon 8-)

Code: Select all

Directory STR
     File VIDEO.STR
          ;XAFileAttributes Form1 Video
          XASource c:\psyq\projects\str\video.str
     EndFile
EndDirectory
"Nostalgia isn't a big enough word to describe the PlayStation from my eyes"

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

Post by wp22 » February 26th, 2014, 3:44 am

Hello,
Thank you for your response.
Try the instructions that you have here,
I'll call you if I need help.
Thank you.

wp22.

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

Post by wp22 » February 26th, 2014, 4:12 am

I have a question too if this is possible?
It would be possible to make all the necessary programs related to video for playstation processed into one program i need with the possibility of burning the cd? Create installer with all the software packages and options even after converting to burn playstation cd? Installer to run on newer OS windows 7 and others?
It all to you, please ask.
I use Windows 7 and I do not have any older PC with OS Windows 95
Some programs I tried to run I do not work at all about Windows 7 does not work with these older software.
Please therefore whether it would be possible to create some newer software for windows 7 so I can make movies on your Playstation first

Thank you all so much for the answer, and if it goes much you helped me.

Thank you all,

wp22.

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 26th, 2014, 10:03 am

MC32 should work on Windows 7 64-bit since it is a 32-bit application but to use the STR video streams you've created it with requires using an old DOS program called BuildCD... Fortunately, you can use a DOS emulator such as DosBox to get it to work.

I might make a front-end program that'll automate this conversion process soon.
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.

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

Post by HatMusic » May 29th, 2014, 9:03 am

Joined in the hope of finding a tool to enable burning of video cds playable on any ps1 - I'm eagerly awaiting news of such a wizard.

User avatar
Shendo
Verified
C Programming Expert
C Programming Expert
Posts: 250
Joined: Mar 21, 2012
I am a: Programmer
Motto: Never settle
PlayStation Model: SCPH-7502
Discord: ShendoXT
Location: Croatia, EU

Post by Shendo » May 30th, 2014, 8:40 pm

Burning is not a problem. Creation of STR discs with XA audio is.
Running software in DosBox is painfully slow. It takes a while to make a 650 Mb image even with increased cycle emulation.

I converted a 1.5 hour movie to STR spanning 3 discs and while it's cool and all I won't be doing it again.
It's just too damn cumbersome.
Dev console: SCPH-7502, FreePSXBoot, CH340 serial cable.

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

Post by HatMusic » May 31st, 2014, 6:08 am

Sorry, that's what I meant. Just like an all in one sort of thing for standard video formats.

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

Post by HatMusic » July 7th, 2014, 1:54 am

Any further progress on a wizard?

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 » July 10th, 2014, 11:13 am

Why would you want to play movies on your PlayStation? The video quality and compression ratio is nowhere near as good as VCDs and creating a PlayStation video disc requires using tools that won't work on 64-bit Windows computers so its not really worth it.
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.

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

Post by HatMusic » July 13th, 2014, 3:59 am

Oh. ok. I guess. I just thought it would be a very interesting thing to be able to do - just adding to the vesatility of the ps1 in modern times. At least we know it is possible theoretically.

User avatar
Administrator
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2673
Joined: Dec 31, 2012
I am a: Shadow
PlayStation Model: H2000/5502

Post by Administrator » July 13th, 2014, 3:34 pm

I plan to make a bunch of tools since I know people will be asking for things like this. For now, just do it the old 1994 Sony way :)
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
SlavaVlasov
Curious PSXDEV User
Curious PSXDEV User
Posts: 11
Joined: Jul 21, 2018
I am a: Romhacker, Programmer, Gamer
PlayStation Model: SCPH-5502

Post by SlavaVlasov » May 1st, 2022, 4:27 am

Hello everyone! Found an interesting VIDEO CD for PS1: I haven't tested it on console, but it works on pSX 1.13.
The peculiarity is that a movie was somehow stuffed onto 1 CD, more than 90 minutes long! The format is clearly not STR, but compatible with the PS1. The soundtrack here is in mono, but in what format the sound is encoded is not clear. The video container has the extension "PSV". I would like to know what kind of video format and - most importantly - the sound was used. Here's the link:
https://www.mediafire.com/file/looh5oy9 ... D.rar/file

User avatar
Administrator
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2673
Joined: Dec 31, 2012
I am a: Shadow
PlayStation Model: H2000/5502

Post by Administrator » May 1st, 2022, 3:21 pm

Video CD (VCD) doesn't use the STR format. If I recall, it's just MPEG. I'm not an expert on VCD's but someone else might stumble across this topic at some point and go into better detail about it :)
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests