VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    Hello everyone

    Ok. Here's the goal, using x264 cli and xvid codec of choice. These would be for computer display.

    In a tool I'm working on, I've created a group of bottons for encoding videos: [s:83f59d1955]lossless[/s:83f59d1955]; near lossless; high quality compression

    The problem is with setting up the params for each of the (above) encodes. What I want to do is start out with a more or less standard setup for each of the encodes, fine tune them, and attach them to thier respective buttons. Basicallly, I want to start *fresh* with these codecs and get it right!

    I've search around for various examples, but in the all the example scripts and things, it was never clear what level of video was actually being encoded. So I'm pretty stuck with what is the right way to set these params in x264 and xvid. Later, I want to be able to jump back n forth between the two codecs to compare them or just to encode different formats for distribution or whatever ... sometime I wanna see what it would look like in xivd or vis.versa.

    Could someone/anyone (the more the merrier) please set me staight in the codec encoding preporation for each, I would be greatful. And maybe fine tune them here and possibly review the results with you as I move along in this endeavor.

    I know about the x264 cli, and I use it very often and throw a lot of script examples at it, but I never really have the proper encoding terminology for each type. In a best gestimate, they are just, "oh, high quality, I guess" encodings. I want to set that record straight. Also, I'm not familiar with the xvid encoding via command line tool. I think there is one through the avenue of ffmpeg/mencoder. I would be greatful for setups for this codec, too.

    Thanking you all in advanced for your assistance in this request.

    -vhelp 4888
    Quote Quote  
  2. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    You cannot encode with either of those codecs and get lossless compress. Both are, by nature, lossy. The closest you will get to lossless is Constant Quantisation encoding with a setting of 1, which should be very close to visibly identical, however the file size is likely to increase over the original unless the original was uncompressed. Xvid will certainly be larger, and is likely to still show blocking and banding artifacts in areas of low tonal range and night scenes.
    Read my blog here.
    Quote Quote  
  3. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    x264 has lossless encoding.

    find an app with templates.
    all the hard work already done for you,
    like megui.


    tripp
    "I'll give you five dollars if you let me throw a rock at you"
    Quote Quote  
  4. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    Thank you for your comments. And sorry for the confusion. The subject was prob a bit missleading.

    Yes, I know it is a lossy format to begin with. I Think I was asking for "lossless" in the wrong way, however.

    What I was asking for in the "near lossless" had to do with respect to the advanced compression settings.. no b-frames and so on, consiquentially approach that near lossless I was vaguely asking about. Sort of like what you get with MPEG-2 when you set it to I-Frame only encode. You get near lossless quality though plus the mpeg compression format.. just not all the B/P frame that make up the total compression, hence lossy or much more lossy

    I am considering the 480x360 (not to mistake that for youtube purposes) resolution as part of my ongoing testing with these codecs while I research the near lossless aspects. I was pretty comfortable with these on my humble 1024x768 computer display, aspect ratio-ly speaking. And in the cases where i'd have a widescreen, those I would bring out as 640x360, of course!

    Later, I'll throw up what I'm testing at the moment. But for now, I'm looking for the right way or recommended way of near lossless encodes on mp4's.

    -vhelp 4889
    Quote Quote  
  5. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    I missed the last poster's response while I was typing this one.

    I'm running these tests on my win98 computer. I can't think of any aps without .NET or min of win98SE support these days. Also, those apps do not answer my question. They only have (as you say) profiles and you load them up and sneak a peak at the param strings. I'm looking for definitive answers.. what's the recommended way of setting up an near lossless encode ?

    Looks like I will continue searching google, etc. for these and more answers. Thank you.

    -vhelp 4890
    Quote Quote  
  6. Here's my scale:

    Xvid near lossless: target quantizer 2, no b frames
    Xvid watchable quality: target quantizer 3, 1 b frames
    Xvid low quality: target quantizer 4, 2 b frames

    X264 near lossless: CQP or CRF, q=18, no b frames
    X264 watchable quality: CQP or CRF, q=22, 1 b frames
    X264 low quality: CQP or CRF, q=26, 2 b frames
    Quote Quote  
  7. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    jagabo, thank you I will try them out.

    I have a few that I was using myself. And, I was surprise at the attempt of *near lossless* compression I was getting from my 9000 CBR bitrate mpeg-2's.

    I'm hoping that my near lossless (NL) can be improved upon and reduce the final filesize further.

    I want to bring that filesize down further through fine-tuning the params if possible. All still under the idea of near lossless setup. Course, I'll have to create a front-end to read in a few bitmap images and process them for comparison purposes. I'll prob write something up bare bones or basic real quick to do easy counting of pixels and other things, though PSNR (the equation and setup) scares me abit. I'd love to have that in my tool, however. This is getting me excited, now.

    I will try out those suggestions posted here and compare with what I already have. I will report some results when I finish them.. doing them now as we speak..

    Thanks for your contribution to this endeavor of mine. I hope to give something back to all this cause

    -vhelp 4891
    Quote Quote  
  8. "Near lossless" is very subjective and cannot be quantified, unlike "lossless."

    PSNR and SSIM have become less useful with the recent x264 builds that feature psy-optimizations (psy-rdo and psy-trellis). Often they predict "better quality" but the eyes show something completely different. This has been discussed thoroughly @ Doom9 forums.

    x264 has many settings that may provide great encodes for 1 genre but not so good for another (eg. grainy source vs. anime). So a "swiss army knife" single setting will not work very well. The same setting might make 1 type of video look good, but actually make the other type worse. You will need several profiles for optimal encodes for "near lossless"

    Any head-to-head comparison should use the same bitrate/filesize (so you should use 2pass instead of const. quality mode). Some tweaks & settings will actually increase the bitrate (maybe only for certain sections), or redistribute the "bits", thus giving the perception of more quality.

    Do you care about encoding time? There are many settings you can tweak, some are "insane" and take 10x (or longer) with minimal quality gains. There is a huge continuum of quality...So it will depend on your definition of "near lossless"...again very subjective

    Here are some "insane" settings @ crf18 that will take about 7-8 days for you to encode a regular SD movie on your XP1800+ system. (You can change the crf value lower or higher if you want more/less quality; these settings assume you are using a recent x264 build with AQ, psyRDO, psyTrellis). You can cut the encoding time down to ~1 day if you use "normal HQ" settings, and you probably could hardly tell the difference - again the subjective "quality" continuum

    Code:
    cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x113 / me=tesa / subme=7 / psy_rd=1.0:1.0 / brdo=1 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-4 / threads=1 / nr=0 / decimate=0 / mbaff=0 / bframes=16 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / bime=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=crf / crf=18.0 / qcomp=1.00 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=2:1.00
    as 45Tripp suggested, all this hard work has already been done. You should consider upgrading your PC/OS.
    Quote Quote  
  9. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    x264 has many settings that may provide great encodes for 1 genre but not so good for another (eg. grainy source vs. anime). So a "swiss army knife" single setting will not work very well. The same setting might make 1 type of video look good, but actually make the other type worse. You will need several profiles for optimal encodes for "near lossless"
    Don't let my inquires fool you. I assure you, I realize all of this, though I'm still new to H264 and its many benefits, features, and video enhancements, etc. Theres so much talk about these days that you just got to ask the dumb questions anyways if just to clarify some points, etc. I realize that I may need to apply more than one "profile" to a each video because they are not all alike, nor consistant. But I was hoping that there was a basic starting point. For instance, in mpeg, if you want near lossless, or close to the source, you would encode as I-Frame only. To further that, you would use advance techniques to (hopefully) take that a little further, by manipulating the GOP's and Quantations matrices, etc. Again, not every video will fit the same criteria setup for mpeg as well. But the i-frame is the basic starting point. I'm looking for that in the H264 codec.

    So far, it looks like --qp 0 and a few other param settings are what I am looking for for a starting place, in terms of similariies with the mpeg's i-frame only aproach for near lossless.


    Do you care about encoding time? There are many settings you can tweak, some are "insane" and take 10x (or longer) with minimal quality gains. There is a huge continuum of quality...So it will depend on your definition of "near lossless"...again very subjective
    Thank you. Understood. And time is not so important in certain situations. I prefer quality over speed. Thats why I stuck with TMPGenc all these years.. I know how to tweak it in my favor and love the results.

    . . .

    I think that the hardest part of all this h264-ing around is with keeping in touch/order with all the param features it entails.. and how to use them in *many* segmented situations. That's why I want to look into ZONE-ing. I have'nt figured out how to set that up for segmented scene encoding. But that's also on my list of things to figure out.

    . . .

    all this hard work has already been done. You should consider upgrading your PC/OS.
    I know that, thank you.

    The problem with the hard work already figured out is that its hard to find the exact answers you're looking for and weld it into your knowledge of h264 encoding -- its not spelled out. Profiles are nice if you're a user looking for an already built product and don't care so much for the inside wiring know-how. I am a lowly tool developer. I write basic front ends to various command line tools for my own personal use. So from my point of view someone else's profile is not enough w/out explanation of each param usage for that profile.

    I will continue researching all that I can on h264 encoding. I've been at this for prob a year or so, on and off when the is available. Anyway. I am in the middle of my usual searching around for info and also testing various encodes with what I have learnt so far.

    Everyone has been a big help, thanks to you all for your contribution.

    -vhelp 4892
    Quote Quote  
  10. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    I think I have what I was looking for in this quest:

    --qp 0 followed by a few other parameters was what I was looking for as a starting place in x264 encoding for near lossless.

    If I have any more question, I'll drop by again. Thanks again to everyone to chipping in with all your advice.

    -vhelp 4893
    Quote Quote  
  11. Member
    Join Date
    Dec 2004
    Location
    Triptonia
    Search Comp PM
    -qp 0
    is lossless.

    you don;t have to actually run megui to check into the profiles..

    seems like a fair starting point,
    you could always search specific profiles to see if a discussioin turns up.

    for setting defs,
    go to the official help,
    or run through death the sheeps, vfw guide,
    or digital-digests guide (?)


    tripp
    "I'll give you five dollars if you let me throw a rock at you"
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!