On migrating to AVC/H264

Discussion in 'Amateur Video Production' started by Ken Maltby, Jul 7, 2006.

  1. Ken Maltby

    Ken Maltby Guest

    I thought a thread like this might be of some general
    interest. Basically I'll try to provide a description of my
    progress and lessons learned along the way.

    A little on why I'm moving my video to AVC/H264,
    (more detail latter if asked for).

    The main attraction, for me, was that this is a format
    that can archive my current standard definition video
    and can also handle HD material well. The same can be
    said for MPEG2, but AVC allows for much smaller files,
    at a given quality of video.

    The various Profiles (Baseline, Main, and High - plus a
    number of offshoots) and Levels, as well as features that
    can be implemented (or not) within the format, like GME,
    CABAC, and Qtr Pixel; make it useful in almost any
    environment. The encoding can be tailored to many
    devices and uses.

    AVC also allows for/supports, playback optimizations
    to form a bigger part of the overall quality of the displayed
    video. This can mean a greater demand on the playback
    device, when all the goodies and/or HD is involved. You
    will want a fairly up to date system, to take advantage of
    all the playback features. (Both ATI and Nivida have some
    hardware acceleration for AVC, and are working on more.)
    These playback options allow AVC to out perform XviD or
    DivX at the same compression setting.

    Timing is another factor, the right tools are either out of beta
    or just about there. The new TMPGEnc 4.0 XPress encoder
    does a great job implementing Main Concept's AVC encoder.
    Elecard (a branch of Main Concept, now) has it's codec pack
    and a "Mobile Converter" program for AVC. Cyberlink's
    PowerEncoder AVC, was a major disappointment, but shows
    that the industry is moving in the direction of AVC/H264. The
    free x264 has provided a good and stable platform for those of
    us who wanted to gain experience with the format. (It's still quite
    good, and plays well with VLC but it's not keeping up with the
    latest offerings.) The CoreAVC playback codec is a major
    addition to the field, and significantly reduces the demand on
    system resources during playback. ($20, for the Pro version
    and includes the Haali Video Renderer and the CoreAAC
    codec)

    There is also the fact that AVC/H264 was selected for both
    of the HD DVD formats. There should be considerable
    support on an ongoing basis for this format.

    The bottom line for me is that with AVC/H264 I can take
    my 1/2 D1 MPEG2 and make full D1 MPEG4, at nearly
    half the file size, that plays great on my HD projector into a
    100 inch screen. (and looks even better on my computer
    monitor)

    So that's why I'm doing it; my next post will go more into
    the process and tools that are working for me.

    Luck;
    Ken

    P.S. Let me know if there is any interest in my continuing
    with this.
     
    Ken Maltby, Jul 7, 2006
    #1
    1. Advertisements

  2. "Ken Maltby" wrote ...
    Good stuff. Thanks, Ken.
    Looking forward to additional info.
     
    Richard Crowley, Jul 7, 2006
    #2
    1. Advertisements

  3. Ken Maltby

    RS Guest

    Having discovered that Sony Vegas has the Main Concept Avc/H264 encoder
    in its latest version, I'm also planning to use this as the encoding
    method of choice for our archived/downloadable versions of our half our
    cable access show episodes.

    I was using Xvid encodes and after seeing that the free VideoLan player
    will also play the avc/h264 encodes the switch seems natural. I never
    could get Xvid encodes out of vegas to work the way I wanted, so I'll be
    switching.

    Any suggestions of tweaks for the main concept encoder for a file
    suitable for download (A 30 min program) are welcome. The Xvid encodes
    have been running me approx 200MB at 640x480, Mp3 audio.
     
    RS, Jul 7, 2006
    #3
  4. Ken Maltby

    Smarty Guest

    As always Ken, you've hit the nail squarely on the head. This thread is of
    great interest to me, and apparently others as well. I am most anxious to
    learn more about your process, and also learn if your results take a lot of
    transcoding time and produce any additional artifacts. The space savings are
    extremely compelling....


    Thanks from all of us,

    Smarty
     
    Smarty, Jul 7, 2006
    #4
  5. Ken Maltby

    Ken Maltby Guest

    Well, compression works the same for all formats, whatever
    bitrate you were using with XviD to get your "approx 200MB
    at 640x480" will do the same with AVC, but it will look a lot
    better. Or you could up the image size, and it will still look a
    little better. Or you could lower the bitrate and get smaller files
    without losing any more perceived image quality.

    What I'm doing is all the above. I lowered the bitrate ( to a
    average VBR of 1000kbps [just like PT, but I'm not calling it
    1/2 CD resolution] and I increase the image size from 352x480
    to 704x480 (with the aspect ratio set to "Display 9:16").

    But this is with settings that could choke some players, VLC
    can play it, but Media Player Classic with the CoreAVC codec
    and the Haali renderer installed does a noticeably better job.

    The settings I use in TMPGEnc 4.0 with the Main Concept
    encoder are:

    I am using a Output container type for .mp4 that 4.0 XPress
    calls "Normal". (There are also; ISMA and 3GPP compatable
    as well as ipod video and portable game console types)
    GSpot shows the result as a form of 3GPP.

    I use the "Main" profile and "Automatic" level. ( For your
    download files you might want to set a lower level, or even
    use the "Baseline" profile.)

    I use VBR with an "Average bitrate: of 1000kbps and a
    maximum bitrate of 4000kbps
    (You may prefer to use CBR or CQ, or other bitrate settings,

    I have the "Motion search range:" set to 64

    So far I'm using the default settings of:
    GOP length: 33 frames
    B frame count: 0
    Reference frame count: 1

    Quantization:
    I picture: 24
    P picture: 25
    B picture: 27

    I also use the Entropy coding mode: set to CABAC and
    Motion estimation subpel mode: at Quarter pixel

    For the Audio I am using AAC (MPEG-4 [ISO/IEC
    14496-3] Low Complexity Output format: Raw
    The bitrate and sample rate I left as it was in my source
    MPEG2.

    I am presenting these not as a recommendation but as what is
    providing me with good results, at this point. I fully expect to
    improve on my results with further experimentation.


    --------------------------------
    For a file that will be downloaded the main factor would be
    the file size, I guess, but H264 offers some additional options,
    and potential pitfalls. One is whether you should use AVC or
    an ISO MPEG H264 stream format.

    A big factor for the encoding options you select, for files to
    be downloaded, would be how they are to be used. There is
    a big difference in the settings you would use if it were destined
    for playback on an iPod or the boardroom HD projector. It
    takes a little more power than the Sigma Graphics chip used
    in most networked players has, to play AVC, but it can handle
    XviD, no problem.

    I haven't worked out the tradeoffs that would work best for
    encoding files for download or general distribution. I am still
    working within a defined local environment under my control.
    From what I've seen so far, H264 can be used to supply
    much better video at smaller file sizes, so it has some real
    potential for that use. It might take some extended
    experimentation though, to find out what features your
    audience can tolerate. For instance it might be that all you
    need to avoid using is CABAC, or the Qtr Pixel setting.

    Luck;
    Ken
     
    Ken Maltby, Jul 8, 2006
    #5
  6. Ken Maltby

    Ken Maltby Guest


    As to transcoding times;

    With the TMPGEnc 4.0 XPress it is taking right on "real-time"
    or about the same time as it takes to play the source file. ( If I
    have a number of source files being encoded at the same time,
    it is a little faster.)

    That is, about 42min. for an hour TV episode. If I use the ATI
    Avivo Video Converter I can do that same episode in 8min., and
    it will sometimes play all right, for awhile, if I use Media Player
    Classic and the CoreAVC codec (It crashes VLC). If they were
    to improve it a little and allow access to the codec's property page
    it could be a great encoder.

    If you have an ATI vid card (it doesn't need to be an Avivo model)
    Google for the "Avivo Video Converter 1.12" download, and give it
    a try. Too bad it's not ready for prime time.

    I'm trying to get it working using GraphEdit, but so far it only
    does real-time that way. I may have a couple of wrong filters
    in the graph I've been trying, so I need to find time to try again.


    Luck;
    Ken
     
    Ken Maltby, Jul 8, 2006
    #6
  7. Ken Maltby

    Bill's News Guest

    Ken Maltby wrote:
    Most assuredly, and thanks for offering.
     
    Bill's News, Jul 8, 2006
    #7
  8. Ken Maltby

    Ken Maltby Guest

    Update; I got it working in GraphEdit so that it takes 6-7min. to
    convert a 42min. MPEG2 file. Having access to the encoder's
    property page will let me track down a couple of gliches that still
    remain. Right now the graph is as simple as possible, so I have a
    base position to work from.

    ---------------------------------
    It is:
    <File Source (Async)>
    <MPEG-2 Splitter> {My source is MPEG-2}
    <ATI MPEG Video Decoder>
    <ATI MPEG Audio Decoder>

    (Here is where I'll try the Noise filter and Scaler)

    <ATI MPEG Video Encoder> {check property page}
    <ATI MPEG Audio Encoder> {check property page}

    <ATI MPEG Multiplexer> {Set output wrapper}
    <ATI MPEG File Writer>
    -----------------------------------------

    So I've got 6-7min. transcodes working and am trying
    to map out stable configurations that work with my
    various players. My last was working fine in VLC (which
    used to crash) but is now not showing up with CoreAVC
    in Media Player Classic. Getting the "Generic MP4"
    wrapper to work is becoming more problematic than
    using the AVI wrapper. Much more experimentation to go.

    Luck;
    Ken
     
    Ken Maltby, Jul 8, 2006
    #8
  9. Ken Maltby

    RS Guest

    Thanks, that exactly what I was looking for. I just happen to be at the
    point to put a new half hour episode of our show up this next week at
    the same time as I distribute it to the access stations in the area. My
    assumption will be desktop viewing and I steer people to the VLC player
    to head off the 'how do I play this on my computer' questions.
     
    RS, Jul 10, 2006
    #9
  10. Ken Maltby

    RS Guest

    Apparantly I need to break down and look into this GraphEdit
    program....That is a massive time savings.
     
    RS, Jul 10, 2006
    #10
  11. Ken Maltby

    Ken Maltby Guest

    Update: The 6-7 min. transcode results aren't too stable
    and seem to be a little blockier than a normal (real-time)
    transcode, I suspect that it is using the least of the features
    available. The ATI MPEG Video Encoder property page
    offers no option to set Qtr Pixel, CABAC or some other
    fine tuning. It does offer some though, just not those I know
    to have a real impact. There is a "Quality:" slider that I left
    at 75% (guessing, there is no numeric readout). I have no
    idea what it does. I'll be experimenting with that soon.

    I added a filter from Elecard that lets me crop and/or resize
    the video frame buffer before I feed it to the ATI encoder. I
    also added "MatrixMixer" to the audio chain of filters. This
    seems to have increased (doubled) the encode times to 14min.
    It may have improved the stability of the results some though.

    So far, I am still using TMPGEnc 4.0 XPress even though
    it is encoding at just a little under or at real-time, for all but the
    testing/experimenting with GraphEdit. Its results are enough
    better and the ability to add sufficient files to keep it working
    overnight (with or without using the separate batch feature)
    fits my workflow well enough that I'll keep using it for now.
    For most of my captures, I can edit a couple hours of TV with
    VideoReDo in ten minutes or so, then go do something else for
    an hour and a half while it gets transcoded in TMPGEnc 4.0.
    That can take care of the current captures. The overnight
    batch processing is for converting all my collected video.

    I also am working with the XML version of a saved graph
    and it looks to be usable. I don't know if I will work up the
    energy to try and write something in C# to allow batch
    processing through GraphEdit. ( I doubt it.)

    Luck;
    Ken
     
    Ken Maltby, Jul 12, 2006
    #11
  12. Ken Maltby

    Ken Maltby Guest

    Tip:

    Stumbled on this Guide by "DeathTheSheep" at Doom9.

    http://gabe.5000megs.com/guide/DeathTheSheep_x264_VfW_guide.pdf

    If you use the free x264 codec with VDub or one of the
    TMPGEnc encoders ( or any program that uses VfW)
    following this guide could dramatically improve your
    results. It has been updated not too long ago, and I
    like how he provided a good explanation of the factors
    involved, as well as providing settings to use. In most
    cases he provided a range with explanation of when it
    would be worth using the higher or lower setting.

    You might want to use "Save target" on that link.

    Luck;
    Ken

    P.S. RS; this might give you some better luck with x264.
     
    Ken Maltby, Jul 15, 2006
    #12
  13. Ken Maltby

    Ken Maltby Guest

    -------------------
    Update:
    I'm getting faster encodes and good quality
    with the B frame count: 3
    Reference frame count: 4
    ---------------------
     
    Ken Maltby, Jul 16, 2006
    #13
  14. Ken Maltby

    Ken Maltby Guest

    Strictly following his guidelines and using all the quality
    improving settings (including "adaptive" that let me push the
    encode into the High Profile range) almost doubled the
    encode time. [That is to be expected with such settings.]
    So you might want to go a little easy with some of those
    settings. (It's well explained in the guide, which settings
    will effect encoding speed.) The results look pretty good
    though.

    Funny thing is, when I applied what little I could of the
    guide to the MediaConcept codec as implemented in
    TMPGEnc 4.0 XPress (see my update to an earlier post
    that listed those settings.) it actually speeded up the encode
    a little, and gave me a smaller file. It looked as good or
    maybe a little better, than with my initial settings. Anyway I
    didn't notice any difference.
    /Ken
     
    Ken Maltby, Jul 16, 2006
    #14
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.