PS4 News on Facebook! PS4 News on Twitter! PS4 News on YouTube! PS4 News RSS Feed!

Home PS4 News - Latest PlayStation 4 and PS3 News

270w ago - For those who didn't update to PS3 Firmware v3.21 yet, here is CodecSys H.264 Encoder API for PS3/OtherOS reversed.

When CodecSys version 1.3 came out I gave it a try and liked the speed you get, just sucks that you're quite limited concerning cropping and stuff, even multiple passes is disabled for the PS3 version.

So I did take a look at it. I usually hate .Net but in this case it made things a lot easier and by a lot I mean a lot. Long things short, I reversed mosted of the api dll which connects to the PS3 and stuff and used it to encode some frames.

Rebooting and stuff works as well, the cecom running on the PS3 seems to be buggy though and doesn't reboot to game_os for me, not even with the original application. Attached source is more or less based on QT, and still a work in progress, just wanted to share it.

Download: CodecSys H.264 Encoder API for PS3/OtherOS / CodecSys H.264 Encoder API for PS3/OtherOS v0.1

v0.1 Changelog:

• corrected a bug in my yuv calculation
• removed IP address since it's not neccassarry, most likely it's just to specify an interface on which to listen
• put the sending and receiving in a thread
• added wrapper around the CodecSys functions
• added a basic commandline interface

I'm not sure but it might be easier to just get some open source encoder run on the PS3 with speed but I'm no good with PPC + SPU, at least not yet

From the ReadMe file: The IP is hardcoded as I just finished to reverse the api of the DLL so you have to change the corresponding string and length of the string.

For testing purpose I added an image which is converted to yuv420
and then added multiple times to the stream. No threading for now so you can only add a handful of frames until the buffer of the ps3 is full.

The resulting file will be raw h264.ES container which I added to a mp4 which mp4box to see what it looks like

Sometimes the PS3 doesn't get an IP, that's a YDL/CodecSys issue.

CodecSys H.264 Encoder API for PS3 / OtherOS Reversed

Follow us on Twitter, Facebook and drop by the PS3 Hacks and PS3 CFW forums for the latest PlayStation 3 scene and PS4 Hacks & JailBreak updates with PlayStation 4 homebrew PS4 Downloads.



#27 - Zerotacg - 261w ago
Zerotacg's Avatar
cropping works if you stick to the right dimensions, that is a multiple of 16 in width and 4 in height. I just added it to rip some of my movies to put em on the ps3 so I didn't add the possibility to set it up via commandline arguments.

as for avisynth it shouldn't be to hard if you modify the frame_queue to support it and if it outputs as yuv42 as that is the format that is sent to the ps3, didn't take a look at avisynth api so I'm not sure.

as for motivation I simply forgot about it ;D well I might get some spare time mid next week so I might take a look.

#26 - arreman79 - 261w ago
arreman79's Avatar
Okay too bad you lost motivation, i was exited about this project

i'll test your latest version to see whats changed. for now i see you added cropping, don't know if it's working also? how hard is it to let it support avisynth and let that do all the cropping, resizing, adding subtitles.

#25 - Zerotacg - 262w ago
Zerotacg's Avatar
nah sorry not really atm. I currently don't have much time and motivation and actually kind of forgot about it.

here is the latest source without libs so one would need the previous archive also.

not sure what I added most likely not much

About doom9, they have a policy against warez or so and as this is kind of close to illegal since I use the dll I don't think they would like it.

#24 - arreman79 - 262w ago
arreman79's Avatar
Zerotacg , are you still working on this?

#23 - arreman79 - 262w ago
arreman79's Avatar
This is nice, had some problems to get it to work but now it does convert my small sample wmv hd video correctly.

I'm used staxrip to create a avisynth script for resizing to iphone format. With small video i had no problems but with larger samples i get:


[Register or Login to view code]



Is this already posted on the doom9.org forums? some people might be interested here.

