or Connect
AVS › AVS Forum › Video Components › Home Theater Computers › HTPC - Linux Chat › HandBrake: Best Practices for Encoding to h.264
New Posts  All Forums:Forum Nav:

HandBrake: Best Practices for Encoding to h.264 - Page 2

post #31 of 92
Optionally, you can snatch out the AC3 audio with mplayer and put it into your mkv with mkvmerge (from the mkvtoolnix package). There's a GUI for mkvmerge somewhere too, but I don't remember where.

In mplayer, you would use the "dumpaudio" switch, for example:
Code:
mplayer source_file.vob -aid 128 -dumpaudio -dumpfile sound.ac3
post #32 of 92
There should be no need to use mplayer and mkvmerge as handbrake can do 5.1 audio passtrough very well, I have used it without problems.

Run mediainfo (command line) on the mkv file and post the output here so we can see what the mkv file contains.

You can get medianfo from here:
http://mediainfo.sourceforge.net/en/Download/Mandriva
(there is no 2010.0 version yet but the 2009.1 version should work just fine)
post #33 of 92
I agree, just offering an alternative.

Thank you for the mediainfo link btw -- I've been using it in windows and wasn't sure if it worked in linux. Here's the Ubuntu PPA: https://launchpad.net/~shiki/+archive/mediainfo
post #34 of 92
Well, the 2009.1 version won't work due to an unresolved dependancy:

Code:
[root@localhost Downloads]# urpmi ./mediainfo-0.7.25-1.i586.Mandriva_2009.1.rpm
A requested package cannot be installed:
mediainfo-0.7.25-4.1.i586 (due to unsatisfied libmediainfo.so.0)
Continue installation anyway? (Y/n) n
[root@localhost Downloads]#
Here are screenshots from my handbrake configuration at the time I encoded the movie. Let me know if I set something up wrong that would cause the AC3 audio to be missing:




post #35 of 92
Quote:
Originally Posted by Mac The Knife View Post

^^^ What does it say in the Audio/Video tab for the properties of the encoded file.

That should at least tell us if you selected the right audio track when you did the encode.

In the browser.

But using mediainfo, as others have recommended, would be an even better choice.
post #36 of 92
lol, "Chic-flick" folder .

Yes, post the output from mediainfo on that file, please.
post #37 of 92
WEIRD! I just rented and watched Accidental Husband with my wife last week!?

