Log in

View Full Version : settings for BD9 (Blu-ray compliant HD stream on DVD9)


Pages : 1 2 [3]

Sagekilla
10th January 2009, 06:15
1) no fast pskip increases quality but the slowdown is extremely large for a miniscule increase in quality.
2) dct decimate will zero out blocks that are almost completely empty. Turning off dct decimate (--no-dct-decimate) will give -very- little quality gain and eats up a lot more bits.
3) Level doesn't matter for the most part. It's only when encoding for compatibility does this really matter.
4) See audio forums
5) Using --b-adapt 2, the most benefit you'll get is with 3 - 4 B-Frames. For reference frames, calculate using: ref = 8294400 / (width * height). For 720p footage --> ref = 8294400 / 921600 = 9 refs

alc0re
10th January 2009, 06:23
So I can safely turn up my reference frames to 9 and my panasonic bd35 should still be able to play this just fine yes? EDIT : Just read that for a given level there is a max number of reference frames for that resolution. What is the max number of reference frames for high@level 4.0? EDIT AGAIN : Looks like 9 is max for level 4.0 if the website I just checked is correct. But turning it up to 9 would add a whole lot of encoding time I'm assuming. What's a good "sweet spot"? Currently using 4... I'm assuming more reference frames = better compressibility, which equals better quality for a given constant bitrate?

Thanks for such a quick answer by the way. One more question....

I tried reading about Psy-RD but i don't understand what exactly its doing and what the pros/cons of using it are. is it one of those settings that should be changed depending on the type of movie? if it is I might just leave my profile as is...I just want a profile I can throw movies at and not have to change it every movie.

Sagekilla
10th January 2009, 06:39
For refs: Yes, I'm not sure what resolutions and frame rates are properly supported by a SAP like your Panasonic BD35, but as long as you use that formula (for Level 4.1 profiles, which just about all hardware players are) you'll be able to correctly calculate the max refs. Note, you get diminishing returns very quickly with refs. Beyond 4 or 5 refs for HD video, there's not much more benefit. With the exception of anime, where up to 16 refs -can- be used frequently, more than 4 refs tends to be overkill.

Psy-RD and AQ are psychovisual algos, meaning that they don't try to optimize the video for highest psnr at a bitrate, but instead work on trying to make the video look "good" to human eyes. What we perceive as looking good may be considered a bad choice (psnr wise) to the encoder.

With AQ, x264 tries to vary the quants within a frame for each MB. It tends to strip bits away from extremely complex areas where our eyes won't notice a huge difference, and give it to the relatively simple areas. This helps prevent you from getting a blocky mess on those flat areas like a uniformly featured sky, or a dark wall in a movie scene, etc.

As for Psy-RD, it works on a principle of trying to get the encoder to make a decision that will provide an output that has a similar level of detail to the input, even if it's not necessarily correct. Simply put, it makes the encoder favor sharpness over blurriness. Blurry output tends to be more PSNR optimal, whereas sharper output hurts PSNR (one of reasons why turning on AQ/Psy-RD makes PSNR/SSIM decrease.)

I'm simplifying things a bit, but that's more or less a generalized idea of what's going on.

alc0re
10th January 2009, 06:52
How does my new profile look to you?

program --pass 2 --bitrate 8040 --stats "E:\Applications\x264 Log" --keyint 24 --min-keyint 2 --ref 5 --mixed-refs --no-fast-pskip --bframes 4 --b-adapt 2 --b-pyramid --weightb --direct auto --subme 9 --trellis 2 --psy-rd 1.0:0.5 --partitions all --8x8dct --qpmin 8 --ipratio 1.1 --pbratio 1.1 --vbv-bufsize 25000 --vbv-maxrate 25000 --qcomp 0.5 --me umh --threads auto --thread-input --aud --progress --no-psnr --no-ssim --output "output" "input" --mvrange 511 --aud --nal-hrd --sar 1:1

I realize that 5 reference frames might be overkill and I kept on --no-fast-pskip, which will both increase my encoding time, but I don't think I'll mind that much the increase in encoding time. I've got a quad core and I'm not in a rush as long as its not taking a full day...

Out of curiosity...do you use --psy-rd on your encodes? What level?

