or Connect
AppleInsider › Forums › Software › Mac OS X › MPEG4 H.264 encoding tests (vs Xvid)
New Posts  All Forums:Forum Nav:

MPEG4 H.264 encoding tests (vs Xvid)

post #1 of 60
Thread Starter 
Heyall,

In my endevours of latest codec trials I just wanted to share a few with you.

The latest HandBrake 0.7 beta 2 is what I used since it supports H.264 encoding. www.m0k.org It can rip a DVD directly without needing to copy to the HD first.

I did the following with the DVD of "Almost Famous" which is about 2hours long.

I set resolution to 544x304 for encoding for both

Target size was 700MB

1) H.264 encoding, 2-pass, AAC Audio (Stereo although 5.1 is supported) @ 128bit. It calculated that bitrate was 775kbit/sec for video.

2) Xvid encoding 2-pass, MP3 (Stereo) @ 128bit) Said that average bit rate was 680kbit/sec

The H.264 file actually came out to 675.4MB, the Xvid came out to the desired 700.1MB (on the dot).

Result?

H.264 comes out on top. By quite a margin. I took a lot of screenshots I will post in PDF format (links will be given)

The downsides I saw are that H.264 encoding takes twice the time and the file is a lot more processor intensive to playback. A Dual G5 2.5GHz did the H.264 file at about 20fps. The Xvid at about 40.

Congrats Apple. Seems like you have a hell of a winner on your hands.

PS The MPEG4 files (H.264) created with HandBrake are 100% compatible with QuickTime 7.

Screenshots coming soon
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #2 of 60
Excited about seeing those screenshots.
post #3 of 60
Thanks for the comparison!

I'd be quite interested in those screenshots and any more details you could offer.

h264 seems to be giving xvid/divx a run for there money. Competition is good.
post #4 of 60
Thread Starter 
I just realized something though..

I dont get why the XVID file is bigger eventhough it says its a lower bitrate. That makes no sense. It should be even smaller.

Weird.

I was thinking of cropping the pics, but decided to leave them as is in PDF, uncompressed.

Average size is 1MB (1024x768 )

The window that has .AVI is the XVID file and the .MP4 is, yeah you guessed it, the H.264 version (the QuickTime 7 window)

Overall, you'll see that H.264 is much crisper and the action shots pixelise much less. I dont know if this is because of the Codec (AVC/H.264) or the Encoder (HandBrake). In the end, H.264 is better.

The window size of the videos are 1:1 ratio.

Here ya go:

Image 1
Image 2
Image 3
Image 4
Image 5
Image 6
Image 7
Image 8

PS Sorry if the VLC and QuickTime window sometimes change position
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #5 of 60
Hm, so I'm in this PSP frame of mind (mine should be coming today). A light went off so I just googled "H.264 psp" and found this.

Quote:
In a presentation at the Hot Chips conference here Tuesday, designer Masanobu Okabe described further details of the PSP chipset, which the company concealed with the non-specific title: "A 90-nm embedded DRAM single-chip LSI with a 3D graphics H.264 codec engine and a reconfigurable processor".

The fact that they used the Memory Stick Pro Duo is lame but... it's Sony (ATRAC, MiniDisc...)

Apple + Sony + Standards = WOW!

Screed
MWSF '07: Steve Jobs hates my wallet and my mobile carrier.
Reply
MWSF '07: Steve Jobs hates my wallet and my mobile carrier.
Reply
post #6 of 60
Thread Starter 
H.264 is fantastic.

We've been dabbling in it for a while.

It scales beautifully from a cell phone video stream to HDTV

As a matter of fact, HDTV broadcasting will start in Europe in H.264, not MPEG2 like in USA now.

H.264 is THE standard for the forseeable future.

Now then... we just need uber cheap decoder chips and H.264 will explode out of control.
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #7 of 60
Quote:
Originally posted by ZO
H.264 encoding, 2-pass, AAC Audio (Stereo although 5.1 is supported) @ 128bit. It calculated that bitrate was 775kbit/sec for video.

How do you get it to rip in 5.1? Is it the AC3 option in .avi file?

So glad it lets us rip H.264 video as a MP4 files now, as QT likes that (or will like in version 7) better than .avi
Daniel Tull
Reply
Daniel Tull
Reply
post #8 of 60
Will I be able to play a H.264 movie on my iMac G4 or am i screwed? It seems kind of demanding....
post #9 of 60
Thread Starter 
i dunno if the final file actually has 5.1

There is the option from which audio stream to rip. I had Stereo and AC3 5ch as options.

Download HandBrake (free) to test.

Im actually currently ripping another DVD with the 5channel option on to see if there is actually a difference.

