Log in

View Full Version : Good Quality Settings for PSP? What is Overkill?


Pages : 1 [2] 3

fleon
9th October 2008, 22:12
--scenecut -1
not 1

I didnt read well but, This also works, this is the complete settings:

program --crf 19.0 --level 3 --ref 3 --mixed-refs --no-fast-pskip --bframes 16 --b-adapt 0 --weightb --direct auto --subme 9 --trellis 2 --partitions p8x8,b8x8,i4x4 --vbv-bufsize 10000 --vbv-maxrate 10000 --scenecut -1 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim --output "output" "input"

also if you want i can upload the video, I used megui 0.3.0.3002 and x264 998 skystrife's patched build

chainring
10th October 2008, 00:46
Wow, this PSP is nuts in what it can handle. Absolutely zero problems with the settings below.

program --crf 22.0 --level 3 --ref 3 --mixed-refs --bframes 3 --b-adapt 2 --weightb --direct auto --subme 9 --trellis 2 --psy-rd 1.0:1.0 --partitions p8x8,b8x8,i4x4 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim --output "output" "input" --no-b-adapt --scenecut=-1 --bframes 16

And this works as well, which will be my normal profile:

program --crf 22.0 --level 3 --ref 3 --mixed-refs --bframes 3 --b-adapt 2 --weightb --direct auto --subme 9 --trellis 2 --psy-rd 1.0:1.0 --partitions p8x8,b8x8,i4x4 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim --output "output" "input"

Ranguvar
10th October 2008, 01:57
Woot for hardware AVC decoders ;P

Have you tried to find its bitrate ceiling yet? Have fun ;)

Dark Eiri
10th October 2008, 05:19
Wow, this PSP is nuts in what it can handle. Absolutely zero problems with the settings below.

program --crf 22.0 --level 3 --ref 3 --mixed-refs --bframes 3 --b-adapt 2 --weightb --direct auto --subme 9 --trellis 2 --psy-rd 1.0:1.0 --partitions p8x8,b8x8,i4x4 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim --output "output" "input" --no-b-adapt --scenecut=-1 --bframes 16


This is kinda odd... you specified --b-adapt 2 and --bframes 3 and then --no-b-adapt --bframes 16?

That's why it's playing, x264 is using the first settings, --bframes 3.

chainring
10th October 2008, 05:33
This is kinda odd... you specified --b-adapt 2 and --bframes 3 and then --no-b-adapt --bframes 16?

That's why it's playing, x264 is using the first settings, --bframes 3.
Hmm, I'm surprised I didn't catch onto that, but I'm not quite sure what the reactions would be. I just pasted it into the custom commandline section in MeGUI without giving it a thought. D'oh!

fleon
10th October 2008, 05:40
This is kinda odd... you specified --b-adapt 2 and --bframes 3 and then --no-b-adapt --bframes 16?

That's why it's playing, x264 is using the first settings, --bframes 3.

No man, I also did that test and it does work, althought he did specified the options wrong but not me

I didnt read well but, This also works, this is the complete settings:

program --crf 19.0 --level 3 --ref 3 --mixed-refs --no-fast-pskip --bframes 16 --b-adapt 0 --weightb --direct auto --subme 9 --trellis 2 --partitions p8x8,b8x8,i4x4 --vbv-bufsize 10000 --vbv-maxrate 10000 --scenecut -1 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim --output "output" "input"

also if you want i can upload the video, I used megui 0.3.0.3002 and x264 998 skystrife's patched build

kemuri-_9
10th October 2008, 14:44
This is kinda odd... you specified --b-adapt 2 and --bframes 3 and then --no-b-adapt --bframes 16?

That's why it's playing, x264 is using the first settings, --bframes 3.

x264 uses the last options specified on the command line if there's repeat ones.
x264 does parse the first instance of the options, but when it comes across repeats it just overrides the old specified values with the ones it sees along the way.
so options specified at the end are the ones that get used!

so it did use --bframes 16 and --no-b-adapt for that above case