alc0re
12th January 2009, 05:47
Could using b-pyramid be causing stuttering in my bluray to BD9 encodes when played on my sap? (panasonic BD-35)

Esurnir
12th January 2009, 05:55
Could using b-pyramid be causing stuttering in my bluray to BD9 encodes when played on my sap? (panasonic BD-35)

I used the commandline posted before :

"%x264_PATH%" --pass 2 --bitrate %DESIRED_BITRATE% --stats "%WORKING_DIRECTORY%\%OUTPUT_FILENAME%.stats" --level 4.1 --keyint 24
--min-keyint 1 --ref 3 --mixed-refs --bframes 3 --b-adapt 2 --b-pyramid --weightb --direct auto --deblock -1:-1 --subme 7 --trellis 2
--partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --vbv-bufsize 30000 --vbv-maxrate 24000 --qcomp 0.5 --me umh --merange 24 --threads auto
--thread-input --sar 1:1 --progress --no-psnr --no-ssim --output "%WORKING_DIRECTORY%\%OUTPUT_FILENAME%-output.h264"
"%INPUT_VIDEO%" --mvrange 511 --aud --nal-hrd

And it worked perfectly including the b-pyramid.

No hickup whatsoever, the movie was fluid (1080p movie).

I got a sony SAP can't remember the model (not ps3)

R3Z
12th January 2009, 06:00
Thanks for the answers Sagekilla :). Even though i knew how to use x264 and get the best out of my encodes - its been a while since i have done them and so much has changed.

alc0re
12th January 2009, 06:19
yah i'm just gonna have to play around with different settings...using ripbot264 my encodes play smooth as butter...but using megui with ryu's avchd profile and muxing myself with tsmuxer it stutters a bit. could be my sap i guess.

alc0re
14th January 2009, 06:38
Would you guys recommend using UnDot() in my avisynth avs script? I'm transcoding from 1080p bluray source to 720p BD9...I'm leaning towards not using it...but I would prefer a logical/intelligent answer/observation as why to use or not use it...thanks.

PS...almost all my encodes are at least 7-8k bitrate range...with the exception of a few long movies that have dts audio also...those get to around 6.5k...

R3Z
14th January 2009, 09:07
Would you guys recommend using UnDot() in my avisynth avs script? I'm transcoding from 1080p bluray source to 720p BD9...I'm leaning towards not using it...but I would prefer a logical/intelligent answer/observation as why to use or not use it...thanks.

PS...almost all my encodes are at least 7-8k bitrate range...with the exception of a few long movies that have dts audio also...those get to around 6.5k...

Undot() is relatively harmless. You probably wont even notice what it removes bar the final compression size.

rack04
14th January 2009, 14:42
5) what's the max number of b frames and reference frames I should be using for a BD9 on a panasonic bd35 bluray player?

I use 3 for both.

How does my new profile look to you?

program --pass 2 --bitrate 8040 --stats "E:\Applications\x264 Log" --keyint 24 --min-keyint 2 --ref 5 --mixed-refs --no-fast-pskip --bframes 4 --b-adapt 2 --b-pyramid --weightb --direct auto --subme 9 --trellis 2 --psy-rd 1.0:0.5 --partitions all --8x8dct --qpmin 8 --ipratio 1.1 --pbratio 1.1 --vbv-bufsize 25000 --vbv-maxrate 25000 --qcomp 0.5 --me umh --threads auto --thread-input --aud --progress --no-psnr --no-ssim --output "output" "input" --mvrange 511 --aud --nal-hrd --sar 1:1

I realize that 5 reference frames might be overkill and I kept on --no-fast-pskip, which will both increase my encoding time, but I don't think I'll mind that much the increase in encoding time. I've got a quad core and I'm not in a rush as long as its not taking a full day...

Out of curiosity...do you use --psy-rd on your encodes? What level?

You need to lower the --min-keyint to 1 since your max bitrate > 15 Mbps.

Could using b-pyramid be causing stuttering in my bluray to BD9 encodes when played on my sap? (panasonic BD-35)

My BD-35 plays just fine with b-pyramid.

