Anamorphic or not Anamorphic?

Discussion of the HandBrake command line interface (CLI)
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
McCall
Posts: 26
Joined: Mon Aug 06, 2007 10:57 am

Anamorphic or not Anamorphic?

Post by McCall »

I am pretty sure I understand the excellent anamorphic guide http://trac.handbrake.fr/wiki/AnamorphicGuide, but I wanted someone to confirm something for me. I don't have anyone to chat to about video - these forums are it for me :)

I am encoding for my PS3 using the following command:

./HandBrakeCLI -v -i /tmp/test/DVD -o /tmp/test/DVD.mkv -e x264 -f mkv -p -b 2500 -2 -T -x crf=18:ref=2:mixed-refs=1:bframes=3:bime=1:weightb=1:subq=7:trellis=2:analyse=all:level=41:merange=64:no-fast-pskip=1:me=umh:sar=1/1 -E ac3

Which I think should be anamorphic. On the MacUI I get told the anamorphic resolution in the video tab, which is 1024*x, I also get told the output resolution of 720*x. Using HandBrakeCLI I get given the output resolution of 720*x , but don't get told the anamorphic resolution. Does the fact that I am using the -p option guarantee my encode will be anamorphic (and HandBrakeCLI doesn't report the anamorphic resolution), or am I using HandBrakeCLI wrong and I am not getting told an anamorphic resolution as I am not encoding anamorphic.

I ask here rather than wait for the encode to finish and test myself as I am not able to easily test my encodes (encoder and PS3 are in different locations!).
rhester
Veteran User
Posts: 2888
Joined: Tue Apr 18, 2006 10:24 pm

Re: Anamorphic or not Anamorphic?

Post by rhester »

It's probably simpler to use VLC to view the results on the encoding machine and get instant gratification on whether or not you were successful.

Rodney
McCall
Posts: 26
Joined: Mon Aug 06, 2007 10:57 am

Re: Anamorphic or not Anamorphic?

Post by McCall »

rhester wrote:It's probably simpler to use VLC to view the results on the encoding machine and get instant gratification on whether or not you were successful.
I have SSH access only, and I can't export DISPLAY. The real problem is my just my impatience :) would adding the anamorphic resolution to the CLI output when using the -p/P options be something sensible to suggest to the developers (or try to patch in myself?).
rhester
Veteran User
Posts: 2888
Joined: Tue Apr 18, 2006 10:24 pm

Re: Anamorphic or not Anamorphic?

Post by rhester »

McCall wrote:[qwould adding the anamorphic resolution to the CLI output when using the -p/P options be something sensible to suggest to the developers (or try to patch in myself?).
The first is a good idea, and I'd recommend a post to Ponies.

The second is a great idea, and I'd recommend a post of your initial patch (or even intentions to create one) in Development.

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

Re: Anamorphic or not Anamorphic?

Post by jbrjake »

You can figure it out from what you get now -- the height will be the same and the width will be the given width times the given x264 SAR.

Adding the output "correctly" means displaying it the way that the MacGui does, with hb_set_anamorphic_size, when -P is used. Easily enough done.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: Anamorphic or not Anamorphic?

Post by jbrjake »

Decided it was best not to do it in the CLI, and just run it inside libhb at the beginning of the encode, after the loose anamorphic dimensions and pars would be set anyway.

Code: Select all

Index: libhb/work.c
===================================================================
--- libhb/work.c	(revision 1310)
+++ libhb/work.c	(working copy)
@@ -225,7 +225,14 @@
         hb_log( " + video bitrate %d kbps, pass %d", job->vbitrate, job->pass );
     }
 
-	hb_log (" + PixelRatio: %d, width:%d, height: %d",job->pixel_ratio,job->width, job->height);
+    if( job->pixel_ratio )
+    {
+    	hb_log (" + anamorphic display width:%d, storage width: %d, height: %d",(job->width * job->pixel_aspect_width / job->pixel_aspect_height),job->width, job->height);        
+    }
+    else
+    {
+    	hb_log (" + width:%d, height: %d",job->width, job->height);        
+    }
     job->fifo_mpeg2  = hb_fifo_init( 2048 );
     job->fifo_raw    = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
     job->fifo_sync   = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
Post Reply