chainring
10th October 2008, 15:59
x264 uses the last options specified on the command line if there's repeat ones.
x264 does parse the first instance of the options, but when it comes across repeats it just overrides the old specified values with the ones it sees along the way.
so options specified at the end are the ones that get used!

so it did use --bframes 16 and --no-b-adapt for that above case
Woohoo! Test valid; the PSP is nuts! Add 16 B-Frames to the crazy high bitrate handling and it's very impressive. Now, if there was a way to get rid of the ghosting. :)

Ranguvar
10th October 2008, 16:09
Ghosting I have found best resolved by increasing brightness. This makes the video look washed-out, which is countered by raising contrast/saturation. This causes huge blocking in dark scenes, which is countered by VAQ and a deblocker. Etc., etc., etc...

Choose your poison :) I agree, the ghosting sucks. So, you need to choose between that or any of the other effects of countering it. I've experimented a lot, but the only silver bullet is the soon-to-be PSP-300x, which will have a screen that reportedly is much more bright, vivid, and does not ghost :D

deets
10th October 2008, 17:17
yeah i also raise the brightness a tad for the ghosting :) my old PSP fatboy is on its last legs, it has a ring of pixels around the screen that go a different colour so im considering getting the new 3000 model with the better screen :D

Dark Eiri
10th October 2008, 17:23
So it can really play 16 b-frames? Awesome! So I guess the PSP is the best portable H264 player around, definitely. Complete obliteration of the iPods in video decoding aspect.
Should we notify Sharktooth so he could add more B-frames to the PSP profile? And Winnydows?

fleon
10th October 2008, 18:56
So it can really play 16 b-frames? Awesome! So I guess the PSP is the best portable H264 player around, definitely. Complete obliteration of the iPods in video decoding aspect.
Should we notify Sharktooth so he could add more B-frames to the PSP profile? And Winnydows?

Yeah they must know this does work 100%, I have started converting my videos with the new settings, so I have tested 16 b frames with some videos and I had no problems at all, I dont know why some people want divx and/or xvid support , h264 is way better
love x264!:cool:

Rumbah
10th October 2008, 22:30
I just did a test and call me surprised. A 16 b-frames encode played perfectly fine on the PSP.

Video info:

--[NoImage] Job commandline: "C:\Programme\megui\tools\x264\x264.exe" --crf 16.0 --level 3 --ref 3 --mixed-refs --bframes 16 --b-adapt 0 --weightb --direct auto --subme 9 --trellis 2 --psy-rd 1.0:1.0 --partitions p8x8,b8x8,i4x4 --me umh --threads auto --thread-input --sar 1:1 --progress --no-psnr --no-ssim --output "O:\Andromeda S4\Andromeda S4E19.264" "O:\Andromeda S4\Andromeda S4E19.avs" --scenecut=-1
--[Information] [10.10.2008 21:50:14] Encoding started
--[NoImage] Standard output stream
--[NoImage] Standard error stream
---[NoImage] avis [info]: 368x272 @ 29.97 fps (80387 frames)
---[NoImage] x264 [info]: using SAR=1/1
---[NoImage] x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
---[NoImage]
---[NoImage] x264 [info]: slice I:322 Avg QP:17.11 size: 13838
---[NoImage] x264 [info]: slice P:4823 Avg QP:18.09 size: 9370
---[NoImage] x264 [info]: slice B:75242 Avg QP:20.70 size: 3887
---[NoImage] x264 [info]: consecutive B-frames: 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 4.4% 0.0% 0.0% 0.0% 0.0% 0.0% 95.6%
---[NoImage] x264 [info]: mb I I16..4: 30.3% 0.0% 69.7%
---[NoImage] x264 [info]: mb P I16..4: 10.6% 0.0% 38.0% P16..4: 17.2% 14.5% 13.3% 0.0% 0.0% skip: 6.4%
---[NoImage] x264 [info]: mb B I16..4: 2.8% 0.0% 11.1% B16..8: 28.2% 5.2% 8.1% direct: 9.1% skip:35.4% L0:38.2% L1:39.3% BI:22.5%
---[NoImage] x264 [info]: direct mvs spatial:99.8% temporal:0.2%
---[NoImage] x264 [info]: ref P L0 75.9% 15.7% 8.4%
---[NoImage] x264 [info]: ref B L0 88.3% 11.7%
---[NoImage] x264 [info]: kb/s:1020.4
---[NoImage] encoded 80387 frames, 17.23 fps, 1020.41 kb/s
--[Information] Final statistics
---[NoImage] Constant Quality Mode: Quality 16 computed...
---[NoImage] Video Bitrate Obtained (approximate): 1020 kbit/s
--[Information] [10.10.2008 23:08:02] Job completed