alc0re
14th January 2009, 17:27
what does the keyint value do? Could that be the reason my video is stuttering? Still trying to narrow my issue down...

rack04
14th January 2009, 17:36
what does the keyint value do? Could that be the reason my video is stuttering? Still trying to narrow my issue down...

What media are you using? What program are you using to burn the blu-ray output? Are your enabling "Change fps:" with the value of 24000/1001 in tsMuxeR?

alc0re
14th January 2009, 17:45
My process...

eac3to to rip tracks...

megui to transcode video...

suprip for ocr'ing the subtitles...

tsMuxer to mux to bluray output...tried both with and without changing the fps to 24000/1001

usually burn to dual layer verbatim, but until i figure this out i've been buring to a single layer.

question though : in my avs scripts...should I be using fps=23.976 in my directshowsource line or should I leave fps= out of that line and use assumefps(24000/1001)? the video on a bluray is 24000/1001 correct? Anyways, i've tried with both so far and still stutters. I figured out one of the issues i was having is that i had the level set to 4.1 before and just going back on some of my previously transcoded BD9s and changing it to level 4.0 in tsmuxer fixed that stutter, but there was still a slight stutter. I dont get that stuttering when I use ripbot264 and the standard bluray profile it has, but I 1) want to know what I'm doing wrong/different that's causing the stuttering and 2) need to do it not using ripbot264 for a few different reasons (not that ripbot isnt a great program.)

rack04
14th January 2009, 17:53
I can't answer you question about directshowsource since I use DGAVC/VC1IndexNV for my Blu-ray and HD DVD needs. What firmware do you have installed?

I have no playback problems on my BD35 using the following settings. However, I do have problems with FF/REW being unresponsive and slow.

1st pass
"%x264_PATH%" --pass 1 --bitrate %DESIRED_BITRATE% --stats "%WORKING_DIRECTORY%\%OUTPUT_FILENAME%.stats" --level 4.1
--keyint 24 --min-keyint 1 --bframes 3 --b-adapt 2 --b-pyramid --weightb --direct auto --deblock -1:-1 --subme 2
--partitions none --vbv-bufsize 30000 --vbv-maxrate 24000 --qcomp 0.5 --me dia --merange 24 --threads auto
--thread-input --sar 1:1 --progress --no-psnr --no-ssim --output NUL "%INPUT_VIDEO%" --mvrange 511 --aud --nal-hrd

2nd pass
"%x264_PATH%" --pass 2 --bitrate %DESIRED_BITRATE% --stats "%WORKING_DIRECTORY%\%OUTPUT_FILENAME%.stats" --level 4.1
--keyint 24 --min-keyint 1 --ref 3 --mixed-refs --bframes 3 --b-adapt 2 --b-pyramid --weightb --direct auto
--deblock -1:-1 --subme 8 --trellis 2 --partitions all --8x8dct --vbv-bufsize 30000 --vbv-maxrate 24000 --qcomp 0.5
--me umh --merange 24 --threads auto --thread-input --sar 1:1 --progress --no-psnr --no-ssim
--output "%WORKING_DIRECTORY%\%OUTPUT_FILENAME%-output.h264" "%INPUT_VIDEO%" --mvrange 511 --aud --nal-hrd

alc0re
14th January 2009, 18:02
Newest firmware...I'll try out a few more things. I'll narrow it down eventually.

And perhaps I'll try indexing the raw stream instead of using directshowsource. Thanks for your help. I'll post whenever I fix the issue if you're interested.

alc0re
14th January 2009, 18:23
Rack would you mind posting one of your avs scripts please? tia

rack04
14th January 2009, 18:38
Rack would you mind posting one of your avs scripts please? tia

Like I said previously I use DGAVC/VC1IndexNV for frame-accurate serving via an Avisynth script. These may not be useful to you unless you have a VP2 GPU Nvidia graphics card and a neuron2.net supporter.

AVC (H.264) video stream
LoadPlugin("C:\Program Files\DGAVCDecNV\DGAVCDecodeNV.dll")
AVCSource("__vid__")

VC1 Advanced Profile video stream
LoadPlugin("C:\Program Files\DGVC1DecNV\DGVC1DecodeNV.dll")
VC1Source("__vid__")

