outputting 852x480 not allowed manually in HandBrake

HandBrake for Mac support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
MichaelLAX

outputting 852x480 not allowed manually in HandBrake

Post by MichaelLAX »

Here's a problem that I am having:

I digitize 16x9 content at 720x480 squeezed into a 4x3 window. The resulting DVD-RW plays with the content still squeezed into a 4x3 window.

I then use HandBrake on my Mac to both convert the DVD-RW into H.264 and expand the image back to 16x9.

However, I cannot get HandBrake to manually go any higher than 720x480, which means I have to reduce the setting to 720x400.

How can I manually set HandBrake to output the file at 852x480? Thanks.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

Why would you ever want to do this instead of just using anamorphic like your DVD does?

If you're that set on wasting storage space, you can do it with the CLI, just like the documentation says.
MichaelLAX

Post by MichaelLAX »

jbrjake wrote:Why would you ever want to do this instead of just using anamorphic like your DVD does?

If you're that set on wasting storage space, you can do it with the CLI, just like the documentation says.
I am not sure I understand your reply:

1. How can you set a DVD Recorder to record anamorphic (in my case Panasonic)?

2. Why is that wasting storage space; the DVD-RWs are re-recordable...

Thanks, Michael
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

You're storing 720*480 content on a DVD and you want it at 854*480. Are you saying you're applying a 4:3 aspect flag when you make the DVD? Don't do that.

EDIT
Until you properly master your DVD, HB has no way of doing anamorphic the intelligent way, so you're stuck using the CLI.
/EDIT

You're not wasting storage space on the DVD-RW -- I'm saying you're going to waste storage space by storing it at 854*480 instead of just keeping it at 720*480 like you should.
MichaelLAX

Post by MichaelLAX »

jbrjake wrote:You're storing 720*480 content on a DVD and you want it at 854*480. Are you saying you're applying a 4:3 aspect flag when you make the DVD? Don't do that.

Regardless, HB doesn't base its anamorphic off of that flag, so it should still work perfectly fine. Are you saying you tried it and it didn't work?

You're not wasting storage space on the DVD-RW -- I'm saying you're going to waste storage space by storing it at 854*480 instead of just keeping it at 720*480 like you should.
I am not aware of any consumer DVD Recorder (and certainly not my Panasonic model) that lets you set any aspect flag. It just burns whatever you present it with. I present it with a 16x9 image squeezed down to the 4x3 window that it presents to you.

Now I could record it in letterboxed format, but the resulting image would be 640x360, which results in degradation of picture quality, especially on my large screen plasma HDTV. So instead, I take advantage of the full frame available to me and squeeze 16x9 into the 4x3 available to me.

I currently then use VisualHub to transcode it to H.264 at 852x480 which gives me excellent results. I was just hoping to use HandBrake to achieve the same results, and get some of the additional benefits of HandBrake.

However, HandBrake only lets me downsize it to 720x400 and not take advantage of the full quality available at 852x480.

Answering your other question, if I use 720x480, the resulting file is still slightly squeezed (13.5x9 instead of 16x9).

You can see some samples at homepage.mac.com/michaellax

Thanks.
rhester
Veteran User
Posts: 2888
Joined: Tue Apr 18, 2006 10:24 pm

Post by rhester »

Convert it at 640x480 and then use QuickTime Pro to change the apparent resolution to 853 horizontal - that's essentially what HB anamorphic support is doing, anyway.

Rodney
MichaelLAX

Post by MichaelLAX »

Good tip, Rodney, and I have tried that. But Quicktime Pro changes the resulting H.264 mp4 file to .mov and that makes MetaX choke on the file when adding Metadata (using Atomic Parsley).

I was hoping for a H.264 .mp4 result from Handbrake, like the result I get from VisualHub. Thanks.
rhester
Veteran User
Posts: 2888
Joined: Tue Apr 18, 2006 10:24 pm

Post by rhester »

