h264 is amazing

A subforum for discussions about Film, TV, and Videos.

Moderators: New Moderators, Board Staff

Ornette
Administrator
Administrator
User avatar
Age: 44
Posts: 11754
Joined: Dec 26, 2005
Location: Pittsburgh/New York City
Gender: Male
Contact:

h264 is amazing

  •      
  •      
  • Quote

Postby Ornette » Mon Dec 04, 2006 6:50 pm

Got a new DVD the other day, "Melvin goes to dinner" (great movie btw), and like all the DVDs we collectively own, I encode it in HQ and put it on our video server so we can watch it on any TV in the house as well as any computer in the house. It's been a few months since I've encoded something in HQ, and since then, I've recompiled/updated mplayer/mencoder with x264 support.

Normally, I'll encode using xvid with a bitrate of 1200-1600, maximum motion vectors per macroblock, and an adaptive motion detecting daimond, using 2 passes. Takes about 2 or 3 hours on my thinkpad T60p, and the resulting file is usuallly about a gig for 2 hours. The h264 codec has adaptive bitrate as well as adaptive quantizing, so when nothing much is going on on-screen, a small bitrate is used with little quantization. Very cool stuff, but very very CPU intensive. Using 2 pass encoding (encode once generating a stats, then encode again using the stats file), 6 reference frames per motion vector calculation, and a bunch of other options that I'm not quite sure what they do but was listed in the documentation as improving quality, the result? a 570meg file whose quality was just as good as the DVD if not BETTER! Why? No interlacing! However, it did take about 14 hours to encode the 2nd pass, but the quality is amazing. I'm tempted to re-encode all our DVDs, would probably save 500 gigs of space on video server, but I bet it'll take months.

The Eva Monkey
Admin Emeritus
Admin Emeritus
User avatar
Posts: 8945
Joined: Jun 14, 2004
Location: The Evanets.
Gender: Male
Contact:

  •      
  •      
  • Quote

Postby The Eva Monkey » Mon Dec 04, 2006 7:47 pm

This is one of those very rare exceptions where I actually understand the high degree of tech nerdom.

I do hate watching that progress bar in final cut as it encodes. Especially when it says it will take 22 minutes, and then when it gets down to 11 minutes, and takes about 30 seconds.
Webmaster, EvaMonkey.com; Co-founder, EvaGeeks.org; Moderator, r/evangelion.

Follow me on Social Media! [YouTube] [Twitter] [Facebook] [Tumblr] [Twitch]

Ornette
Administrator
Administrator
User avatar
Age: 44
Posts: 11754
Joined: Dec 26, 2005
Location: Pittsburgh/New York City
Gender: Male
Contact:

  •      
  •      
  • Quote

Postby Ornette » Mon Dec 04, 2006 8:28 pm

I was simply blown away at the quality of the encode. I was aware that h264 was a superior codec as far as quality/file size ratio, but the only h264 stuff I've seen was anime, and I've read that animation is very well suited to h264. This was the first time I've seen live action in h264, it was simply stunning. Fading to black, dark corridors, low contrast out of focus backgrounds, absolutely no artifacts. Very fast moving details (like the ballroom scene from "Russian Ark"), no artifacts, motion detection was superb.

My only complaint is when I watch my encodes pre-scale down to 320x240 (for my TV), some blockiness shows up, but I don't see it without scaling or even if I prescale up. Is this something I'm doing wrong when I encode? Is there something I can do to prevent this from happening?

my encoding line:
[code:1]mencoder dvd://1 -o Melvin_Goes_to_Dinner\(h264\).avi -oac lavc -ovc x264 -lavcopts acodec=mp3 -x264encopts qp_constant=22:frameref=6:qp_step=5:direct_pred=3:me=3:mixed_refs[/code:1]

AchtungAffen
Banned
User avatar
Age: 36
Posts: 1728
Joined: Dec 07, 2004
Location: Sur, pared
Gender: Male
Contact:

  •      
  •      
  • Quote

Postby AchtungAffen » Mon Dec 04, 2006 10:12 pm

Can I encode h264 with virtualdub or one of its mods?