You could also use DGAVCIndex which uses libavcodec to decode the video stream. Although, this only works for AVC (h.264) video streams.

AVC (H.264) video stream
LoadPlugin("C:\Program Files\DGAVCIndex\DGAVCDecode.dll")
AVCSource("__vid__")

laserfan
14th January 2009, 19:02
How does my new profile look to you?

program --pass 2 --bitrate 8040 --stats "E:\Applications\x264 Log" --keyint 24 --min-keyint 2 --ref 5 --mixed-refs --no-fast-pskip --bframes 4 --b-adapt 2 --b-pyramid --weightb --direct auto --subme 9 --trellis 2 --psy-rd 1.0:0.5 --partitions all --8x8dct --qpmin 8 --ipratio 1.1 --pbratio 1.1 --vbv-bufsize 25000 --vbv-maxrate 25000 --qcomp 0.5 --me umh --threads auto --thread-input --aud --progress --no-psnr --no-ssim --output "output" "input" --mvrange 511 --aud --nal-hrd --sar 1:1...You've been advised to try --ref 3 and --bframes 3; have you done that yet?

alc0re
15th January 2009, 06:40
so directshowsource isn't frame accurate? (not asking about frame accurate seeking...asking about serving to x264)

Esurnir
15th January 2009, 22:13
so directshowsource isn't frame accurate? (not asking about frame accurate seeking...asking about serving to x264)

Not really about directshow source, but directshow -codec- can be frame innacurate depends which apple your picking.

However for stuttering using ref 5 bframe 4 on a 1080p break the DPB buffer of 4.1 level, so dont do it.

P.S. Keyint define the maximum number of frame between two "reference" frame, that is the frame that are "Seekable" without decoding any frame before. Blu-ray require you unless you use 15000 as your max bitrate to have 1 seconds "group of pictures" to make it easy for the blu-ray player to "seek" a particular frame. for example when fast forwarding instead of displaying randomly chosen frame the player will only display I frame so it can fast forward reading next second frame, then the other one 1 sec after it, then the other, then the other at a rate that depends on the "x time" the viewer decide, skipping any frame before the reference ones.

alc0re
17th January 2009, 08:42
Thanks for the response...

And yes I understand that 5 is too much for 1080p content, but I'm downsizing to 720p, and 5 reference frames is within spec for that size.

Anyways, if anyone is interested I figured out my issue. It wasn't related to the x264 encode settings I was using. It was an error with my avs script. I'm fairly new to all of this and was following a few different guides. All the guides I was following just had me demux the bluray streams using eac3to, and creating an avs script with MeGUI. That's where the issue came. See, the avs scripts MeGUI was creating was specifying in the same line as directshowsource the fps as being 23.976. For example : DirectShowSource("video.mkv", fps=23.976, audio=false) I'm assuming it was grabbing this information from the mkv header that eac3to writes when it muxed the video stream to mkv (altough maybe it mkv header does specify 24000/1001 because I remember a few versions back MeGUI used to specify fps=23.9760239760 etc etc.) Problem is the video on the bluray is not 23.976, but 24000/1001. I now use an avs template instead of using the avs script creator in MeGUI. In my template I don't specify the fps in the directshowsource line, and instead added another line with AssumeFPS(24000,1001). Since making that change in my avs scripts and encoding my video plays smooth as butter (well, as smooth as 22.976 fps can play...I'm still sensitive to the slight jitter from 23.976 fps film.) I feel kinda like a nub, but hey I am one. At least I figured out the issue. I kinda always wondered about that cause following the guides I found, if I did an eac3to command on the bluray directory structure tsMuxer output after transcoding, the video line always said 720p23, which was different than the original bluray (1080p24/1.001)

Anyways, thanks to all who answered all my nub questions...I really appreciate it.

moviefan
17th January 2009, 21:17
Encoding a 1080p movie for a DVD9 results in my case at a bitrate of about 5700 Kbps. Almost all scenes look very god, but some with rather little detailed flat areas show banding etc. I have already raised aq-strength to 1.5 but they still look bad. Now my question: In what direction should the options --ipratio, --pbratio and --qcomp go for rather low bitrate encodes?