Dark Eiri
11th October 2008, 04:53
Now I can confirm this too. Played fine with 16 b-frames.
This is just insane! It will increase compressibility a lot!

Oh, and about the ghosting, the new PSP-3000 supposedly reduced that a lot, and plus, added contrast and brightness.

Snowknight26
11th October 2008, 06:15
How about a max bitrate or lossless support?

qyqgpower
11th October 2008, 06:33
Max bitrate doesn't matter IMO, because PSP can handle any reasonable bitrate for a 720x480 source.
And I would add some notes here:
1. PSP support both PAFF and MBAFF, so interlaced DVD can be directly encoded to a PSP compatible AVC file. Someone would ask: why not use film rate or IVTC first? see below.
2. PSP always bob 720x480 video regardless of PAFF/MBAFF/Frame(progressive). The quality of PSP bob is superb, but static objects(eg. subtitle) will flicker if the bobbed display rate is not high enough(eg. 24p->48Hz=flicker, 30i->60Hz=good quality).

fleon
11th October 2008, 19:49
Now I can confirm this too. Played fine with 16 b-frames.
This is just insane! It will increase compressibility a lot!

So.. that means that now the range of 18-22 crf is too much right? what would you recommed now?

cogman
11th October 2008, 21:33
Nope, not at all. CRF adjusts with better settings. so the range is still the same, your bitrate will just go down.

chainring
11th October 2008, 23:20
How about a max bitrate or lossless support?
No worries about a max bitrate; you won't hit it. Someone else, whose name I can't remember right now, threw a 25Mbps file at the PSP and it ate it up.

At CRF 22, a full encode of "I Robot" with downmixed 64kbps HE-AAC (two channels) came in at under 400MB with amazing quality. I bet at CRF 24, it would still be excellent, but haven't tested yet.

Ranguvar
12th October 2008, 05:41
with downmixed 64kbps HE-AAC (two channels)

Don't use HE-AAC on the PSP. HE-AAC works by only encoding half of the frequency range, and using techniques to reconstruct the other half, which is of course good for very low bitrates (< ~96 for music, less for movies). However, many players (including the PSP) don't do the reconstruction, leaving you with a stream that's worse than LC-AAC.

@Dark Eri: 20Mbps has been known to work :D In other words, bitrate's not a problem at all.

Dark Eiri
12th October 2008, 05:59
My series and music videos, ripped with HE-AAC, actually sound perfect with HE-AAC on the PSP. Even HE-AACv2, surprisingly.
I'm using the PSP speakers, so maybe my ears are tricking me, but yeah, I think it supports HE-AAC indeed!

qyqgpower
12th October 2008, 08:05
PSP DO NOT support HE-AAC, what you hear is only the LC part(and at half sample rate) in HE-AAC file.
What PSP speakers could do is only to let you hear the sound and that's all. If your ears are healthy, you could quickly notice the difference between HE/LC AAC with commonly available earphones.

Dark Eiri
12th October 2008, 08:29
Yeah, with earphones it would be easily detectable, but if you're using the PSP speakers, there's not much of a difference IMHO.
I'll stick to LC-AAC then. 64kbps is kinda nice for movies.

fleon
13th October 2008, 00:56
I have an old sony cybershot DSC-P32 I wanna convert some videos for viewing them on the psp and this is one of them.