Quote Originally Posted by arreman79 View Post
This is nice, had some problems to get it to work but now it does convert my small sample wmv hd video correctly.

I'm used staxrip to create a avisynth script for resizing to iphone format. With small video i had no problems but with larger samples i get:


[Register or Login to view code]



Is this already posted on the doom9.org forums? some people might be interested here.


edit: Problem with error is only when I use avisynth. I have now compiled with height and width for iPhone.

Only for some reason the audio is out of sync, tried different framerate settings.23_976 & 24 source is 23.98

#22 - Zerotacg - 266w ago
Zerotacg's Avatar
Sorry for the frame rate, it's just no end user version yet
For muxing I usually take belight to encode the ac3 streams of a dvd into aac and then it just goes

[Register or Login to view code]



just found out about the language setting for streams with mp4box the other day, so I thought I'd mention it

as for the data/stream you get from the ps3, it was named H264 ES in the .Net application so I just copied that. seems to be just a raw h264 stream more or less the same as what you get when you do

[Register or Login to view code]


so you could just add it to a mp4 without audio and import from the mp4 if your application doesn't support the raw stream

reminds me, I didn't got my hands on some interlaced material to test the interlacing. So if anyone could upload a short clip of interlaced vid that I could use to test, I'd be thankful

#21 - rajb245 - 266w ago
rajb245's Avatar
Changing those resize parameters settings worked for me!

The other thing I had to be careful of was setting the framerate parameter correctly. The ffmpeg side of things detects and dumps the framerate, but main.cpp hardcodes the framerate value.

Now I'm having issues remuxing the H264 ES I get with audio, and having the result be viewable. MP4box does a good job putting things into the right container, but everything else seems a bit shaky.

#20 - Zerotacg - 266w ago
Zerotacg's Avatar
Quote Originally Posted by rajb245 View Post
Ah, I see encode params called resizedWidth and resizedHeight. Hopefully setting these will do the trick!


yeah that's the way to go. you just have to care for the dimensions. I looked it up yesterday and the api checks if width is a multiple of 16 and height a multiple of 4 and gives a invalid parameters error otherwise.

#19 - rajb245 - 266w ago
rajb245's Avatar
Quote Originally Posted by Zerotacg View Post

just played around with the resizing a bit, the ps3 can do it for ya ;D only downsizing that is though.
I'll try how to use interlacing next and will mash up a version with variable encoding parameters next


Great that the PS3 can scale down! This would be primarily what I want to use it for, going from 1920x1080 down to 1280x720. Can you give me any tips about how to enable this now in the source code (before you release the next version?)

As far as the interlacing thing, I've looked into how to deinterlace content. Specifically, I've looked into detelecine, which reverses the progressive to interlaced process that happens when film is encoded for television. I think I might be able to implement this in your code; I'll let you know if I make progress.
Quote Originally Posted by rajb245 View Post
Great that the PS3 can scale down! This would be primarily what I want to use it for, going from 1920x1080 down to 1280x720. Can you give me any tips about how to enable this now in the source code (before you release the next version?)

Ah, I see encode params called resizedWidth and resizedHeight. Hopefully setting these will do the trick!

#18 - Zerotacg - 266w ago
Zerotacg's Avatar
cropping can be easily done in the function that generates the yuv frames as needed for the ps3, did this for my self, I could update the code later on, just have to clean it up a bit.

As for resizing you take a look at "CFrameQueue::getConverted()" it uses the ffmpeg function for resizing/scaleing etc. I just use it to convert the frame to yuv420, but the function can resize n stuff as well.

As for interlacing that can be done by the API somehow, didn't look into it by now, but basicly you set the corresponding encoder setting and double the keyframe interval and some other settings.

Reminds me Resolutions have to be multiple of 16 in width and multiple of 2 (not sure maybe 4) in height, gives a parameter_error otherwise.

Edit: Just played around with the resizing a bit, the ps3 can do it for ya ;D only downsizing that is though. I'll try how to use interlacing next and will mash up a version with variable encoding parameters next