dunno
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #10 of 60
Thread Starter 
I just transfered the movie I made mentioned above to an old G4 733MHz with 1.25GB ram and played it full screen on a cinema display (1600 x 1020 ) and played with no problems whatsoever. nVidia2MX 32MB card. and this was with a half dozen open apps. (MacOS X 10.3.8 and latest build of QuickTime 7)

edit: ok, at full screen it would stutter at very fast scenes but it's not too bad
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #11 of 60
ZO

thanks man! I've been wanting to see something like this for a while. AVC is impressive, even in the screenshots the clarity improvement is evident.

I'm excited to see what AVC can do personally.
He's a mod so he has a few extra vBulletin privileges. That doesn't mean he should stop posting or should start acting like Digital Jesus.
- SolipsismX
Reply
He's a mod so he has a few extra vBulletin privileges. That doesn't mean he should stop posting or should start acting like Digital Jesus.
- SolipsismX
Reply
post #12 of 60
Quote:
Originally posted by ZO
I just transfered the movie I made mentioned above to an old G4 733MHz with 1.25GB ram and played it full screen on a cinema display (1600 x 1020 ) and played with no problems whatsoever. nVidia2MX 32MB card. and this was with a half dozen open apps. (MacOS X 10.3.8 and latest build of QuickTime 7)

edit: ok, at full screen it would stutter at very fast scenes but it's not too bad

Where can one obtain QT7 for panther right now?

I am too poor to join ADC but would love a legal copy to play with - even if it is marked use-at-your-oun-risk.

I havn't been torent searching but I am getting damn close to doing it.
You can't quantify how much I don't care -- Bob Kevoian of the Bob and Tom Show.
Reply
You can't quantify how much I don't care -- Bob Kevoian of the Bob and Tom Show.
Reply
post #13 of 60
Quote:
Originally posted by a_greer
Where can one obtain QT7 for panther right now?

I am too poor to join ADC but would love a legal copy to play with - even if it is marked use-at-your-oun-risk.

I havn't been torent searching but I am getting damn close to doing it.

There is no legal copy of QT7 available for Panther, it has not been released yet. Remember, even if you find a QT 7 installer on BT, think before you install. I am a QT beta tester, and have been blown away. But that being said, do not try it on any day to day machine. These builds can cause serious havoc with your system.
"I'm learning how to meditate, so far so good."
Donald Fagen and Walter Becker
Reply
"I'm learning how to meditate, so far so good."
Donald Fagen and Walter Becker
Reply
post #14 of 60
I was a little disappointed at Handbreak's H.264 encoding. It is really slow. I usually use FFMPEG to encode my HDTV shows into H.264 for archiving, and it is much faster. (At least I think it is.)

PS: Freakout time! The colors I am seeing in those PDF's can not be the same thing you see on your screen.
horrid misuse of cool technology
SSBA.COM
Reply
horrid misuse of cool technology
SSBA.COM
Reply
post #15 of 60
Quote:
Originally posted by a_greer
Where can one obtain QT7 for panther right now?

I am too poor to join ADC but would love a legal copy to play with - even if it is marked use-at-your-oun-risk.

I havn't been torent searching but I am getting damn close to doing it.

Well, an education copy of Tiger will likely be less than a student ADC subscription (est. $69 edu vs. $99 student ADC).

Edit: Oh. you were talking about QT7. Just wait.

Zo: Do you have any small sample H.264 clips from your testing that you could post?
What the problem is?
Reply
What the problem is?
Reply
post #16 of 60
Quote:
Originally posted by ZO
i dunno if the final file actually has 5.1

There is the option from which audio stream to rip. I had Stereo and AC3 5ch as options.

Download HandBrake (free) to test.

Im actually currently ripping another DVD with the 5channel option on to see if there is actually a difference.

dunno

I see the AC3 5ch for one of my DVDs, but I always got the impression that that was the available audio from the DVD, as I have seen French, Spanish etc come up there too.

I can't wait for HandBrake to be able to rip surround sound, that will be awesome! Only then would I be happy to watch the ripped file as opposed to the original DVD. For now ripping my favourite movies for car journeys and headphones is great.
Daniel Tull
Reply
Daniel Tull
Reply
post #17 of 60
Any way you could compare the speed and quality of Apple's H.264 encoder to ffmpeg's? I know Handbrake can't use QuickTime encoders (stupid, but it can't), so you may have to do some trickery to get everything to come out right, but it would be a good comparison.
post #18 of 60
Thread Starter 
I'll try and post some stuff ASAP... please wait

QT7 betas still require a serial number for pro.

Just wait a few weeks.

How can I try to encode with QT H.264 from a DVD?

With HandBrake encoding into Xvid or other is MUCH faster (double)... But I'd rather go get a crepe at the corner and wait for the better H.264 quality.

