Log in

View Full Version : Highest Possible Quality for PS3


Razuvious
19th April 2009, 18:00
I'm trying to encode some of my DVD's so I can play them on my PS3. I was just wondering if the Standalone x360/ps3 profile works and what settings i should change to get close to no loss of quality from the dvd (not worried about filesize as long as it's at least smaller than the dvd)

So far I've changed bitrate to 3000, M.E. range to 16 and subpixel refinement to 9. it's encoding now, 10 hours left so i havent gotten to see what it looks like (probably should have done test encodes lol)

LoRd_MuldeR
19th April 2009, 18:16
The only way to retain the highest possible quality is "lossless" mode (--qp 0). Anything else will inherently hurt the quality of your original source - more or less.

Anyway, 3000 kbps should be more than sufficient for SD content to look good. And with ME range 16 you are simply using the default setting ;)

More settings you may want to raise for quality include: --me umh, --trellis 2, --b-adapt 2, --b-pyramid, --mixed-refs, --8x8dct, --weight-b, --direct auto

scott1256ca
22nd April 2009, 19:51
ok, I did a search trying to find the latest high quality settings for the ps3, and there isn't much that popped up.

So... what x264 settings currently push the limit of what the ps3 can play back? I'm interested in 1080p24 video, not 720
My starting point would be the standalone-ps3-xbox profile, I guess.
I see Lord Mulder suggests trellis 2

For the hell of it, I encoded a small clip using
4 ref frames
4 b-frames
b pyramid
trellis 2

And although the clip played, I don't know how to check to see if any of the above were actually used in the clip.
The following is from the log. I can only guess at the meanings of some of them
---[NoImage] avis [info]: 1920x1080 @ 23.98 fps (2801 frames)
---[NoImage] x264 [info]: using SAR=1/1
---[NoImage] x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
---[NoImage] x264 [info]: profile Main, level 4.1
---[NoImage]
---[NoImage] x264 [info]: slice I:40 Avg QP:12.76 size:148147 PSNR Mean Y:51.80 U:53.36 V:54.37 Avg:52.34 Global:51.65
---[NoImage] x264 [info]: slice P:950 Avg QP:15.49 size: 84523 PSNR Mean Y:48.69 U:50.60 V:52.24 Avg:49.37 Global:48.28
---[NoImage] x264 [info]: slice B:1811 Avg QP:17.03 size: 44660 PSNR Mean Y:48.17 U:50.12 V:51.85 Avg:48.86 Global:47.83
---[NoImage] x264 [info]: consecutive B-frames: 1.4% 28.0% 35.1% 10.6% 18.7% 0.4% 5.8%
---[NoImage] x264 [info]: mb I I16..4: 49.5% 0.0% 50.5%
---[NoImage] x264 [info]: mb P I16..4: 40.2% 0.0% 0.0% P16..4: 36.1% 0.0% 0.0% 0.0% 0.0% skip:23.7%
---[NoImage] x264 [info]: mb B I16..4: 16.3% 0.0% 0.0% B16..8: 32.8% 0.0% 0.0% direct:20.2% skip:30.7% L0:30.9% L1:44.2% BI:24.8%
---[NoImage] x264 [info]: final ratefactor: 18.95
---[NoImage] x264 [info]: direct mvs spatial:99.7% temporal:0.3%

from megui
program --pass 2 --bitrate 11000 --stats ".stats" --level 4.1 --keyint 240 --min-keyint 480 --ref 4 --mixed-refs --bframes 4 --b-adapt 2 --b-pyramid --weightb --direct auto --subme 7 --trellis 2 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --ipratio 1.1 --pbratio 1.1 --vbv-bufsize 9000 --vbv-maxrate 48000 --qcomp 0.5 --me umh --merange 12 --threads auto --thread-input --progress --output "output" "input"