After I analyse the source with megui it identifys it as an M-in-5 decimation required an selects tritical decimate to deinterlace it, now that's fine(I think) but also my camera seems to record video with noise, but I'm not sure if it noise or if it just need deblocking, so here is the video (it's short), please help me to know if it is noise or if it just need deblocking or other thing, and with a solution, thanks

http://www.mediafire.com/download.php?zy2kzoz0klm

Sagekilla
13th October 2008, 15:21
fleon, you're posting this on the wrong board. That discussion belongs in avisynth..


FWIW, you can try using MVDegrain or Deblock_QED(). I prefer MVDegrain personally, I find it does a good job at removing artifacts in general, not just noise/grain. What you have is blocking but MVDegrain3() cleaned it up.

fleon
13th October 2008, 18:10
fleon, you're posting this on the wrong board. That discussion belongs in avisynth..


FWIW, you can try using MVDegrain or Deblock_QED(). I prefer MVDegrain personally, I find it does a good job at removing artifacts in general, not just noise/grain. What you have is blocking but MVDegrain3() cleaned it up.

Sorry, it is just that if I find the solution for this video I find the solution for every video that my camera records, but still after this i will now post on the right boards..

I placed the last version of mvtools on the plugins directory of avisynth and I used this script:

DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1",info=3)
ColorMatrix(hints=true,interlaced=true)
TDecimate(cycleR=1)
#crop
Spline36Resize(480,272) # Spline36 (Neutral)
MVDegrain3()

but I get this error:
http://img236.imageshack.us/img236/589/45198012ja6.th.jpg (http://img236.imageshack.us/my.php?image=45198012ja6.jpg)http://img236.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)

could you please help me out

J_Darnley
13th October 2008, 20:09
Read the MVTools documentation. You need to calculate all 6 vector clips with MVAnalyse() then tell MVDegrain3() what they are.

chainring
13th October 2008, 20:13
Don't use HE-AAC on the PSP. HE-AAC works by only encoding half of the frequency range, and using techniques to reconstruct the other half, which is of course good for very low bitrates (< ~96 for music, less for movies). However, many players (including the PSP) don't do the reconstruction, leaving you with a stream that's worse than LC-AAC.

@Dark Eri: 20Mbps has been known to work :D In other words, bitrate's not a problem at all.
Good to know! FWIW, I tried searching for what the PSP supports, but didn't find anything conclusive from a quick search. I'm guessing it's best to downmix to stereo and not do any Dolby Pro-Logic?

fleon
13th October 2008, 20:29
Read the MVTools documentation. You need to calculate all 6 vector clips with MVAnalyse() then tell MVDegrain3() what they are.

Well i read some of the part of MVAnalyse but I didnt understand it too much, I looked the examples and it seems that I should use this:

vectors = source.MVAnalyse(isb = false)
source.MVShow(vectors)

correct me if I am wrong

and also if that is the way to do it, how do I view the values of all the 6 vector clips?

J_Darnley
13th October 2008, 21:11
If one want to view the vectors, then yes that is how one would do it. However you seem to want to use MVDegrain3. There is an example of how to use MVDegrain2, so just expand that with the delta=3 analyses and you will get something like:
backward_vec3 = source.MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = source.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = source.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = source.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = source.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = source.MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
source.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)

fleon
13th October 2008, 21:32
If one want to view the vectors, then yes that is how one would do it. However you seem to want to use MVDegrain3. There is an example of how to use MVDegrain2, so just expand that with the delta=3 analyses and you will get something like:
backward_vec3 = source.MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = source.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = source.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = source.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = source.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = source.MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
source.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)

Well I get an error by using the code you gave but I changed it, I replaced MVDegrain2 with MVDegrain3 in the last line and it worked, you forgot to replace that, right? for adapting the example of MVDegrain to use MVDegrain3

also i replaced source with DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3) I know that it sounds stupid but I thought that puting the source at the beginning of the script was enough Anyhow this is my complete script I think is correct now

DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3)
ColorMatrix(hints=true,interlaced=true)
TDecimate(cycleR=1)
#crop
Spline36Resize(480,272) # Spline36 (Neutral)
backward_vec3 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)

Let me know if it is not right..

that is for for fixing this http://www.mediafire.com/download.php?zy2kzoz0klm