I watched it for Uma, she for Colin Firth (she's had a thing for Colin since the first Bridgett Jones).

While the film was panned critically, I enjoyed it just to see Keir Dullea again (Open the pod bay doors, HAL! ) and the Comedian from the Watchman, besides the Uma thing.
post #38 of 92
Quote:
Originally Posted by shane2943 View Post

Well, the 2009.1 version won't work due to an unresolved dependancy:

Code:
[root@localhost Downloads]# urpmi ./mediainfo-0.7.25-1.i586.Mandriva_2009.1.rpm
A requested package cannot be installed:
mediainfo-0.7.25-4.1.i586 (due to unsatisfied libmediainfo.so.0)
Continue installation anyway? (Y/n) n
[root@localhost Downloads]#

Of course it won't work you have to download the dependency library packages from the same site too!
It's actually 2 libraries that are needed, both are there for you to download along with mediainfo.


Edit: with regards to your MKV, it looks like you have 2 audio tracks there one is 2 channel dolby pro logic AAC (this one is there by default part of the Handbrake preset) and then the pass-through AC3 track.

You should remove the default AAC track next time, you don't need it and it slows down your transcode and it's probably the one XBMC is playing by default as it's the first track. In XBMC, during playback you can switch to the second track, then you will get 5.1 sound (but as I said, next time better remove the default AAC track and only include the AC3 pass-through track).
post #39 of 92
DOH!!! I didn't realize the libraries were on the same site.

As far as the audio tracks, I will remove the Dolby channel and re-encode the movie again and see what happens. Only takes about 50 minutes to encode now with the new Handbrake and my Core i5 (as opposed to 8+ hours before) so that aint a problem.

I'll keep y'all posted but that's probably my issue.

Thanks!!!
post #40 of 92
Thread Starter 
Sorry for the late reply, but I had the same audio issue with HandBrake. Just delete that first audio track and you will be good to go.
post #41 of 92
Quote:
Originally Posted by shane2943 View Post

Only takes about 50 minutes to encode now with the new Handbrake and my Core i5 (as opposed to 8+ hours before)

Stop rubbing it in, I'm envious of your i5...
post #42 of 92
Sorry.

Fas as handbrake and the 5.1 audio, deleting that Dolby track did the trick! The movie plays great with the correct audio track now! YAY!
post #43 of 92
Thread Starter 
Can someone possibly advise as to whether I am missing a necessary codec to play these back in XBMC? I am running on a dual-core Zotac ION board with Ubuntu 9.10. From the logs it appears that XBMC is trying to play these files as MPEG-2, which they obviously aren't. I used the High Profile to encode in the latest version of HandBrake, saving the output to an MKV file.
post #44 of 92
post the mediainfo (CLI) output of the MKV file you created with Handbrake.
post #45 of 92
Thread Starter 
tux99:

Strangely, mediainfo doesn't return anything! Same thing with any of my MKV files created with HandBrake. It returns an absurd amount of data for ISO files and m2ts files. I have verified that these files play in VLC on my laptop.
post #46 of 92
I have run into a problem as well: with a couple of movies, Pearl Harbor being one of them, when opening the Video_TS folder, Handbrake simply crashes. I opened Handbrake in a terminal and then tried to open those movies to see what the error was and all I got was "Segmentation Fault." I thought that maybe the encryption was the culprit so I re-ripped the disc with DVDFab and then extracted the movie with k9copy. I then tried to open it again in Handrake but same result.

Any idears? I have transcoded about 20 movies so far with Handbrake and all went through beautifully. Just a couple of them won't go through.
post #47 of 92
Quote:
Originally Posted by shane2943 View Post

I have run into a problem as well: with a couple of movies, Pearl Harbor being one of them, when opening the Video_TS folder, Handbrake simply crashes. I opened Handbrake in a terminal and then tried to open those movies to see what the error was and all I got was "Segmentation Fault." I thought that maybe the encryption was the culprit so I re-ripped the disc with DVDFab and then extracted the movie with k9copy. I then tried to open it again in Handrake but same result.

Any idears? I have transcoded about 20 movies so far with Handbrake and all went through beautifully. Just a couple of them won't go through.

Try running Handbrake directly on the output of DVDFab, without the k9copy step in between.
post #48 of 92
Quote:
Originally Posted by drkdiggler View Post

tux99:

Strangely, mediainfo doesn't return anything! Same thing with any of my MKV files created with HandBrake. It returns an absurd amount of data for ISO files and m2ts files. I have verified that these files play in VLC on my laptop.

That is very weird, I have never seen mediainfo not return anything. It always returns all usual info when I run it on my Handbrake created MKVs.

Have you tried mediainfo -f whatever.mkv ?
post #49 of 92
Thread Starter 
That is exactly the command that I ran. No dice on the MKVs that I made from DVD using HandBrake. However, it returns data for other file types. It also returns information for a BluRay MKV that I made with MakeMKV. As I mentioned before, I am able to play the files on my laptop. In addition, when I select properties in the gnome file browser on my laptop, it returns some basic info about the file such as codecs, video size, etc.
post #50 of 92
Quote:
Originally Posted by tux99 View Post

Try running Handbrake directly on the output of DVDFab, without the k9copy step in between.

Ok, I tried that and it worked. So k9copy is doing something weird to the rips I suppose. Long as the "main Movie" option in DVDFab works, I guess it doesn't matter.
post #51 of 92
Has anyone successfully ripped District 9? I am having the darndest time with this movie! If I rip with k9copy, handbrake will load it, but the entire encoding process takes about 1/2 a second and yields a .mkv file about .2MB in size. If I rip with DVDFab and choose Main Movie as the option, Handbrake will encode it, but will not stop at the end. It gets to 100% and keeps going. What it's doing I don't know but I started encoding District 9 last night, then we went out for a bit, came back several hours later and it was still going! I had to stop it. The .mkv it created was about 17GB in size and XBMC said the movie was about 9 hours long! The movie seemed to play ok, but what's all the extra stuff? I am encoding it from a Main Movie rip from DVDFab again now. Once it gets to 100%, I am just going to cancel it and hope for the best.

This movie is frustrating me.
post #52 of 92
I was unable to get it to copy at all.

I'm on a Windows PC, but just thought you might like to know its not just you.
post #53 of 92
Thread Starter 
Does anyone have an idea on why mediainfo isn't reporting ANY information for the MKVs that I made?
post #54 of 92
Quote:
Originally Posted by WinstonSmith View Post

I was unable to get it to copy at all.

I'm on a Windows PC, but just thought you might like to know its not just you.

Thanks, Winston. I'm going to hope that force canceling the encode in Handbrake will yield a watchable Movie. If the last few frames of the movie are not watchable, that's ok since that'll be in the credits and I don't watch those anyway.
post #55 of 92
Thread Starter 
I have an update on my issue with mediainfo not returning any information on my HTPC. I ran mediainfo, on the same files, from my laptop (on which I encoded the files) and it returned info:

Code:
General
Complete name                    : A Few Good Men.mkv
Format                           : Matroska
File size                        : 1.73 GiB
Duration                         : 2h 18mn
Overall bit rate                 : 1 793 Kbps
Writing application              : HandBrake 0.9.4

Video
ID                               : 1
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : High@L3.0
Format settings, CABAC           : Yes
Format settings, ReFrames        : 3 frames
Muxing mode                      : Container profile=Unknown@3.0
Codec ID                         : V_MPEG4/ISO/AVC
Duration                         : 2h 17mn
Bit rate                         : 1 309 Kbps
Width                            : 704 pixels
Height                           : 352 pixels
Display aspect ratio             : 2.35:1
Frame rate                       : 23.976 fps
Resolution                       : 24 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.220
Stream size                      : 1.26 GiB (73%)
Writing library                  : x264 core 79
Encoding settings                : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=3 / nr=0 / decimate=1 / mbaff=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=1 / wpredb=1 / wpredp=2 / keyint=240 / keyint_min=24 / scenecut=40 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Color primaries                  : BT.601-6 525, BT.1358 525, BT.1700 NTSC, SMPTE 170M
Transfer characteristics         : BT.709-5, BT.1361
Matrix coefficients              : BT.601-6 525, BT.1358 525, BT.1700 NTSC, SMPTE 170M

Audio
ID                               : 2
Format                           : AC-3
Format/Info                      : Audio Coding 3
Codec ID                         : A_AC3
Duration                         : 2h 18mn
Bit rate mode                    : Constant
Bit rate                         : 448 Kbps
Channel(s)                       : 6 channels
Channel positions                : Front: L C R, Surround: L R, LFE
Sampling rate                    : 48.0 KHz
Stream size                      : 442 MiB (25%)
Language                         : English

Menu
00:00:00.000                     : Chapter  1
00:04:58.131                     : Chapter  2
00:07:59.145                     : Chapter  3
00:11:43.869                     : Chapter  4
00:16:32.191                     : Chapter  5
00:25:08.707                     : Chapter  6
00:29:42.864                     : Chapter  7
00:40:06.771                     : Chapter  8
00:47:42.059                     : Chapter  9
00:51:00.348                     : Chapter 10
00:57:10.326                     : Chapter 11
01:01:15.288                     : Chapter 12
01:05:38.384                     : Chapter 13
01:08:41.400                     : Chapter 14
01:10:15.244                     : Chapter 15
01:13:00.909                     : Chapter 16
01:20:03.790                     : Chapter 17
01:22:51.583                     : Chapter 18
01:26:19.207                     : Chapter 19
01:28:58.449                     : Chapter 20
01:31:09.413                     : Chapter 21
01:39:12.813                     : Chapter 22
01:39:52.019                     : Chapter 23
01:42:41.939                     : Chapter 24
01:54:36.853                     : Chapter 25
02:02:40.336                     : Chapter 26
02:08:36.358                     : Chapter 27
02:10:34.143                     : Chapter 28
So it would appear as if my HTPC is missing some dependencies that would enable XBMC to properly parse these MKV files, to determine the proper codec to use for playback (it appears as if it is trying to playback using MPEG2). Mediainfo must also use the same codec for playback. Any ideas on what I could be missing?
post #56 of 92
Thread Starter 
I'm going to hang my head low

My issues were related to permissions issues. Goes to show, being able to see the file does not mean that you have sufficient access to access/play it.
post #57 of 92
I have found the constant quality (rather than 2 pass) setting works better for me. I used to use the 2 pass setting but, while it gave fairly reliable file size output, the quality could vary wildly, unless you ramped up the average bitrate, increasing the filesizes.

The constant quality setting does just what it says, keeps the quality constant. The only downside is the unpredictable file size.

With a bit of experimentation, a better quality and similar sized output can be had compared with the high profile 2 pass encoding...
post #58 of 92
Ok, ran into an odd issue. I'm trying to Encode Avatar and I want to use the constant quality slider and set it to '0' or lossless. I want the highest quality possible from this one. File size doesn't really matter to me.

Now, I encoded the movie but when I play it with XBMC, I get this:


It's hard to tell, but that's the '20th Century Fox" logo. The whole movie looks this way with the colors all screwy. Did setting the slider to lossless do this? How can I get a lossless encode properly? Playing the movie with Dragon Player shows fine.
post #59 of 92
That's because '0' (lossless) is waaay too high bitrate for XBMC (and most likely VDPAU).

Dragon Player most likely uses software decoding rather than VDPAU and your cpu is powerful enough to cope with the bitrate.

http://trac.handbrake.fr/wiki/Suppor...insomelosesome

Start with the default settings and then increase them a bit if they are not good enough, rather than starting with an extreme that makes no sense.
post #60 of 92
I usually use the 16 setting on my movies and it turns out pretty good, however there is still a tiny bit of pixelation that occurs during very dark scenes in movies where the shades of brightness differ very slightly. Example would be the opening scene of Star Trek where the camera is panning past the USS Kelvin. I can see squares and such among the shades there.

Since Avatar was such a huge visual spectacle, I wanted to do better than 16. I wanted to get as close to lossless as I can. Know of any way to do that? I suppose I can just play the rip.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: HTPC - Linux Chat
AVS › AVS Forum › Video Components › Home Theater Computers › HTPC - Linux Chat › HandBrake: Best Practices for Encoding to h.264