Ebby... what you mean about the colors? Are they off or bad or something?
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #19 of 60
ZO, since you have quicktime 7, why don't you use it for your H.264 encodings ?
EDIT : oops, you just gave the answer.

In order to encode your DVD with the QT H.264 codec, you need DIVA but I don't know if it'll work with quicktime 7.

http://diva.3ivx.com/

Diva can transcode any mpeg1-2 (not VOB, you must rip the DVD before) in any quicktime format.

I'd be glad to see the image quality of a QT H.264 video.
post #20 of 60
Quote:
Originally posted by ZO
Ebby... what you mean about the colors? Are they off or bad or something?

Don't worry about it. It is some kind of color conversion problem most likely on my laptop. It makes the PDF look like a bad acid trip.
horrid misuse of cool technology
SSBA.COM
Reply
horrid misuse of cool technology
SSBA.COM
Reply
post #21 of 60
Thread Starter 
Quote:
Originally posted by french macuser
ZO, since you have quicktime 7, why don't you use it for your H.264 encodings ?
EDIT : oops, you just gave the answer.

In order to encode your DVD with the QT H.264 codec, you need DIVA but I don't know if it'll work with quicktime 7.

http://diva.3ivx.com/

Diva can transcode any mpeg1-2 (not VOB, you must rip the DVD before) in any quicktime format.

I'd be glad to see the image quality of a QT H.264 video.

ok... this doesnt make much sense though. What do you want me to compare it to?

I would have to convert a DVD to MPEG1 or 2 and then encode it again into QT H.264? Thats two compressions.

And what "normal" Quicktime would you want me to compare it to?

In other news, yes, DIVA works with latest QT7 (lets me select H.264 as one of the CODECS)
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #22 of 60
DVD is mpeg2, and ripping one doesn't mean re-encoding it but "demultiplexing" the VOBs (I don't know if we say that in English). The quality remains exactly the same. You can use YadeX for that.

And we can compare the result to handbrake's H.264 (which uses Mencoder I think, or ffmpeg ?). The same codec does not imply the same image quality. For example, Mencoder's mpeg1-4 is better than ffmpeg's.
post #23 of 60
Thread Starter 
good ... god... QT7 encoding... is.... slooooooow

I downloaded Yadex and extracted the VOBs to MPEG2 (.m2v).

QT7 Pro includes the MPEG2 decoders (hurrah) so I didnt have to download the MPEG2 Component.

On a Dual G5 2.5GHz it took well over a minute to open the file (!!).

Also there is no audio. Grr.

Im currently saving as an H.264 file (700MB target size, 890kbit/sec, 2-pass) and its just abysmally slow.

Its been going since 18:00 and its 21:00 now and its at about 1/8th of the way. *sigh* The result better be friggen amazing.

Hmm... maybe I should've just encoded a chapter instead of the whole DVD...

ah well... I'll let it run over night and come in the morning and see where it's at.
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #24 of 60
Can I ask whether QT7 has better support (ie actually playable) for .avi Xvid files? I swear I read somewhere that it was to have better support for third party codecs or something to that extent.
Daniel Tull
Reply
Daniel Tull
Reply
post #25 of 60
Thread Starter 
No support for XviD
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #26 of 60
Hey ZO, how's that H.264 QT encode doing?
post #27 of 60
Thread Starter 
hmmm... well, I got to work and it was done. Is there any way to see when an applications stopped doing something, like in a log file (and where would it be?)

I'm ripping the movie with Handbrake now at the same specs. Its pretty slow as well but...

Will put comparisons of XVID, QT H.264 encoded, and Handbrake H.264 encoded screenshots asap. Probably end of today or tomorrow. Depends on my workload today.

If you have any requests, tell me now.

PS The movie is going to be a bit dark, Interview With A Vampire. Not sure why I chose this movie. I guess its the first I got my hands on.
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #28 of 60
Quote:
Originally posted by ZO
No support for XviD

Damn shame.

I have been ripping Minority Report in Handbrake H.264 overnight. I stared at 9pm last night and when I left the house at 11am it had done 40% of the second pass. I'm using a 1.33GHz PowerBook G4 with 512MB RAM. Compared to Xvid (ffmpeg) encoding it seems to be about half to a third of the speed.

I also have Minority Report as a MP4 Xvid file, which I can post images of if you like. I don't have QT7 though, so I'll be using VLC. Minority Report is 2hr 20min long btw.