and with this solution
FWIW, you can try using MVDegrain or Deblock_QED(). I prefer MVDegrain personally, I find it does a good job at removing artifacts in general, not just noise/grain. What you have is blocking but MVDegrain3() cleaned it up.

EDIT: After I convert the video with that script I get an 640x480 file Even Though if specified 480x272, you know for the psp resolution, I dont know why that happened

EDIT2: I placed Spline36Resize(480,272) # Spline36 (Neutral) in the last line and it worked now I got a 480x272 file

J_Darnley
13th October 2008, 23:20
That is not right. Think about what you have done in the script. You have decoded the source, applied some filters, resized then replace the video with the source again! After the resize, put a line with source = last in it, then you can use a variable named source or you can just them all operate on last.

fleon
13th October 2008, 23:41
That is not right. Think about what you have done in the script. You have decoded the source, applied some filters, resized then replace the video with the source again! After the resize, put a line with source = last in it, then you can use a variable named source or you can just them all operate on last.

Sorry but I am still learning all this and I dont know too much althought in this thread I have learned a lot but I still think that I am in diapers..

for that reason I dont understand you too much, what you said means that I should not replace the word source with this DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3) in the part of the MVDegrain3 script? and also the resizer should not be in the last line right? or could you please correct the parts that are wrong in my script?

EDIt: After reading various times, I kinda understand what you told me, in the part of the MVDegrain3 script I am taking the source without resizing it and without appling filters because I put the first line of the script, right?

Now what you told me is like create a variable and using that in the mvdegrain3 script and by that it include all the things that are before the mvdegrain3 script

By I dont know how to properly create that variable puting just source= last in it doesnt do the work, SO I thought that maybe is better to put the MVDegrain3 script first and then the other options like this:

DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3)
backward_vec3 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3).MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)
ColorMatrix(hints=true,interlaced=true)
TDecimate(cycleR=1)
#crop
Spline36Resize(480,272)

Correct me if I am wrong..

Ranguvar
14th October 2008, 01:22
Um. Wow.

Try this instead:

DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3)
src
backward_vec3 = src.MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = src.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = src.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = src.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = src.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = src.MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)
ColorMatrix(hints=true,interlaced=true)
TDecimate(cycleR=1)
#crop
Spline36Resize(480,272)

fleon
14th October 2008, 04:28
Um. Wow.

Try this instead:

DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3)
src
backward_vec3 = src.MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = src.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = src.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = src.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = src.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = src.MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)
ColorMatrix(hints=true,interlaced=true)
TDecimate(cycleR=1)
#crop
Spline36Resize(480,272)

I get this error http://img80.imageshack.us/img80/55/65111634fs6.th.jpg (http://img80.imageshack.us/my.php?image=65111634fs6.jpg)http://img80.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php) with that script

kemuri-_9
14th October 2008, 05:07
yeah ranguvar messed up with the src definition

DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3)
backward_vec3 = MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)
ColorMatrix(hints=true,interlaced=true)
TDecimate(cycleR=1)
#crop
Spline36Resize(480,272)

that should work, since when avisynth assigns to variables it doesn't overwrite the 'last' variable on those assignment lines.

Sagekilla
14th October 2008, 05:18
This is why I like the MVDegrainMulti flavor of MVtools -- You can do the same thing in two lines:


vectors = source.MVAnalyse(refframes=3, pel=2, overlap=4, idx=1)
source.MVDegrain(vectors, refframes=3, idx=1)


So much easier, shame that it's not an "official" build.

Ranguvar
14th October 2008, 12:12
I fail. :p

acrespo
14th October 2008, 22:16
Max bitrate doesn't matter IMO, because PSP can handle any reasonable bitrate for a 720x480 source.
And I would add some notes here:
1. PSP support both PAFF and MBAFF, so interlaced DVD can be directly encoded to a PSP compatible AVC file. Someone would ask: why not use film rate or IVTC first? see below.
2. PSP always bob 720x480 video regardless of PAFF/MBAFF/Frame(progressive). The quality of PSP bob is superb, but static objects(eg. subtitle) will flicker if the bobbed display rate is not high enough(eg. 24p->48Hz=flicker, 30i->60Hz=good quality).

