Encoding videos suitable for PSPs
IF YOU HAVE A PSP AND HAVE ANY FEEDBACK ABOUT THE FOLLOWING INFORMATION, PLEASE CONTACT ME.
I find Sony very frustrating for not publishing information on what video formats are supported by the PSP, it seems to me that they’re only hurting themselves, unless they think it will make more people buy their software. Through a combination of high level reverse engineering of some files created with the High AVC and Low AVC profiles in Media Manager that someone put on-line, and some trial and error and scouring the internet, I have come to the following conclusions about the PSP’s capabilities with recent official firmwares.
Restrictions
- BIT_RATE <= 768 kbps
- Up to 640×480 (official firmware 5.00 or later)
- Up to 30 fps
- H.264 Main Profile up to Level 2.1
- Up to 2 reference frames
- LC AAC 2-channel audio up to 48kHz (Media Manager uses 128kbps)
Note: Apparently the PSP cannot decode any h.264 streams which use multiple slices, so if you’re using an older revision (<607) of x264 and want to use multiple threads to encode your PSP files, you’re out of luck. However, you shouldn’t have any problem updating to the current development code for x264.
For one pass:
ffmpeg -i INPUT -ac 2 -ar 48000 -acodec libfaac -ab 128k -r FRAME_RATE -s WIDTHxHEIGHT -vcodec libx264 -vpre slower -vpre main -level 21 -refs 2 -b BIT_RATE -bt BIT_RATE -threads 0 -aspect WIDTH:HEIGHT -f psp OUTPUT.mp4
For two pass:
ffmpeg -i INPUT -an -pass 1 -r FRAME_RATE -s WIDTHxHEIGHT -vcodec libx264 -vpre slower_fastfirstpass -vpre main -level 21 -b BIT_RATE -bt BIT_RATE -threads 0 -aspect WIDTH:HEIGHT -f psp OUTPUT.mp4
ffmpeg -i INPUT -ac 2 -ar 48000 -acodec libfaac -ab 128k -pass 2 -r FRAME_RATE -s WIDTHxHEIGHT -vcodec libx264 -vpre slower -vpre main -level 21 -refs 2 -b BIT_RATE -bt BIT_RATE -threads 0 -aspect WIDTH:HEIGHT -f psp OUTPUT.mp4
thanx for the concise guide, it helped me alot…
but if it’s possible to enlighten the best settings to achieve the optimum quality with minimum size with shortest encoding time, not to mention the psp memory capacity is limited..much of my video are anime…
thank you in advance..
Pingback: PS3 Video Encoding « BumScientist
Thanks for the guide Robert! Isn’t it a good idea to add “-maxrate 768k” to stick to the restrictions? And for two pass encoding you need to encode audio as well, otherwise ffmpeg throws the error “PSP mode need one video and one audio stream”. And having the maxrate in mind, it’s probably better to use the same audio settings as in the second pass instead of using ‘-acodec copy’!?
Best regards,
Fabian
H.264 Level 2.1 doesn’t have a maxrate of 768k though, so if Level 2.1 is claimed, its VBV parameters should be obeyed. See here for details of the maxrate and bufsize restrictions according to the different levels.
In fact the PSP claims to support level 3.0, it was mentioned in the specifications of the manual, you can check it here:
PSP 1001: http://www.playstation.com/manual/pdf/PSP-1001K-3.0_1.pdf
PSP 2001: http://www.playstation.com/manual/pdf/PSP-2001-3.6_1.pdf
PSP 3001: http://www.playstation.com/manual/pdf/PSP-3001-4.2_1.pdf
Search for “specifications” in the manuals and it will mention “H.264/MPEG-4 AVC Main Profile Level 3)
Actually it has some restriction like the mentioned 2 reference frames and no reference b-frames.
Also the resolutions is up to 720×480 (NTSC TV system native resolution).
The higher resolution was already supported by the PSP since its initial release but it was locked only to UMD video to push them (even tough they decided to be funny and they didn’t add a TV output until they made the slim); they’ve unlocked it for MP4 videos since the UMD videos didn’t sell well.
Of course you can use SAR infos to display the video with the correct aspect ratio (10:11 for 4:3 and 40:33 for 16:9) .
Bitrate was locked (in official firmwares) at 768kbps but it was unlocked as well (I’m not sure what it is the limit, but surely you can use 2Mbps or so; it depends on the quality of your memory card as well); CFW didn’t have this limitation from a long time (though at 320×240 that was available until Sony unlocked the resolution it wasn’t that useful to use bitrates higher than 768kbps).
There’s also a limit of 6 hours and 30 minutes per file (source: http://manuals.playstation.net/document/en/psp/current/video/filetypes.html).
Thank you very much for that information. I’m glad someone has kept on top of this stuff. I’ll try to set aside a little time to update the PSP page soon.
Actually I must say that there are some weird limitations with the resolution, it seems that anything higher than 480x272p must be 480p, 640×480 is fine but 480×360 used by Youtube isn’t fine; I’ve also tested videos encoded with settings that worked at 720×480 and 640×480 but at 480×360 and 512×384 they didn’t work (probably because resolutions higher than 270p are mainly intended to be displayed on TV monitors and it would be harder for the PSP to resize them, I suppose it does so with some dedicated hardware routine, just like AVC decoding, and not via software).
So it should be safe to say that the supported resolutions are:
anything with vertical resolution ≤ 272 pixels and horizontal resolution ≤ 480 pixels (tested: 320×240; 480×240 and 480×272)
anything with vertical resolution of 480 pixels and horizontal ≤ 720 pixels (tested: 640×480 and 720×480)
Two comments:
1. Why libfaac rather than aac? I thought aac was worked on to be “better” than libfaac?
2. I’m really looking for a PS3 command line. Here’s what I’ve come up with:
ffmpeg -i INPUT -acodec aac -ab 128k -vcodec libx264 -vpre slow -vpre high -level 42 -crf 17 OUTPUT.mp4
Googling has not been a great help. Any suggestions or a link?
1. libfaac is still better quality than FFmpeg’s AAC encoder for the moment. Someone is working on it and we hope to beat FAAC soon.
2. I haven’t tested this (though I do have a PS3 now) but something like:
ffmpeg -i INPUT -acodec libfaac -ab 128k -vcodec libx264 -vpre slow -vpre high -level 41 -bufsize 40000 -maxrate 40000 -b outfile.mp4
As it supports Blu ray and this should be compliant with Blu ray on the video side at least. If you want to do two passes or so, you can check out the generic FFmpeg x264 encoding guide. The only restrictions I know of are H.264 High Profile at Level 4.1 which is pretty easy to attain. You do need to set the bufsize and maxrate though to increase the likelihood your encoded file will play. I think using crf mode is OK too as long as you set the bufsize and maxrate.
Ok, libfaac it is.
Is the “-b” a typo, or do you really need to set the bitrate?
Oops. -b where that value is something reasonable for your content. Else you can use -crf if you prefer but you have to set the bufsize and maxrate.