View Full Version : PSP megui problem
jthekk2
29th July 2008, 21:06
I'm trying to encode an episode of the anime Samurai Champloo. It is in the .mkv format with an avc video stream and aac audio stream (44100 hz, 128 kbps). I'm trying to convert it to work on my psp using megui. My avisynth file is as follows:
DirectShowSource("C:\Documents and Settings\Owner\Desktop\Samurai Champloo [a4e]\[a4e]Samurai_Champloo_01[h.264].mkv",fps=23.976,audio=false)
#deinterlace
#crop
Spline36Resize(480,262).Sharpen(0.2).AddBorders(0,5,0,5)
#denoise
AssumeFPS(24000,1001)
I'm using Sharktooth's Device-PSP x264 preset from here: http://forum.doom9.org/showthread.php?t=139765.
I'm not entirely sure whats wrong, as the muxed output (using the built in mp4box in megui) works fine with media player classic and quicktime, but when i try to play it on my psp, it just says "video cannot be played". When i mux the two streams separately in yamb, the video does not play either.
I also tried encoding the audio from aac to mp3, and both the megui and the yamb muxed files play video, but the sound isn't working (but it works properly on my pc)
Atak_Snajpera
29th July 2008, 21:38
Remove AssumeFPS(24000,1001)
jthekk2
29th July 2008, 21:45
i thought that was necessary for the larger files...will try it though
Ranguvar
29th July 2008, 23:49
I'm 99.9% sure that would not cause a problem...
jthekk2, what firmware is your PSP running? Make sure you're using either the latest Sony firmware or the latest custom firmware. And make sure you're placing your videos into F:\VIDEO, where F is the drive letter of your PSP when plugged in.
lexor
29th July 2008, 23:49
And if that doesn't work, encode to raw file instead of muxing into mp4 directly, and use mp4box (even through megui) to mux video and sound later. The PSP doesn't seem to like the muxer that x264 builds include. No mp4 produced by x264 has ever played on my psp, always have to remux raw streams.
jthekk2
30th July 2008, 02:00
@ ranguvar - i'm on 4.01 m33-2. i've been putting them in the right folder too (for me its G:\video)
@ lexor - also, i have been encoding to rawavc and have been muxing it using mp4box (through yamb)...still no go
lexor
30th July 2008, 02:07
hmm... weird, the profile should produce playable video (that profile never failed me, at least), and you use correct resolution. This leaves audio, I don't think PSP support mp3 in mp4 container, so that's why your avc+mp3 doesn't work. Try re-encoding aac->aac using megui (or get the source audio, if you want better quality, though if the source is ac3 or something, it's still lossy->lossy transcode). I have encountered some older aac files that wouldn't play on PSP.
Ranguvar
30th July 2008, 03:58
Try removing the VBV buffer limits in the profile. The PSP can handle obscene bitrates, so they shouldn't do anything.
The interesting thing to me is that using MP3 audio makes the video play. Try muxing your video with the Haali muxer (gdsmux.exe, included with Haali Media Splitter) or with mp4creator (used by MP4Muxer (http://forum.doom9.org/showthread.php?t=138445)).
Sharktooth
30th July 2008, 04:27
the VBV limits do not prevent the file to be played. it's exactly the opposite.
ensure you have the latest firmware and to use the correct resolution and framerate.
try remuxing the output with mp4creator (or mp4box with the -psp option).
Ranguvar
30th July 2008, 04:37
the VBV limits do not prevent the file to be played. it's exactly the opposite.
This is a freaky situation, so I was trying freaky answers :p Besides, the VBV limits seem ridiculous for a device that can handle 20Mbps..... I've encoded without them perfectly well. Oh, and sorry for the off topic, but the PSP can also do 3 b-frames, which the profile does not use :p
Sharktooth
30th July 2008, 04:44
i know, the preset should ensure playback on older firmwares too.
however i will rename and update it asap. settings suggestions?
lexor
30th July 2008, 05:33
The profile is basically good, only minor tweaks are really possible:
--bframes 3; Works for sure... well maybe not on some crazy old firmware, but there is never a reason to hold back with updates for PSP, all they've done is make system better.
--qpmin 1; Default is 10, which DS tracked down to some crazy old and completely arbitrary coding decision, there is no need to constrain ratecontrol like this. This one is really a universal thing for all profiles.
As of the latest firmware --b-pyramid is still a very big no-no. I can't say anything definitive for trellis, since that depends on co-related patches (psyrd and such) and personal preference for speed.
Ranguvar
30th July 2008, 06:15
but there is never a reason to hold back with updates for PSP, all they've done is make system better.
Sony firmware? Definitely not :p Custom firmware? Still maybe not, new firmware sometimes has bugs and, more often, incompatibilities.
--qpmin 1; Default is 10, which DS tracked down to some crazy old and completely arbitrary coding decision, there is no need to constrain ratecontrol like this. This one is really a universal thing for all profiles.
Confirmed.
I'd just remove the VBV, increase b-frames to 3, and lower qpmin. Oh, and one last thing, though we're really off topic now - could you please allow me to fully edit the CLI, besides just adding things? It seems impossible to remove --thread-input, for example, which in my tests slows down encoding with multithreaded scripts.
Sharktooth
30th July 2008, 14:10
The profile is basically good, only minor tweaks are really possible:
--bframes 3; Works for sure... well maybe not on some crazy old firmware, but there is never a reason to hold back with updates for PSP, all they've done is make system better.
--qpmin 1; Default is 10, which DS tracked down to some crazy old and completely arbitrary coding decision, there is no need to constrain ratecontrol like this. This one is really a universal thing for all profiles.
As of the latest firmware --b-pyramid is still a very big no-no. I can't say anything definitive for trellis, since that depends on co-related patches (psyrd and such) and personal preference for speed.
qpmin 1 is not going to happen.
qpmin 10 is the x264 default and it is enough for any use. 18 is almost transparent so 10 as a minumum is going to stay coz i dont even think q10 will be ever used in a bitrate restricted 2pass envcoding... 1 may avoid undersizes, but only in extreme situations and i dont think the PSP is the case.
i set qpmin 1 only in the Insane preset.
trellis dosest infuence playback.
jthekk2
30th July 2008, 16:21
it seems that the problem was the audio, it was in the old aac format lexor was talking about. i re-encoded the audio to nero aac-lc and then remuxed and the video played perfectly. thanks for the help!
Sharktooth
30th July 2008, 16:45
good to know. :)
jthekk2
30th July 2008, 17:01
i have a couple of more questions, not on how to get it to work on the psp, just on the settings, since i'm new to megui. what avc levels does the psp support (meaning, can i encode in avc high profile, and if so, at what level)? Also, what is the best setting to encode a 250ish mb matroska video to the psp format with quality being the main concern (and hopefully a size smaller than 250)? i'm trying to avoid getting compression artifacts if possible
lexor
30th July 2008, 17:46
qpmin 1 is not going to happen.
qpmin 10 is the x264 default and it is enough for any use. 18 is almost transparent so 10 as a minumum is going to stay coz i dont even think q10 will be ever used in a bitrate restricted 2pass envcoding... 1 may avoid undersizes, but only in extreme situations and i dont think the PSP is the case.
i set qpmin 1 only in the Insane preset.
trellis dosest infuence playback.
Wouldn't that only be a problem if you believe that x264 will actually pick close to qp 1 frequently all of a sudden? I mean if you have crf 20 encode and it only went down to 11, it's not going to go below 11 if you set qpmin 1. Unless it really needs to. I think trusting (and through testing, improving) rate control is a good thing here. Especially considering that other profiles mess with ip and pb rations for no good reason, and those default ratios have apparently not been picked at random by the devs. It is not filesize, but constant quality we are going for in crf; and 2-pass will maintain the bitrate. I truly see no cause not to trust rate control here.
@jthekk2: you can't go higher than level 3. I never tried lower, and I don't see a reason to.
@Ranguvar: I have never encountered any problems with any firmware, it always made things better for me (more features, better compatibility). I once heard of bricked PSPs with custom firmware, but even that was only because some mirror site messed with the files, not because devs screwed up. And that one incident now persists on the net in the by word as some sort of general issue.
Ranguvar
30th July 2008, 18:25
@lexor: Custom firmware does so much, it's almost crazy not to use it :p You can emulate near every other system (including the PS1 and N64, the former at consistent 100% speed), there are lots of media players, remote control apps, PDA tools, internet radio, etc.... the PSP can do nearly everything and anything. That site you're talking about, ps2nfo, aka ps3news, is a bunch of scumbags.... Besides, thanks to the devs, it's now impossible to brick a PSP through software ;) Look up Pandora's Battery.
@jthekk2: Medium profile, level 3 (though I have found omitting --level 3 seems to still work), any resolution up to and including 480x272 or including 720x480 (but nothing in between), up to 3-bframes and 3 refs, up to something around 20Mbps (yes, Mbps), CABAC, and deblocking.
lexor
30th July 2008, 18:38
Now that you mention it, did anyone ever manage to use the 720x480 resolution in a way that doesn't add black bars on all 4 sides on playback? Avoiding resize would be a bonus for DVD material, if only I could get the 16x9 picture to fill the entire screen and not be letterboxed all around.
jthekk2
30th July 2008, 19:34
@lexor when i was still using vdub/pspvideo9, i encoded a movie to 720x480. to avoid black bars on all sides of the video, i used vdubmod to add the black bars on the top and bottom to preserve the aspect ratio and then used pspvideo9 and it came out fine (fine meaning ar was good, quality was eh)...i also encoded a widescreen movie which was already in the 16:9 ratio and it worked as well, still with psp video 9 though...i'll try encoding a widescreen later today with megui
also, thanks for the info on the settings i can use...very useful stuff to know for someone who just started
@raguvar cfw is the bomb! i had to pandorize my psp to get it to cfw cuz i bought a slim w/ 3.71 fw and it hasn't failed me yet...it supports pretty much any video game emulator before the ps2/xbox/dreamcast/gamecube generation.
teddg
26th October 2008, 18:41
Now that you mention it, did anyone ever manage to use the 720x480 resolution in a way that doesn't add black bars on all 4 sides on playback? Avoiding resize would be a bonus for DVD material, if only I could get the 16x9 picture to fill the entire screen and not be letterboxed all around.
This is fixed on the used one I bought yesterday (PSP2001 w/5.01 firmware). It has a 'zoom', 'full screen' and 'normal' selection when playing 720x480.
I'm having trouble though with the anamorphic being a little off for files with cropped letterboxing. That is, if I leave the letterboxing on and preserve the original dar and par, re-encode to x264, PSP plays it perfectly. If I crop the letterboxing and update the dar and par accordingly (keep horizontal pixels but rescale vertical to 480), then the zoom/fullscreen seems to be a little off. Still experimenting.
fleon
26th October 2008, 19:04
i have a couple of more questions, not on how to get it to work on the psp, just on the settings, since i'm new to megui. what avc levels does the psp support (meaning, can i encode in avc high profile, and if so, at what level)? Also, what is the best setting to encode a 250ish mb matroska video to the psp format with quality being the main concern (and hopefully a size smaller than 250)? i'm trying to avoid getting compression artifacts if possible
Well in other thread I asked some questions, and I did some tests and now this are the settings that I use:
program --crf 22.0 --ref 3 --mixed-refs --no-fast-pskip --bframes 16 --b-adapt 2 --weightb --direct auto --filter -2:-1 --subme 9 --trellis 2 --partitions p8x8,b8x8,i4x4,p4x4 --me tesa --merange 32 --threads auto --thread-input --progress --no-dct-decimate --no-psnr --no-ssim --output "output" "input"
I know they are extreme but i dont care about the speed, And they work great on the psp
Also since someone here said that is better to use qmin 1 I am gonna try it
kemuri-_9
26th October 2008, 19:22
qpmin 1 compared to the standard 10 allows the maximum quality of a frame to be allowed to go to 1, which is nearly lossless (0 is lossless afaik) in quality.
generally you should only get such low qp decisions when your bitrate is ridiculously high or crf ridiculously low enough to let x264 pick such low qps for your source.
that's why the default value is 10.
if your bitrate is too high, often x264 will give a message like
x264 [warning]: Error: 2pass curve failed to converge
x264 [warning]: target: X kbit/s, expected: Y kbit/s, avg QP: Z
x264 [warning]: try reducing target bitrate
where X > Y
but at a crf 22 encode, which works by having the average of the qps at 22, i don't think you'll see many if at all frames get a qp below 10 if you do change the qpmin.
fleon
26th October 2008, 19:59
qpmin 1 compared to the standard 10 allows the maximum quality of a frame to be allowed to go to 1, which is nearly lossless (0 is lossless afaik) in quality.
generally you should only get such low qp decisions when your bitrate is ridiculously high or crf ridiculously low enough to let x264 pick such low qps for your source.
that's why the default value is 10.
if your bitrate is too high, often x264 will give a message like
x264 [warning]: Error: 2pass curve failed to converge
x264 [warning]: target: X kbit/s, expected: Y kbit/s, avg QP: Z
x264 [warning]: try reducing target bitrate
where X > Y
but at a crf 22 encode, which works by having the average of the qps at 22, i don't think you'll see many if at all frames get a qp below 10 if you do change the qpmin.
I didnt knew that, guess I am gonna keep using my settings then, thanks
kemuri-_9
26th October 2008, 20:22
oh, i realized i had a few mistakes in what i said a bit ago:
1.
that message i gave is when the qpmin is at 1 already.
if it's not at qpmin 1 it'll say
x264 [warning]: Error: 2pass curve failed to converge
x264 [warning]: target: X kbit/s, expected: Y kbit/s, avg QP: Z
x264 [warning]: try reducing target bitrate or reducing qp_min (currently W)
again, X > Y
and Z approaches W
(referring to the mathematical approach as in if it goes on infinitely it will be that exact value,
but since things aren't infinite, it'll just be really really close - not exact)
2.
and there's a special case for qp_min:
usually the minimum value a frame's qp can be is the actual qp_min,
unless, the qpmin is set to 1, in which the frame's qp can be 0, which would be lossless quality.
chainring
26th October 2008, 23:38
Settings that kill the PSP:
More than 3 reference frames.
Turning ON b-pyramid
8x8 DCT
Jack b-frames all the way to 16 and the PSP eats it up.
Same thing for Trellis; it doesn't care.
Bitrate, like has been previously stated, it can handle obscene bitrates. Over 20Mpbs, in fact.
Sagekilla
27th October 2008, 02:18
B-Frames shouldn't matter though. They're basically discarded after usage if they're not referenced, and if they are x264 compensates for the each ref they consume. Likewise, Trellis is just RDO: Any encoder could theoretically use Trellis, just not everyone implements it.
Still, I'm a bit saddened it doesn't support 8x8dct. More than 3 refs probably wouldn't help on 480x272 res, but 8x8dct would help more..
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.