Sagekilla
23rd April 2009, 04:02
The only thing that the PS3 is restricted by is reference frames IIRC. Meaning you have to conform to L4.1 which is 4 refs max @ 1080p (Note: B-frames can be 16, but that's pointless).


Otherwise, feel free to turn on all the settings and just raise things.

HoodwILL
24th April 2009, 14:54
Download MediaInfo (or GSpot) to check your file [specs].

turbojet
24th April 2009, 19:07
At 1920x1080 the limit is 4 reference frames

--min-keyint 480 should be lower then --keyint 240. --min-keyint 24 is what I'd suggest

Depending on how you plan to deliver it to the PS3: --vbv-maxrate 48000 is too high for DVD
for DVD L4.0 which has a maximum of --vbv-bufsize 25000 --vbv-maxrate 25000 is safe

If you don't care about size but only about quality --crf 18-22 is generally suggested.

P4x4 and --psy-rd 1.0:0.2-0.5 aka psy-rd 1.0 and psy-trellis 0.2-0.5 can keep some nice details that are otherwise lost.

Sagekilla
25th April 2009, 01:44
@turbojet: That's no longer true. x264 used to require the use of --ref 3 with --b-pyramid but a while back it was adjusted so that you can use 4 refs without issue.

I'd have to do a search on git but if you look around it's there (I think).

edisurfer
2nd May 2009, 00:35
The only thing that the PS3 is restricted by is reference frames IIRC. Meaning you have to conform to L4.1 which is 4 refs max @ 1080p (Note: B-frames can be 16, but that's pointless).


Otherwise, feel free to turn on all the settings and just raise things.


Depending on how you plan to deliver it to the PS3: --vbv-maxrate 48000 is too high for DVD
for DVD --vbv-bufsize 25000 --vbv-maxrate 25000 is safe


Correct me if I'm wrong, but the only difference between L4.1 and L4.0 are the VBV parameters, right?? And if so, using L4.1 and then clipping the VBV seems to be easier done by just setting the level to 4.0 ... right??

From my own encodings for the the PS3 I know it'll do L4.0 (which also allows 4 ref @ max 1080p resolution). Which is why I just set the level to L4.0 and I'm done ... am I missing something?

I also agree that adding max b-frames and max-everything else usually increases compression time without giving me any valuable increase in quality. Is that what you've found also Sagekilla?

Comatose
3rd May 2009, 00:18
AFAIK --level is just a flag x264 sets, it doesn't really care about anything else. So no, you have to manually set the VBV arguments if you want VBV.

kemuri-_9
3rd May 2009, 04:38
AFAIK --level is just a flag x264 sets, it doesn't really care about anything else. So no, you have to manually set the VBV arguments if you want VBV.

actually x264 checks the given parameters against the level you specify and will warn you if you violate the level you specified.

not specifying a level causes x264 to cycle through levels to get the first valid level to set the stream flag with.

turbojet
4th May 2009, 07:20
@turbojet: That's no longer true. x264 used to require the use of --ref 3 with --b-pyramid but a while back it was adjusted so that you can use 4 refs without issue.

I'd have to do a search on git but if you look around it's there (I think).

I remember reading a thread about it and I thought x264 devs were considering changing --b-pyramid so it doesn't affect DPB but because of an efficiency issue they never did.

The real test I guess is trying it in BD players and see what happens, I'll give it a try again.

edisurfer
4th May 2009, 18:04
actually x264 checks the given parameters against the level you specify and will warn you if you violate the level you specified.

not specifying a level causes x264 to cycle through levels to get the first valid level to set the stream flag with.

And the level specific settings include the VBV parameters. So by just using --level 40 gets me VBV compliant files AFAIK.


The real test I guess is trying it in BD players and see what happens, I'll give it a try again.

Testing is the biggest headache! From what I know, BD will play L4.1 and below, but European STBs only decode L4.0. That's why marking everything as L4.1 could limit playback, if you care about playback on both. But I haven't been able to test this theory. PS3 is really friendly - but I tried a bunch of formats (TS, M2TS, even AVCHD) on BD and couldn't get any of my files to playback :confused:

kemuri-_9
4th May 2009, 18:45
And the level specific settings include the VBV parameters. So by just using --level 40 gets me VBV compliant files AFAIK.

the 'parameters' that are checked are the following
1. video resolution (# of macroblocks)
2. DPB size (# of ref frames at video resolution)
3. maximum bitrate (VBV maxrate)
4. CPB (VBV bufsize)
5. MV range
6. interlaced state (several levels don't allow interlacing)
7. FPS rate (# of macroblocks per second)

so specifying --level X will check your parameters and video against the level settings and throw a warning if you violate any of them.

turbojet
5th May 2009, 06:44
@turbojet: That's no longer true. x264 used to require the use of --ref 3 with --b-pyramid but a while back it was adjusted so that you can use 4 refs without issue.

I'd have to do a search on git but if you look around it's there (I think).

You are right 4 reference frames with b-pyramid at 1920x1080 plays fine in a Panasonic BD30

Testing is the biggest headache! From what I know, BD will play L4.1 and below, but European STBs only decode L4.0. That's why marking everything as L4.1 could limit playback, if you care about playback on both. But I haven't been able to test this theory. PS3 is really friendly - but I tried a bunch of formats (TS, M2TS, even AVCHD) on BD and couldn't get any of my files to playback

The only difference between 4.0 and 4.1 is max bitrate, 25 vs 62.5 mbps. Unless 25 mbps+ average bitrate L4.0 should probably be followed at least I don't think you'll ever notice a difference from using L4.1. Muxing AVCHD\BD is another variable though but we've found out that AUXDATA directory plays a big role as well as whether the bdmv headers are version 100 or 200 and if IDEX is present.

And the level specific settings include the VBV parameters. So by just using --level 40 gets me VBV compliant files AFAIK.

It would be nice if this was the case but like kemuri-_9 says it only gives a warning and continues to hardcode L4.0 into the stream. Personally I think instead of x264 warning it would be much better if it enforced the maximum if --level is uesd and surpassed or in vbv case not specified.

edisurfer
8th May 2009, 05:56
Wow! Thanks for the clarifications, I had thought that x264 sets VBV according to the --level directive.

So, given that the default is 0 ... so what does x264 do if I don't specify it but only specify the level??

Actually, maybe I should start another thread on trying to clarify that ...

J_Darnley
8th May 2009, 11:40
x264 will set the level flag and then proceed to encode without VBV limits

m3mbran3
27th June 2009, 05:35
I don't have much experience with HD quality but I have been doing some DVD -> x264 rips for playback mainly on PC but I decided to test them on my ps3 as well. I found that the ps3 had no trouble playing back any of the files which were all encoded using the dxva, standalone and unrestricted presets.

Below is the file details from mediainfo on a file encoded with the unrestricted crf 20 extra quality setting. You can see that is has 8 ref frames and b-pyramid, which apparently mean the file shouldn't play back. I'm not sure if the latest system updates have improved the ps3's decoding capabilities or if it is different for true HD quality.


General
Complete name : C:\Freaks\ep1\pass2.mp4
Format : MPEG-4
Format profile : JVT
Codec ID : avc1
File size : 521 MiB
Duration : 47mn 9s
Overall bit rate : 1 543 Kbps
Encoded date : UTC 2009-06-19 16:17:12
Tagged date : UTC 2009-06-19 16:17:12

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 8 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 47mn 9s
Bit rate mode : Variable
Bit rate : 1 541 Kbps
Maximum bit rate : 3 623 Kbps
Width : 704 pixels
Height : 480 pixels
Display aspect ratio : 4/3
Frame rate mode : Constant
Frame rate : 23.976 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.190
Stream size : 520 MiB (100%)
Writing library : x264 core 67 r1169M ab85c9b
Encoding settings : cabac=1 / ref=8 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=8 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=1541 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00
Encoded date : UTC 2009-06-19 16:17:12
Tagged date : UTC 2009-06-19 17:26:30

nm
27th June 2009, 11:31
Below is the file details from mediainfo on a file encoded with the unrestricted crf 20 extra quality setting.
Encoding settings [...] rc=2pass / bitrate=1541
Doesn't look like CRF.

You can see that is has 8 ref frames and b-pyramid, which apparently mean the file shouldn't play back.
That's within L3.1 limits. Bitrate could get too high in some cases (not in this file) since you didn't use VBV but PS3 might not care.

m3mbran3
27th June 2009, 14:33
sorry should have posted my complete x264 script. Basically a 2 pass crf encode, so first pass crf 20 and then 2nd pass the bitrate of whatever the first pass was. I tested just a 1-pass crf encode on the ps3 and that worked fine too.

nm
27th June 2009, 14:55
You should set VBV parameters in the second pass. Otherwise there's no reason to do a second pass at all.

kemuri-_9
27th June 2009, 22:49
Below is the file details from mediainfo on a file encoded with the unrestricted crf 20 extra quality setting. You can see that is has 8 ref frames and b-pyramid, which apparently mean the file shouldn't play back.

no, you have an SD encode with 8 ref frames, i believe that comes out to requiring level 3.1 or so from the DPB requirement.
you only did 3 bframes and b-pyramid which is what the blu-ray standard profile has as well iirc.
so your encode should work on the ps3 or you broke something in the process.

and as your bitrate is fairly low, i seriously doubt you reached the CPB limits for the level x264 chose for the encode,
so even without the VBV it works fine as well.