This means that I don't need to deinterlace or IVTC any video to convert to PSP?

Sagekilla
14th October 2008, 22:32
you should still IVTC video if it's 29.97 fps video --- progressive 24 fps compresses much better than mixed field 29.97 fps. I don't see any reason to not IVTC, ever, for that matter.. This is only if your source is hard/soft telecined to 29.97 fps though. There really should be no reason to leave the telecine in though, since it takes practically no CPU to remove it, compared to the CPU usage you'd need to do smart deinterlacing in avisynth.

If it's interlaced, you could encode as interlaced or you can downsize if you choose to.

fleon
15th October 2008, 00:03
yeah ranguvar messed up with the src definition

DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3)
backward_vec3 = MVAnalyse(isb = true, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec2 = MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
backward_vec1 = MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec1 = MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec2 = MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=1, idx = 1)
forward_vec3 = MVAnalyse(isb = false, delta = 3, pel = 2, overlap=4, sharp=1, idx = 1)
MVDegrain3(backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400,idx=1)
ColorMatrix(hints=true,interlaced=true)
TDecimate(cycleR=1)
#crop
Spline36Resize(480,272)

that should work, since when avisynth assigns to variables it doesn't overwrite the 'last' variable on those assignment lines.

Well, that also didnt work I get this error http://img235.imageshack.us/img235/8718/56792763sz6.th.jpg (http://img235.imageshack.us/my.php?image=56792763sz6.jpg)http://img235.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php) please help me out with this, I just need to fix this video and I'll fix every video recorded with my cam with the same script thanks!

kemuri-_9
15th October 2008, 01:28
then someone up top messed up the mvdegrain3 call from above...
i'm not the most familiar with it, so someone else should help out there.

chainring
15th October 2008, 02:38
PSP-3000 will be in-hand tomorrow. ;)

Sagekilla
15th October 2008, 05:54
Oh dear god. Here's the general one:


# Source("...")

src = last
bvec3 = src.MVAnalyse(isb=true, delta=3, pel=2, overlap=4, sharp=1, idx=1)
bvec2 = src.MVAnalyse(isb=true, delta=2, pel=2, overlap=4, sharp=1, idx=1)
bvec1 = src.MVAnalyse(isb=true, delta=1, pel=2, overlap=4, sharp=1, idx=1)
fvec1 = src.MVAnalyse(isb=false, delta=1, pel=2, overlap=4, sharp=1, idx=1)
fvec2 = src.MVAnalyse(isb=false, delta=2, pel=2, overlap=4, sharp=1, idx=1)
fvec3 = src.MVAnalyse(isb=false, delta=3, pel=2, overlap=4, sharp=1, idx=1)
src.MVDegrain3(bvec1,fvec1,bvec2,fvec2,bvec3,fvec3,idx=1)

# moar code here


Or for your specific video:


DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3)

src = last

bvec3 = src.MVAnalyse(isb=true, delta=3, pel=2, overlap=4, sharp=1, idx=1)
bvec2 = src.MVAnalyse(isb=true, delta=2, pel=2, overlap=4, sharp=1, idx=1)
bvec1 = src.MVAnalyse(isb=true, delta=1, pel=2, overlap=4, sharp=1, idx=1)
fvec1 = src.MVAnalyse(isb=false, delta=1, pel=2, overlap=4, sharp=1, idx=1)
fvec2 = src.MVAnalyse(isb=false, delta=2, pel=2, overlap=4, sharp=1, idx=1)
fvec3 = src.MVAnalyse(isb=false, delta=3, pel=2, overlap=4, sharp=1, idx=1)
src.MVDegrain3(bvec1,fvec1,bvec2,fvec2,bvec3,fvec3,idx=1)

ColorMatrix(hints=true,interlaced=true)
TDecimate(cycleR=1)
Spline36Resize(480,272)



There shouldn't be any errors. If there is, tell us the exact error message. By the way, there was no need to specify thSAD=400. That's the default.