I gotta say, I do hate very big h264 encodes. No PC in my house can play them. The other day I watched a Black Lagoon Ep in 1200*something in h264, and it was death.
"Oh, Constantine! To how many evils origin was given, not by your conversion to Christianity, but by the dowry which from you received the first Pope that was rich!" - Dante
How can you expect to live in a Republic when you don't care about the res-publica?
"The gun, in all its forms, was the epochal tool of white male supremacy, which is why it continues to have irrational appeal. As much as the jack-booted hate Jews and blacks, that much they love their guns." - James Carrol
My List @ AniDB

- Original activist against the lockers-that-be -

The Eva Monkey
Admin Emeritus
Admin Emeritus
User avatar
Posts: 8945
Joined: Jun 14, 2004
Location: The Evanets.
Gender: Male
Contact:

  •      
  •      
  • Quote

Postby The Eva Monkey » Mon Dec 04, 2006 10:20 pm

You would think that if your TV is only going to display at 320x240 that you should size your video appropriately. But what probably happens is that a larger image, even if it's scaled down by the television during projection, would present a more faithful image on behalf of what might be perceived as extraneous resolution.

The other possibility is that your TV might be slightly different than 320x240, or the projection loses resolution in some fasion.

I don't know myself, I'm not a technical guru. This is just my educated presumption.
Webmaster, EvaMonkey.com; Co-founder, EvaGeeks.org; Moderator, r/evangelion.

Follow me on Social Media! [YouTube] [Twitter] [Facebook] [Tumblr] [Twitch]

Ornette
Administrator
Administrator
User avatar
Age: 44
Posts: 11754
Joined: Dec 26, 2005
Location: Pittsburgh/New York City
Gender: Male
Contact:

  •      
  •      
  • Quote

Postby Ornette » Mon Dec 04, 2006 10:35 pm

@ AA: Isn't virtualdub a capturing program? Seeing how insanely CPU intensive it is to encode, I would guess that it doesn't. Even a 1 pass encode with all cpu intensive options turned off only did maybe 8 frames a second on the fastest machine I have. Maybe dumping it in some raw form then transcoding it to h264 using another encoder would work.

Does you're player use video hardware to scale? Most of the h264 anime I have is encoded in 1280x720 (I never even realized that until I watched one on my computer), mplayer by default relies on the XVideo extension of X to utilize hardware when decoding/playing and I don't notice any slowdowns at all.


@ EM: I'm pretty sure the tv is 320x240, I played around with the resolution and the overscan in my Xwindows configuration and 320x240 was definitely the resolution. I could encode in 320x240 res to begin with so no scaling is needed when being played on the TV, but there's a big hit when we watch it from our computers, scaling 320x240 to 1600x1200 looks kinda crappy. I'll try using software scaling AFTER decoding instead of relying on the video card to do scaling when I get home. It's just odd that all my xvid movies with the 720x480 DVD res don't seem to have this problem.

Ornette
Administrator
Administrator
User avatar
Age: 44
Posts: 11754
Joined: Dec 26, 2005
Location: Pittsburgh/New York City
Gender: Male
Contact:

  •      
  •      
  • Quote

Postby Ornette » Wed Feb 07, 2007 11:32 am

Just got the most incredible quality to file size ratio with h264. At first I thought that employing bidirectional prediected frames (frames where the motion prediction takes into account both the previous frames and the future frames) caused my files to be larger, but then I realized it was some other option that I had turned on that I didn't need.

Recently, my roomate bought a copy of Alan Arkin's "Little Murders" (great movie). For the hour 40 something minute long movie I got a 470meg file. Here's a clip, hardly any blocky artifacts in the flat white, dark areas and absolutely no motion jitter.

h264 options: qp_constant=25:subq=7:brdo:trellis=2:bime:frameref=4:bframes=5:direct_pred=3:weight_b:me=3

The qp_constant generally effects quality and affects the average bitrate. The lower the number the higher the quality (0 = lossless), by default it's set to 26. Encoding took about 15 hours, 1 pass.


Return to “Film and Video”

Who is online

Users browsing this forum: No registered users and 4 guests