View Full Version : Transcoding for PSP?
Torne
18th December 2007, 14:40
I'm trying to transcode various formats of video for the PSP on my Linux machine, and can't get it to work at all. I've tried mencoder, ffmpeg and x264, and haven't managed to guess a set of settings that work - I've managed to produce .mp4 files that play OK on a PC but none will work on the PSP which has crazy format restrictions.
Any suggestions for tools, or just a command line/script for one of the encoders I have, which will transcode video to .mp4 in a way the PSP will accept?
Thanks in advance!
Edit: Oh, btw I mean transcoding to h264/AVC - I can transcode to MPEG-4 okay, but the files are much larger for the same quality, and full-screen resolution isn't allowed.
Henrikx
18th December 2007, 14:45
Try Avidemux. Auto - PSP (H:264)
nm
18th December 2007, 16:49
Any suggestions for tools, or just a command line/script for one of the encoders I have, which will transcode video to .mp4 in a way the PSP will accept?
Here are some tips, but AFAIK the newer firmwares have improved H.264 decoding support (for example, 720x480 resolution):
http://rob.opendot.cl/index.php/useful-stuff/psp-video-guide/
There are also a few threads on the AVC forum:
http://forum.doom9.org/showthread.php?t=131522
http://forum.doom9.org/showthread.php?t=131840
Torne
18th December 2007, 17:43
Hm, there's lots of options there, but I got the ones listed in the first guide to work! :)
As you say, most of the examples are from older firmware - I believe the latest also supports level 3.0 instead of just 2.1, too... and it's not clear which of the options are the preferences of the author and which are the requirements of the PSP.. e.g. the number of reference frames is probably limited to 2 (unless it's been increased in the new firmware) but does the choice of motion estimation method matter? ;)
I'm going with, well, trial and error for now, but it'd be great if someone actually knew...
snherbst
20th December 2007, 01:31
Why not take at look at this place
http://ffmpeg.mplayerhq.hu/faq.html#SEC19
ImAhNoBoDy
24th December 2007, 15:29
Why not take at look at this place
http://ffmpeg.mplayerhq.hu/faq.html#SEC19
I tried those settings and ffmpeg (ffmpeg.rev11143) keeps on crashing. I use ffmpeg.rev9133 with the settings and it will play on my computer but not on my psp. Getting the error "unsupported data":
ffmpeg -bitexact -y -i haha.flv -title haha -vcodec h264 -coder 1 -bufsize 128 -g 250 -s 320x240 -r 29.97 -b 256k -acodec aac -ac 2 -ar 48000 -ab 128k -f psp haha.MP4
Then I tried using the latest version of ffmpeg (ffmpeg.rev11143) with the settings it crashes all the time:
ffmpeg -bitexact -y -i haha.flv -title haha -vcodec libx264 -coder 1 -bufsize 128 -g 250 -s 320x240 -r 29.97 -b 256k -acodec libfaac -ac 2 -ar 48000 -ab 128k -f psp haha.MP4
It crashes all the time. Xvid -vodec works just fine though. I tried so many ways to get ffmpeg to play avc but still can't do it. Does it even support avc for psp anymore? I have the official 3.60 firmware.
snherbst
25th December 2007, 15:02
Ive read the documentation through of ffmpeg i cant read of any h264 encoding support only decoding support.
http://ffmpeg.mplayerhq.hu/general.html#SEC6
I dont know if you have to have X264 installed to use this option for ffmepeg.
Have you tried to look if you can use mencoder
or have you searched this forum
maybe this thread will be of any help
http://forum.doom9.org/showthread.php?t=100116&page=6
http://forum.doom9.org/showthread.php?t=109741
Or the gentoo forum
http://forums.gentoo.org/viewtopic-t-440367.html
PS: Ive made a search on "mencoder PSP"
rootkit
27th December 2007, 04:40
I made this: http://teknoraver.campuslife.it/software/mp4tools/ i hope that are good for your needs
ilovejedd
28th December 2007, 05:07
ffmpeg -bitexact -y -i haha.flv -title haha -vcodec h264 -coder 1 -level 21 -bufsize 128 -g 250 -s 320x240 -r 29.97 -b 256k -acodec aac -ac 2 -ar 48000 -ab 128k -f mp4 haha.MP4
Take note of the -level flag. That's required for files placed inside the ms0:\VIDEO folder. For full DVD resolution, just replace with -level 30, I guess.
-bitexact isn't a requirement. I've been able to play videos encoded without that flag.
-f psp is not a requirement anymore. Used to be, it was an integrated "ATOMChanger". Since firmware 2.80, there's no need for ATOMChanger and you can use normal -f mp4.
-coder 1 is for CABAC, I believe. That one's required I think.
Bitrate (-b for video, -ab for audio) and framerate (-r) can be changed. Resolution (-s) can be changed, too, with a few limitations. As long as width x height <= 76800, values are pretty much arbitrary. For higher resolutions, the only ones supported on official firmware are 480x270 (or was it 272?) and 720x480. I'm guessing gop size (-g) can be changed, too. Not sure if audio framerate is still limited to 24000 and 48000. Audio channel (-ac) is 1 for mono and 2 for stereo.
Um, yeah, that's all I can remember for ffmpeg.
informationspy
29th December 2007, 09:30
I recommend you use nero for linux. it can sovle your present problems THe most transfering software can only support windows and mac
nm
29th December 2007, 11:39
As far as I know, there isn't a Linux version of Nero Recode. And even if they did have one, the other solutions presented by previous posters aren't that much harder to get working.
buba king
1st January 2008, 03:49
I use this script for converting to psp (firmware 3.71 M33, afaik) compitable video. It uses mplayer for filtering and x264 (cli) for encoding. (Uses a named pipe to transfer data between the two processes) I guess you could use mencoder for the whole process but i needed the latest x264 version.
Also uses mplayer to dump the audio and faac to encode it. MP4Box for muxing. Great for batch encoding.
call it like this: ./psp_encode.sh source_video.mkv target_name 480 272
#!/bin/sh
# Quality
CRF=26
FPS=`mplayer -identify -frames 0 "$1" 2>/dev/null | grep ID_VIDEO_FPS | sed 's/ID_VIDEO_FPS=//'`
mkfifo output.y4m
mplayer -channels 2 -sid 0 -vf scale=$3:$4 -af lavcresample=48000 -ao pcm:fast:file=output.wav -vo yuv4mpeg:file=output.y4m "$1" > /dev/null &
# Fork and start x264
x264 --crf $CRF --level 3.0 --ref 2 --mixed-refs --bframes 3 --b-rdo --bime --weightb --direct auto --subme 7 --trellis 2 --analyse all --merange 64 --vbv-maxrate 4000 --me umh --threads 8 --thread-input --sar 1:1 --progress --no-psnr --no-ssim --output ${2}.264 output.y4m > /dev/null
# Let x264 finish before starting audio encoding.
sleep 4s;
faac -q 60 -o ${2}.aac output.wav
mv output.wav ${2}.wav
mv ${2}.264 ${2}.mp4 ${2}.264 ${2}.mp4.backup
MP4Box -fps $FPS -add ${2}.264 ${2}.mp4
MP4Box -fps $FPS -add ${2}.aac ${2}.mp4
ImAhNoBoDy
11th January 2008, 16:11
ffmpeg -bitexact -y -i haha.flv -title haha -vcodec h264 -coder 1 -level 21 -bufsize 128 -g 250 -s 320x240 -r 29.97 -b 256k -acodec aac -ac 2 -ar 48000 -ab 128k -f mp4 haha.MP4
Take note of the -level flag. That's required for files placed inside the ms0:\VIDEO folder. For full DVD resolution, just replace with -level 30, I guess.
-bitexact isn't a requirement. I've been able to play videos encoded without that flag.
-f psp is not a requirement anymore. Used to be, it was an integrated "ATOMChanger". Since firmware 2.80, there's no need for ATOMChanger and you can use normal -f mp4.
-coder 1 is for CABAC, I believe. That one's required I think.
Bitrate (-b for video, -ab for audio) and framerate (-r) can be changed. Resolution (-s) can be changed, too, with a few limitations. As long as width x height <= 76800, values are pretty much arbitrary. For higher resolutions, the only ones supported on official firmware are 480x270 (or was it 272?) and 720x480. I'm guessing gop size (-g) can be changed, too. Not sure if audio framerate is still limited to 24000 and 48000. Audio channel (-ac) is 1 for mono and 2 for stereo.
Um, yeah, that's all I can remember for ffmpeg.
Thanks but I had to install PSPVideo9 and look at the log to see what kind of parameters it was using. It was then I found out about -level. I'm using -level 13 but what are these levels anyways? Are they like profiles?
microchip8
11th January 2008, 16:17
Thanks but I had to install PSPVideo9 and look at the log to see what kind of parameters it was using. It was then I found out about -level. I'm using -level 13 but what are these levels anyways? Are they like profiles?
read the wiki on H.264 profiles and levels, scroll down to the middle of the page
http://en.wikipedia.org/wiki/H264
microchip8
11th January 2008, 16:24
also you can try out the h264enc script, works pretty well
http://h264enc.sourceforge.net
Nirgal38
11th January 2008, 17:31
I have encoded successful PSP compatible MP4 files using mencoder on Linux and Windows (XP and Vista) based machines. Make sure you've compiled the latest version of MPlayer/MEncoder (http://www.mplayerhq.hu).
Here's the command line I use. You can also save it as a script/batch file.
mencoder file_in.mpg -ofps 30000/1001 -af lavcresample=24000 -vf harddup,scale=480:272 -of lavf -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:acodec=aac -lavfopts format=psp:i_certify_that_my_video_stream_does_not_use_b_frames -o file_out.mp4
Naturally, you'll change "file_in" and "file_out" with the appropriate file names. You might also need to change the scale because this is designed to encode videos with a 16:9 aspect ratio. Be sure to read the docs for the software for all the tips and tricks.
It works on my older PSP and on my son's new PSP.
I probably use MPlayer and MEncoder daily for either watching or encoding video. Part of my job is to create video for public display and I'd be lost without this great freeware.
:helpful: How's that for my first post to Doom9?
microchip8
11th January 2008, 17:43
I have encoded successful PSP compatible MP4 files using mencoder on Linux and Windows (XP and Vista) based machines. Make sure you've compiled the latest version of MPlayer/MEncoder (http://www.mplayerhq.hu).
Here's the command line I use. You can also save it as a script/batch file.
mencoder file_in.mpg -ofps 30000/1001 -af lavcresample=24000 -vf harddup,scale=480:272 -of lavf -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:acodec=aac -lavfopts format=psp:i_certify_that_my_video_stream_does_not_use_b_frames -o file_out.mp4
Naturally, you'll change "file_in" and "file_out" with the appropriate file names. You might also need to change the scale because this is designed to encode videos with a 16:9 aspect ratio. Be sure to read the docs for the software for all the tips and tricks.
It works on my older PSP and on my son's new PSP.
I probably use MPlayer and MEncoder daily for either watching or encoding video. Part of my job is to create video for public display and I'd be lost without this great freeware.
:helpful: How's that for my first post to Doom9?
he was asking for H.264/AVC video, not MPEG4 ASP. Also the "i_certify_that_my_video_stream_does_not_use_b_frames" option is no longer available in the latest version of MEncoder. And the harddup filter should come at the end of the filter chain
rootkit
12th January 2008, 19:14
anyone tried my script for PSP?
It works fine for me
Nirgal38
14th January 2008, 06:23
Ah... missed the part about H.264/AVC. I also need to make a slight change in my script. I don't have the proper scale factor.
Which version of mencoder removed the part about B frames? I downloaded a new version just minutes ago, ran my script and it worked just fine (at least on the Windows version... have to check on the Linux version on my other computer in the morning).
I've also re-read the docs and you are correct about the placement of the harddup filter. However, I've run the above command line and it's worked just fine. In the future, however, I'll make that change.
microchip8
20th January 2008, 12:41
Ah... missed the part about H.264/AVC. I also need to make a slight change in my script. I don't have the proper scale factor.
Which version of mencoder removed the part about B frames? I downloaded a new version just minutes ago, ran my script and it worked just fine (at least on the Windows version... have to check on the Linux version on my other computer in the morning).
I've also re-read the docs and you are correct about the placement of the harddup filter. However, I've run the above command line and it's worked just fine. In the future, however, I'll make that change.
If I remember correctly it was removed for the 1.0rc2 release. This doesn't mean that the lavf muxer is fixed though. It still produces broken files when used with B-Frames and it still prints a warning when encoding starts.
amshds
25th January 2008, 21:25
Based on the resolution of the video I use one of the two settings. #1 for 16:9, or #2 if I need padding (fill in the ? with what you need). May have to change the -acodec aac to libfaac and/or -vcodec h264 to libx264, depending on how ffmpeg is set up.
In my opinion, this outputs video equal to same settings in PSPVideo9.
1) ffmpeg -i Original_Video.avi -acodec aac -ab 128kb -vcodec h264 -b 768kb -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 480x272 -r 30000/1001 -vol 750 -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -vlevel 13 New_Name.mp4
2) ffmpeg -i Original_Video.avi -acodec aac -ab 128kb -vcodec h264 -b 768kb -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 480x232 -padtop ? -padbottom ? -r 30000/1001 -vol 750 -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -vlevel 13 New_Name.mp4
E.J.
14th March 2008, 14:06
I like to use mencoder to convert PSP videos, but the settings i was using aren't working anymore on Custom FW 3.90 M33.
example:
mencoder.exe INPUT -af lavcresample=48000 -vf /
scale=368:272:0:0:,harddup -ofps 30000/1001 -ovc x264 /
-x264encopts threads=auto:global_header:partitions=all:trellis=1:level_idc=30:qp=26:subq=5:frameref=3:bitrate=700 /
-oac faac -faacopts br=128:mpeg=4:object=2:raw -of lavf /
-lavfopts format=psp -info name="VIDEO NAME" -o OUTPUT.MP4
Any idea why those settings are not working now?
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.