qyqgpower
15th October 2008, 06:21
you should still IVTC video if it's 29.97 fps video --- progressive 24 fps compresses much better than mixed field 29.97 fps. I don't see any reason to not IVTC, ever, for that matter.. This is only if your source is hard/soft telecined to 29.97 fps though. There really should be no reason to leave the telecine in though, since it takes practically no CPU to remove it, compared to the CPU usage you'd need to do smart deinterlacing in avisynth.

If it's interlaced, you could encode as interlaced or you can downsize if you choose to.
Yes, it's better to IVTC a telecined source before encoding for the sake of compression. And one should always deinterlace/IVTC their source for non-480p encode.
But if you overlay a subtitle upon the video and encode it to 480p@24/25fps, you'll notice point 2 in my previous post at playback.

fleon
15th October 2008, 07:23
Oh dear god. Here's the general one:


# Source("...")

src = last
bvec3 = src.MVAnalyse(isb=true, delta=3, pel=2, overlap=4, sharp=1, idx=1)
bvec2 = src.MVAnalyse(isb=true, delta=2, pel=2, overlap=4, sharp=1, idx=1)
bvec1 = src.MVAnalyse(isb=true, delta=1, pel=2, overlap=4, sharp=1, idx=1)
fvec1 = src.MVAnalyse(isb=false, delta=1, pel=2, overlap=4, sharp=1, idx=1)
fvec2 = src.MVAnalyse(isb=false, delta=2, pel=2, overlap=4, sharp=1, idx=1)
fvec3 = src.MVAnalyse(isb=false, delta=3, pel=2, overlap=4, sharp=1, idx=1)
src.MVDegrain3(bvec1,fvec1,bvec2,fvec2,bvec3,fvec3,idx=1)

# moar code here


Or for your specific video:


DGDecode_mpeg2source("C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.d2v",info=3)

src = last

bvec3 = src.MVAnalyse(isb=true, delta=3, pel=2, overlap=4, sharp=1, idx=1)
bvec2 = src.MVAnalyse(isb=true, delta=2, pel=2, overlap=4, sharp=1, idx=1)
bvec1 = src.MVAnalyse(isb=true, delta=1, pel=2, overlap=4, sharp=1, idx=1)
fvec1 = src.MVAnalyse(isb=false, delta=1, pel=2, overlap=4, sharp=1, idx=1)
fvec2 = src.MVAnalyse(isb=false, delta=2, pel=2, overlap=4, sharp=1, idx=1)
fvec3 = src.MVAnalyse(isb=false, delta=3, pel=2, overlap=4, sharp=1, idx=1)
src.MVDegrain3(bvec1,fvec1,bvec2,fvec2,bvec3,fvec3,idx=1)

ColorMatrix(hints=true,interlaced=true)
TDecimate(cycleR=1)
Spline36Resize(480,272)



There shouldn't be any errors. If there is, tell us the exact error message. By the way, there was no need to specify thSAD=400. That's the default.

I get an error sorry.. it says ColorMatrix: no hints detected in stream with hints= true (C:\Documents and Settings\Administrator\Desktop\New Folder (2)\VTS_06_1.avs, line 13).

BUT I thought that maybe if I place this line ColorMatrix(hints=true,interlaced=true) below the first line it would do the job and that actually worked.

Now I got one last question about this whole deal, is it right to put this line ColorMatrix(hints=true,interlaced=true) below the first line or it will something like my other attempts?

blinkstar
16th October 2008, 08:49
Just did this yesterday with RipBot264 and I Robot. CRF22 and all options maxed out, with 96kbps stereo, it came in just a touch over 400 MB. It could have been lower, but I messed up with cropping so it left the black bars.

BTW, here's the settings I used to max out and have a playable file on my PSP (4.05 fw).

Note: This test was performed in Handbrake (latest SVN version), and on a Mac.