Failing what you want from HandBrake (and I'm honestly not sure if it can/will ever be implemented), you do have one last option - hacking the file with a hex editor.

Shortly after trak.tkhd for the video track, you will find the following:

17 null bytes (0x00)
1 1 byte (0x01)
2 null bytes (0x00)

Those 2 null bytes are the horizontal scaling factor. Change them from 00 00 to 55 55 and you'll have the 640->853 horizontal scaling you seek.

Let me know if you need more details.

Rodney
hawkman
Veteran User
Posts: 609
Joined: Sat Feb 17, 2007 9:46 pm

Post by hawkman »

Won't passthrough video/audio to .mp4 from self-contained .mov in QuickTime Player preserve the altered display size? I had a feeling it did.
MichaelLAX

Post by MichaelLAX »

hawkman wrote:Won't passthrough video/audio to .mp4 from self-contained .mov in QuickTime Player preserve the altered display size? I had a feeling it did.
OK I have some options to try out when I return home later:

1. Best option - see if I can get the CLI version to scale up to 852x480, beyond the 720x480 limit in the Mac version.

2. Use QTPro to rescale, but lose the ability to add metadata with MetaX.

3. Try the file editor suggestion of Rodney.

I do not understand the reply by Hawkman.

So if not this way, how do you all digitize HDTV content that is not OTA (over the air, where you can use a HD digitizer card), and transcode it to H.264? Thanks.
hawkman
Veteran User
Posts: 609
Joined: Sat Feb 17, 2007 9:46 pm

Post by hawkman »

My answer was a direct reply to the post quoted below. If you save the file as a self-contained .mov with the changed dimensions - as you have obviously managed - then try to export that movie to .mp4 using "Passthrough" as the encoding option for both audio and video, it may retain the altered size. Like I said, I forget if this works, but I have a vague feeling it does.

I wouldn't say scaling using the cli should be option number one. You certainly don't have 853 horizontal pixels if your DVD is 4:3 - you've got 640, I think. So forcing HB to output at 853 wide will mean your image is resampled to make the extra pixels, and you're wasting storage space. Scaling the output from 640x480 is a much better option, if you can make it work.
MichaelLAX wrote:Good tip, Rodney, and I have tried that. But Quicktime Pro changes the resulting H.264 mp4 file to .mov and that makes MetaX choke on the file when adding Metadata (using Atomic Parsley).

I was hoping for a H.264 .mp4 result from Handbrake, like the result I get from VisualHub. Thanks.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

rhester wrote:Convert it at 640x480 and then use QuickTime Pro to change the apparent resolution to 853 horizontal - that's essentially what HB anamorphic support is doing, anyway.
Err....you mean convert it at 720*480, right?
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

rhester wrote:Failing what you want from HandBrake (and I'm honestly not sure if it can/will ever be implemented), you do have one last option - hacking the file with a hex editor.
No, there's another....

Instead of mucking with hex, he could use Dumpster ( http://developer.apple.com/quicktime/download/ ). Then he just has to muck with an interface that looked dated in the System 7 era.

Encode it as anamorphic, then open the mp4 in dumpster, drill down the atoms like so:
moov -> trak -> tkhd

When you get to tkhd, you'll see a bunch of boxes, including a 9-cell table labeled "matrix".

The center box needs to be 1.0, and the bottom right box needs to be 1.0. Then, the top left box is where the magic happens. Make it 1.1851852 .

Hit return after editing each of those boxes to make the changes stick. Close the window. Open it again, drill back down through moov->trak->tkhd and make sure the changes stuck. Then try it out in QuickTime.

NOTE: Just like rhester's method above, this will ONLY display properly in QuickTime.
hawkman
Veteran User
Posts: 609
Joined: Sat Feb 17, 2007 9:46 pm

Post by hawkman »

jbrjake wrote:Err....you mean convert it at 720*480, right?
It's 4:3 content, apparently, even though it was originally 16:9 - I'd have thought 640x480 was right.
MichaelLAX

Post by MichaelLAX »

hawkman wrote:
jbrjake wrote:Err....you mean convert it at 720*480, right?
It's 4:3 content, apparently, even though it was originally 16:9 - I'd have thought 640x480 was right.
It's 16:9 content digitized at 720x480 in a 4:3 window to a DVD-RW...

It seems to me that I should maintain the 480 vertical resolution, since that quality exists in the original, and hence at 16:9 it dictates a 852 (I find that some transcoding chokes at 853) horizontal resolution. While it will take up more storage space than say, 720x404, since I want to retain the 480 vertical resolution quality, and of course, any rescaling downward will save storage space, but at what price glory?

I'm still gonna try the CLI solution first. With apologies to Rube Goldberg, some of the other solutions seem like a bit of overkill, especially on a process that I want to utilize many times as I digitize non-OTA HDTV (to move to my Apple TV) until a consumer-priced solution does it digitally without DRM obstacles.

Of course the final solution is to just continue to use VisualHub, if no "handy" HandBrake solution exists. Thanks.
MichaelLAX

Post by MichaelLAX »

rhester wrote:Convert it at 640x480 and then use QuickTime Pro to change the apparent resolution to 853 horizontal - that's essentially what HB anamorphic support is doing, anyway.

Rodney
hawkman wrote:Won't passthrough video/audio to .mp4 from self-contained .mov in QuickTime Player preserve the altered display size? I had a feeling it did.
Hey Rodney: Just to add to the intellectual knowledge databank: Following up on both yours and Hawkman's tips - not saving as a .mov file; instead do an EXPORT to .mp4 with both video and audio passthrough. The resulting file will work correctly with MetaX in its use of Atomic Parsley for metadata...
hawkman
Veteran User
Posts: 609
Joined: Sat Feb 17, 2007 9:46 pm

Post by hawkman »

MichaelLAX wrote:The resulting file will work correctly with MetaX in its use of Atomic Parsley for metadata...
Tell me: why did you think it was suggested? Just to keep you busy? :)
MichaelLAX

I have found a solution...

Post by MichaelLAX »

I have found a solution, but I posted it with a new Topic title so that more people will understand the situation and the solution:

http://handbrake.m0k.org/forum/viewtopi ... 5813#15813
Post Reply