Author Topic: What difference RGB and YUV and control bitrate in I;B;P frame ?  (Read 1350 times)

Offline vfx3love

  • Member
  • Posts: 9
    • View Profile
Hi everybody,

I know RGB display format for LCD PC and YUV for TV. I think if want convert video per format, can change right style ( LCD PC or TV) for better quality . I know right? Because I seen in some cmd for hight quality X264 have value avs2yuv .

Example :
"avs2yuv" "source.avs" -o - | "x264" --demuxer y4m --crf 1 --sar 3:2 --profile main --level 3.2 --ref 4 --bframes 3 --deblock -1:-1 --aq-strength 0.8 --vbv-bufsize 950 --vbv-maxrate 950 --direct auto --no-mbtree --partitions p8x8,b8x8,i8x8,i4x4 --keyint 100 --no-fast-pskip --no-dct-decimate --subme 7 --trellis 2 --psy-rd 1.0:0.0 --me umh --b-adapt 2 --no-scenecut --output "encode.mkv" - 2> "pass2.log"

And in X264 can control deep for bitrate I,B,P frame by hand? . Because I think I frame need bitrate priority for quality video more then B,P frame. I know right ?

Thank so much for help .




 
« Last Edit: April 27, 2012, 01:10:44 AM by vfx3love »

Offline nm

  • Member
  • Posts: 358
    • View Profile
Re: What difference RGB and YUV and control bitrate in I;B;P frame ?
« Reply #1 on: April 27, 2012, 02:53:04 AM »
I know RGB display format for LCD PC and YUV for TV. I think if want convert video per format, can change right style ( LCD PC or TV) for better quality . I know right?

No. Both monitors and TVs display in RGB. Video is YUV because it allows chroma subsampling and therefore higher compression at about the same visual quality.

Just encode as YUV unless you really know that RGB is the right choice for some particular application. Also note that RGB in H.264 is not supported by many decoders.

Because I seen in some cmd for hight quality X264 have value avs2yuv .

avs2yuv is a tool to run AviSynth and pipe the output to other programs. Here "2yuv" means "convert to raw video".

Your example command line is apparently several years old since it doesn't use presets. Or it was just written by a moron, as implied by some of the settings used. Forget that line and use presets and tunings:

Code: [Select]
x264 --preset slow --tune film --crf 20 -o output.mkv input.xyz
And in X264 can control deep for bitrate I,B,P frame by hand? . Because I think I frame need bitrate priority for quality video more then B,P frame. I know right ?

x264 does that automatically. It's possible to change the QP ratios between frametypes on the command line, but the default values are good.
« Last Edit: April 27, 2012, 02:55:27 AM by nm »

Offline vfx3love

  • Member
  • Posts: 9
    • View Profile
Re: What difference RGB and YUV and control bitrate in I;B;P frame ?
« Reply #2 on: May 02, 2012, 01:26:20 AM »
Great! Thank you so much . But when I use your code : x264 --preset slow --tune film --crf 20 -o output.mkv input.xyz . It so good but I cant control bitrate and resolution ( convert MKV  HD movie 1280x720p > SD 720x576p) for my SD box player.

I want  target video+audio bitrate 2Mbps and time encoding fast more 10f/s (My CPU Core i5 2,4Ghz, Ram 4Gb ). Do you have other cmd X264 for this ? Thank so much for help .
« Last Edit: May 02, 2012, 02:01:29 AM by vfx3love »

Offline nm

  • Member
  • Posts: 358
    • View Profile
Re: What difference RGB and YUV and control bitrate in I;B;P frame ?
« Reply #3 on: May 02, 2012, 04:08:04 AM »
but I cant control bitrate and resolution ( convert MKV  HD movie 1280x720p > SD 720x576p) for my SD box player.

For downscaling, try

Code: [Select]
--vf resize:width=720,height=576,method=spline --sar 64:45
Color matrix should probably also be converted to Rec.601 for accurate playback and you'd need AviSynth for that. One alternative is to flag the video Rec.709 (--colorprim "bt709" --transfer "bt709" --colormatrix "bt709"), but many players simply assume Rec.601 for SD.


I want  target video+audio bitrate 2Mbps

Why? CRF is good for you, really!

If you insist on deciding a bitrate yourself, it's quite simple:

Code: [Select]
x264 --preset slow --tune film --bitrate 1500 --pass 1 -o NUL input.xyz
x264 --preset slow --tune film --bitrate 1500 --pass 2 -o output.mkv input.xyz


and time encoding fast more 10f/s

If you resize to 576p, encoding will be twice as fast. You can also use faster presets: --preset medium (which is also the default if you don't set a preset) or --preset fast

If the problem is that x264 doesn't saturate the CPU fully (some cores have low load during encoding), you can either run multiple encodes at once or try to find the bottleneck. In your case this is probably not a problem unless you start using AviSynth and heavy filters.

Offline AnonCrow

  • Member
  • Posts: 36
    • View Profile
Re: What difference RGB and YUV and control bitrate in I;B;P frame ?
« Reply #4 on: May 02, 2012, 04:11:45 AM »
my SD box player.
You're probably going to want to check what H.264 profiles and levels that box claims it supports - if it lists any. (educated guess : level 3 or 3.1)

Quote
I want  target video+audio bitrate 2Mbps
Stupid question - why ?

Quote
time encoding fast more 10f/s (My CPU Core i5 2,4Ghz, Ram 4Gb ).

Use a faster preset till you get the desired speed. http://mewiki.project357.com/wiki/X264_Settings#preset

Quote
Do you have other cmd X264 for this ? Thank so much for help .
http://mewiki.project357.com/wiki/X264_Settings#resize

Offline vfx3love

  • Member
  • Posts: 9
    • View Profile
Re: What difference RGB and YUV and control bitrate in I;B;P frame ?
« Reply #5 on: May 02, 2012, 06:31:22 PM »
Thank so much for help nm and AnonCrow .