Reference Frames: 3 (That's it, no more!)
Mixed References: yes
B-Frames: 16
Direct Prediction: Auto
Weighted B-Frames: yes
B-RDO: yes
Bidirectional Refinement: yes
Motion Estimation: ME-UMH
ME Range: 32
Subpixel Refinement: 7
Analysis: All
8x8 DCT: No!
Deblocking: -0:-0
Trellis: 2
No Fast-P-Skip: yes
No DCT-Decimate: yes

I'm testing a newly created CRF profile in MeGUI right now and will report the findings.

chainring--thanks for offering such detailed advice! I haven't used ripbot before but I will try it with your settings and see how it compares to xvid4psp ...

blinkstar
16th October 2008, 08:55
Woohoo! Test valid; the PSP is nuts! Add 16 B-Frames to the crazy high bitrate handling and it's very impressive. Now, if there was a way to get rid of the ghosting. :)

I'm very much of a novice at this, in case you all haven't noticed yet, but I've tried all the pre-packaged psp video encoding programs out there, and the only way I was able to reduce (impossible IMO to get rid of it completely) ghosting was to use the "ghostbusters" setting on xvid4psp, which as a previous poster noted, tweaks contrast and other picture settings ...

phibertron
17th March 2009, 16:23
I have been a lot of playing around with settings to see if I can dial things into a happy medium, if thats even possible...

But what i did find interesting in my experiments was when comparing a bitrate encode of 512 against a quality encode of 22.

They both, to me, looked very accetapble, and just about identicle
Please note that I am purposely using no bframes and no cabac.
i am doing this so that my encodes of 480x272 work with both psp and the iphone/itouch

here are the settings im using for bitrate

bitrate=512
vbv_maxrate=4000
vbv_bufsize=4000
level_idc=21
bframes=0
subq=9
frameref=2
mixed_refs
partitions=all
me=umh
me_range=32
nofast_pskip
nocabac
nopsnr
nossim


Here are the settings im using for constant quality

crf=22
level_idc=21
bframes=0
subq=9
frameref=2
mixed_refs
partitions=all
me=umh
me_range=32
nofast_pskip
nocabac
nopsnr
nossim



and if you were wondering how long it took me to encode a 150 minute high action video with these settings
I did it in about an hour and ten minutes on a centrino 2 dual core 2.9ghz laptop, the lenovo t500

the one thing im still looking into, is these settings in particular


bitrate=512
vbv_maxrate=4000
vbv_bufsize=4000


I used the maxrate for the 2.1 IDC level, and one that both the PSP and iPhone/iTouch will except
The benefit of adding these is that, in comparison to CRF, and im guessing here, is that Im allowing a frame to burst to 4000
but at the same time im telling the encoder to shoot for 512
an encode of 512 not using the vbv_maxrate did not look the same as the one with it, the one with it looked so much better.
the odd part is that the file sizes were identical, which is the mystery for me...

Chengbin
17th March 2009, 17:43
I just read this thread, and WOW, PSPs have a powerful decoder in there!

I find 16 b frames unnecessary. It will slow encoding down like crazy, and if you use b-adapt 2, I don't think x264 will use more than 5 b frames.

A post in this thread said PSP only supports 3 ref frames? I find that hard to believe when it can play 20mbps videos.

I'm using an Archos 5 250GB, and it has similar decoding capabilities (I don't think it supports anything over 5mbps, although I never tried). I use this setting for my videos. I also use MVDegrain 3. Yes, I'm retarded for using some settings, but I have too much time on my hands that I don't care about using ridiculously slow settings.

cabac=1 / ref=6 / deblock=1:-1:-1 / analyse=0x1:0x131 / me=tesa / subme=9 / psy_rd=1.0:1.0 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=0 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-4 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=4 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=536 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=25000 / vbv_bufsize=14000 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

550Kbps looks fantastic on my 5. Keep in mind that my Archos has a very high quality 800x480 5'' screen, surpassing the PSP by a mile (but unforunately it also makes the price very expensive). You should get some very nice quality videos with this setting on a PSP.

For people who like a portable VIDEO player, with a insanely large hard drive and excellent H.264 support, the Archos 5 is another option.

BTW, Archos just released a firmware that allows 720p (6mbps or less) video to be played on the 5(no H.264). But you have to buy a retarded plugin for it.