PS. Actually saying that, my MP4 Xvid copy of Minority Report plays in QT6. It would appear QT has a problem with .avi files and not the Xvid encoding?
Daniel Tull
Reply
Daniel Tull
Reply
post #29 of 60
Maybe it was due for announcement yesterday, but the pope dying came in the way...
post #30 of 60
oops, wrong thread... hell-of-a second post! (and third by the way
post #31 of 60
Thread Starter 
well... this thread has suddenly gone waaaaaaaay weird

QT doesnt support XVID. You may have a plugin that allows you to view it in QT6

Regarding playback, it will be the same if you see H.264 files in VLC or QT7.
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #32 of 60
Quote:
Originally posted by danielctull
PS. Actually saying that, my MP4 Xvid copy of Minority Report plays in QT6. It would appear QT has a problem with .avi files and not the Xvid encoding?

Keep in mind that .avi is a container format, not a particular codec. An avi file could contain one of many different types of audio and video codecs.

There is a divx plugin that allows QT to play avi files containing divx video. It doesn't work perfectly so I tend to use VLC for everything.
post #33 of 60
Quote:
Originally posted by ZO
Im currently saving as an H.264 file (700MB target size, 890kbit/sec, 2-pass) and its just abysmally slow.

Its been going since 18:00 and its 21:00 now and its at about 1/8th of the way. *sigh* The result better be friggen amazing.
[/B]

That's a 24 hour encoding. On a dual 2.5 GHz G5 and given that H.264 must have been optimised for altivec, dual G5 etc, I really hope it's a bug. :
Anyway, quicktime mpeg2 decoding has always sucked. Maybe diva would be faster.
post #34 of 60
Thread Starter 
small update:

HandBrake took 6 hours 15 minutes to encode the same file.
QT took somewhere around 14-18 hours.

No audio encoded, 2-pass, H.264

In few hours should have some screenshot comparisons

Curiosity: Both HandBrake and QT consume about 65-70% of the processors and not 99% like when I encode with HandBrake into Xvid. I dont understand why not.
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #35 of 60
Does Xvid use both CPUs ?
post #36 of 60
Thread Starter 
Quote:
Originally posted by french macuser
Does Xvid use both CPUs ?

yes (with HandBrake) 99% with both processors = approx 60fps encoding.

when you encode in H.264 both processors are at about 70%

same with QT. Both procs are at about 70%
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #37 of 60
Quote:
Originally posted by ZO
Curiosity: Both HandBrake and QT consume about 65-70% of the processors and not 99% like when I encode with HandBrake into Xvid. I dont understand why not.

I found the same thing. Sometimes it went up to 80%, but it was completely the only thing running, even turned Airport and Bluetooth off.

Also, i have just seen that Handbrake can encode 2 streams of audio. I have tried this with the original audio and a commentary and it's brilliant in VLC. I ripped a section in Xvid, but QT6 mixes the two audio streams together. Do you know if there is a way of playing each audio stream separately?
Daniel Tull
Reply
Daniel Tull
Reply
post #38 of 60
Thread Starter 
Just tried it out on a chapter of Interview. Using HandBrake and ability to encode two audio streams.

Plays back fine in QT7.

See (PDF) [[taken off just in case. pm me if you want to see. its nothing special though. just a dialog box with option to select tracks of audio or video in a QT movie]]

Problem is, it will play BOTH audio tracks if you dont deactivate one

I was suddenly listening to the clip in English and French at the same time

Just go into Properties (Apple+J) and deactivate the audio track you dont want to listen to.

As you can see, the property window is VASTLY improved. You can rename the tracks and stuff. Great stuff.

PS the screenshot is of a moving scene in the movie (no artifacts!). I forgot to make the pixels size smaller, so its at 1:1 DVD size of 720x400.
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
I'm having deja-vu and amnesia at the same time. I think I've forgotten this before.
Reply
post #39 of 60
Quote:
Originally posted by ZO
yes (with HandBrake) 99% with both processors = approx 60fps encoding.

when you encode in H.264 both processors are at about 70%

same with QT. Both procs are at about 70%

Xvid must be more optimised for dual processing. On my iBook, Xvid and H.264 use both 100% of my processor. Xvid is rougly 3 times faster.
post #40 of 60
Quote:
Originally posted by ZO
...

As you can see, the property window is VASTLY improved. You can rename the tracks and stuff. Great stuff.

PS the screenshot is of a moving scene in the movie (no artifacts!). I forgot to make the pixels size smaller, so its at 1:1 DVD size of 720x400.

That's bloody excellent Much much better options than QT6.

As for the size, would you say there are less artifacts when the rip is at 1:1 size rather than when you scale it down? I personally always rip at the original 720x size.


french macuser: I was running a Xvid rip earlier and on my PB it is about 3 times faster too. ~6fps for H.264 and ~17fps for Xvid.

PS. Also, does the changes to the properties stick when the movie is closed. For example, if you disable the second audio track, will it stay disabled next time the movie is run? And same for if you rename the audio track.
Daniel Tull
Reply
Daniel Tull
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Mac OS X
AppleInsider › Forums › Software › Mac OS X › MPEG4 H.264 encoding tests (vs Xvid)