static int h264_30 = 0;
static char * audios = NULL;
static int audio_mixdown = HB_AMIXDOWN_DOLBYPLII;
+static float dynamic_range_compression = 0;
static int sub = 0;
static int width = 0;
static int height = 0;
static int chapter_end = 0;
static int chapter_markers = 0;
static char * marker_file = NULL;
-static int crf = 0;
+static int crf = 1;
static char *x264opts = NULL;
static char *x264opts2 = NULL;
static int maxHeight = 0;
static int maxWidth = 0;
static int turbo_opts_enabled = 0;
-static char * turbo_opts = "ref=1:subme=1:me=dia:analyse=none:trellis=0:no-fast-pskip=0:8x8dct=0";
+static char * turbo_opts = "ref=1:subme=1:me=dia:analyse=none:trellis=0:no-fast-pskip=0:8x8dct=0:weightb=0";
static int largeFileSize = 0;
static int preset = 0;
static char * preset_name = 0;
static int vfr = 0;
static int mp4_optimize = 0;
+static int ipod_atom = 0;
/* Exit cleanly on Ctrl-C */
static volatile int die = 0;
if (preset)
{
- hb_log("+ Using preset: %s", preset_name);
+ fprintf( stderr, "+ Using preset: %s", preset_name);
if (!strcmp(preset_name, "Animation"))
{
job->arate = 48000;
acodec = HB_ACODEC_FAAC;
x264opts = strdup("ref=5:mixed-refs:bframes=16:bime:weightb:b-rdo:direct=auto:b-pyramid:me=umh:subme=5:analyse=all:8x8dct:trellis=1:nr=150:no-fast-pskip:filter=2,2");
+ deinterlace = 1;
+ deinterlace_opt = "2:-1:1";
job->chapter_markers = 1;
- job->deinterlace = 1;
pixelratio = 1;
twoPass = 1;
turbo_opts_enabled = 1;
job->abitrate = 160;
job->arate = 48000;
acodec = HB_ACODEC_FAAC;
- x264opts = strdup("bframes=3:ref=1:subme=5:me=umh:no-fast-pskip=1:trellis=2:cabac=0");
+ x264opts = strdup("bframes=3:ref=1:subme=5:me=umh:no-fast-pskip=1:trellis=1:cabac=0");
job->chapter_markers = 1;
pixelratio = 1;
}
job->abitrate = 160;
job->arate = 48000;
acodec = HB_ACODEC_FAAC;
- }
+ }
if (!strcmp(preset_name, "Constant Quality Rate"))
{
vcodec = HB_VCODEC_X264;
job->vbitrate = 1800;
acodec = HB_ACODEC_AC3;
- x264opts = strdup("ref=3:mixed-refs:bframes=16:bime:weightb:b-rdo:direct=auto:b-pyramid:me=umh:subme=6:analyse=all:8x8dct:trellis=1:no-fast-pskip");
+ x264opts = strdup("ref=3:mixed-refs:bframes=16:bime:weightb:b-rdo:direct=auto:b-pyramid:me=umh:subme=7:analyse=all:8x8dct:trellis=1:no-fast-pskip");
job->chapter_markers = 1;
pixelratio = 1;
twoPass = 1;
job->arate = 48000;
acodec = HB_ACODEC_FAAC;
job->width = 640;
- x264opts = strdup("keyint=300:keyint-min=30:bframes=0:cabac=0:ref=1:vbv-maxrate=1500:vbv-bufsize=2000:analyse=all:me=umh:subme=6:no-fast-pskip=1");
+ x264opts = strdup("bframes=0:cabac=0:ref=1:vbv-maxrate=1500:vbv-bufsize=2000:analyse=all:me=umh:subme=6:no-fast-pskip=1");
job->chapter_markers = 1;
}
job->arate = 48000;
acodec = HB_ACODEC_FAAC;
job->width = 320;
- x264opts = strdup("keyint=300:keyint-min=30:bframes=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:subme=6:no-fast-pskip=1");
+ x264opts = strdup("bframes=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:subme=6:no-fast-pskip=1");
job->chapter_markers = 1;
}
job->arate = 48000;
acodec = HB_ACODEC_FAAC;
x264opts = strdup("ref=3:mixed-refs:bframes=16:bime:weightb:direct=auto:b-pyramid:me=umh:subme=6:analyse=all:8x8dct:trellis=1:nr=150:no-fast-pskip");
+ deinterlace = 1;
+ deinterlace_opt = "2:-1:1";
+ denoise = 1;
+ denoise_opt = "2:1:2:3";
job->chapter_markers = 1;
- job->deinterlace = 1;
twoPass = 1;
turbo_opts_enabled = 1;
}
+
+ if (!strcmp(preset_name, "Xbox 360"))
+ {
+ mux = HB_MUX_MP4;
+ vcodec = HB_VCODEC_X264;
+ job->vbitrate = 2000;
+ job->abitrate = 160;
+ job->arate = 48000;
+ acodec = HB_ACODEC_FAAC;
+ x264opts = strdup("level=40:ref=3:mixed-refs:bframes=16:bime:weightb:b-rdo:direct=auto:b-pyramid:me=umh:subme=7:analyse=all:8x8dct:trellis=1:no-fast-pskip:filter=-2,-1");
+ pixelratio = 1;
+ }
}
if ( chapter_markers )
{
job->acodec = acodec;
}
-
+ if ( dynamic_range_compression )
+ {
+ job->dynamic_range_compression = dynamic_range_compression;
+ }
+
if( size )
{
job->vbitrate = hb_calc_bitrate( job, size );
{
job->mp4_optimize = 1;
}
+ if ( ipod_atom )
+ {
+ job->ipod_atom = 1;
+ }
job->file = strdup( output );
" -4, --large-file Use 64-bit mp4 files that can hold more than\n"
" 4 GB. Note: Breaks iPod, @TV, PS3 compatibility.\n"""
" -O, --optimize Optimize mp4 files for HTTP streaming\n"
+ " -I, --ipod-atom Mark mp4 files so iPods will accept them\n"
"\n"
"### Picture Settings---------------------------------------------------------\n\n"
" -e, --encoder <string> Set video library encoder (ffmpeg,xvid,\n"
" x264,x264b13,x264b30 default: ffmpeg)\n"
" -q, --quality <float> Set video quality (0.0..1.0)\n"
- " -Q, --crf Use with -q for CRF instead of CQP\n"
+ " -Q, --cqp Use with -q for CQP instead of CRF\n"
" -S, --size <MB> Set target size\n"
" -b, --vb <kb/s> Set video bitrate (default: 1000)\n"
" -r, --rate Set video framerate (" );
fprintf( stderr, "/" );
}
fprintf( stderr, " kHz)\n"
-
+ " -D, --drc <float> Apply extra dynamic range compression to the audio,\n"
+ " making soft sounds louder. Range is 1.0 to 4.0\n"
+ " (too loud), with 1.5 - 2.5 being a useful range.\n"
"\n"
****************************************************************************/
static void ShowPresets()
{
- printf("\n+ Animation: -e x264 -b 1000 -B 160 -R 48 -E faac -f mkv -m -d -p -2 -T -x ref=5:mixed-refs:bframes=16:bime:weightb:b-rdo:direct=auto:b-pyramid:me=umh:subme=5:analyse=all:8x8dct:trellis=1:nr=150:no-fast-pskip:filter=2,2\n");
+ printf("\n+ Animation: -e x264 -b 1000 -B 160 -R 48 -E faac -f mkv --deinterlace=\"slower\" -m -p -2 -T -x ref=5:mixed-refs:bframes=16:bime:weightb:b-rdo:direct=auto:b-pyramid:me=umh:subme=5:analyse=all:8x8dct:trellis=1:nr=150:no-fast-pskip:filter=2,2\n");
- printf("\n+ AppleTV: -e x264 -b 2500 -B 160 -R 48 -E faac -f mp4 -m -p -x bframes=3:ref=1:subme=5:me=umh:no-fast-pskip=1:trellis=2:cabac=0\n");
+ printf("\n+ AppleTV: -e x264 -b 2500 -B 160 -R 48 -E faac -f mp4 -m -p -x bframes=3:ref=1:subme=5:me=umh:no-fast-pskip=1:trellis=1:cabac=0\n");
printf("\n+ Bedlam: -e x264 -b 1800 -E ac3 -f mkv -m -p -2 -T -x ref=16:mixed-refs:bframes=16:bime:weightb:b-rdo:direct=auto:b-pyramid:me=umh:subme=7:me-range=64:analyse=all:8x8dct:trellis=2:no-fast-pskip:no-dct-decimate:filter=-2,-1\n");
printf("\n+ Deux Six Quatre: -e x264 -b 1600 -E ac3 -f mkv -m -p -2 -T -x ref=5:mixed-refs:bframes=3:bime:weightb:b-rdo:b-pyramid:me=umh:subme=7:trellis=1:analyse=all:8x8dct:no-fast-pskip\n");
- printf("\n+ Film: -e x264 -b 1800 -E ac3 -f mkv -m -p -2 -T -x ref=3:mixed-refs:bframes=16:bime:weightb:b-rdo:direct=auto:b-pyramid:me=umh:subme=6:analyse=all:8x8dct:trellis=1:no-fast-pskip\n");
+ printf("\n+ Film: -e x264 -b 1800 -E ac3 -f mkv -m -p -2 -T -x ref=3:mixed-refs:bframes=16:bime:weightb:b-rdo:direct=auto:b-pyramid:me=umh:subme=7:analyse=all:8x8dct:trellis=1:no-fast-pskip\n");
printf("\n+ iPhone / iPod Touch: -e x264b30 -b 960 -B 128 -R 48 -E faac -f mp4 -w 480 -m -x cabac=0:ref=1:analyse=all:me=umh:subme=6:no-fast-pskip=1:trellis=1\n");
- printf("\n+ iPod High-Rez: -e x264b30 -b 1500 -B 160 -R 48 -E faac -f mp4 -w 640 -m -x keyint=300:keyint-min=30:bframes=0:cabac=0:ref=1:vbv-maxrate=1500:vbv-bufsize=2000:analyse=all:me=umh:subme=6:no-fast-pskip=1\n");
+ printf("\n+ iPod High-Rez: -e x264b30 -b 1500 -B 160 -R 48 -E faac -f mp4 -w 640 -m -x bframes=0:cabac=0:ref=1:vbv-maxrate=1500:vbv-bufsize=2000:analyse=all:me=umh:subme=6:no-fast-pskip=1\n");
- printf("\n+ iPod Low-Rez: -e x264b30 -b 700 -B 160 -R 48 -E faac -f mp4 -w 320 -m -x keyint=300:keyint-min=30:bframes=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:subme=6:no-fast-pskip=1\n");
+ printf("\n+ iPod Low-Rez: -e x264b30 -b 700 -B 160 -R 48 -E faac -f mp4 -w 320 -m -x bframes=0:cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:subme=6:no-fast-pskip=1\n");
printf("\n+ Normal: -e x264 -b 1500 -B 160 -R 48 -E faac -f mp4 -m -p -2 -T -x ref=2:bframes=2:subme=5:me=umh\n");
printf("\n+ QuickTime: -e x264 -b 2000 -B 160 -R 48 -E faac -f mp4 -m -p -2 -T -x ref=3:mixed-refs:bframes=3:bime:weightb:b-rdo:direct=auto:me=umh:subme=5:analyse=all:trellis=1:no-fast-pskip\n");
- printf("\n+ Television: -e x264 -b 1300 -B 160 -R 48 -E faac -f mkv -m -d -2 -T -x ref=3:mixed-refs:bframes=16:bime:weightb:direct=auto:b-pyramid:me=umh:subme=6:analyse=all:8x8dct:trellis=1:nr=150:no-fast-pskip\n");
-
+ printf("\n+ Television: -e x264 -b 1300 -B 160 -R 48 -E faac -f mkv --deinterlace=\"slower\" --denoise=\"weak\" -m -2 -T -x ref=3:mixed-refs:bframes=16:bime:weightb:direct=auto:b-pyramid:me=umh:subme=6:analyse=all:8x8dct:trellis=1:nr=150:no-fast-pskip\n");
+
+ printf("\n+ Xbox 360: -e x264 -b 2000 -B 160 -R 48 -E faac -f mp4 -p -x level=40:ref=3:mixed-refs:bframes=16:bime:weightb:b-rdo:direct=auto:b-pyramid:me=umh:subme=7:analyse=all:8x8dct:trellis=1:no-fast-pskip:filter=-2,-1\n");
}
/****************************************************************************
{ "output", required_argument, NULL, 'o' },
{ "large-file", no_argument, NULL, '4' },
{ "optimize", no_argument, NULL, 'O' },
+ { "ipod-atom", no_argument, NULL, 'I' },
{ "title", required_argument, NULL, 't' },
{ "longest", no_argument, NULL, 'L' },
{ "markers", optional_argument, NULL, 'm' },
{ "audio", required_argument, NULL, 'a' },
{ "mixdown", required_argument, NULL, '6' },
+ { "drc", required_argument, NULL, 'D' },
{ "subtitle", required_argument, NULL, 's' },
{ "subtitle-scan", no_argument, NULL, 'U' },
{ "subtitle-forced", no_argument, NULL, 'F' },
{ "ab", required_argument, NULL, 'B' },
{ "rate", required_argument, NULL, 'r' },
{ "arate", required_argument, NULL, 'R' },
- { "crf", no_argument, NULL, 'Q' },
+ { "cqp", no_argument, NULL, 'Q' },
{ "x264opts", required_argument, NULL, 'x' },
{ "turbo", no_argument, NULL, 'T' },
{ "maxHeight", required_argument, NULL, 'Y' },
int option_index = 0;
int c;
- c = getopt_long( argc, argv,
- "hvuC:f:4i:o:t:Lc:ma:6:s:UFN:e:E:2d789gpOP::w:l:n:b:q:S:B:r:R:Qx:TY:X:VZ:z",
+ c = getopt_long( argc, argv,
+ "hvuC:f:4i:Io:t:Lc:m::a:6:s:UFN:e:E:2dD:789gpOP::w:l:n:b:q:S:B:r:R:Qx:TY:X:VZ:z",
long_options, &option_index );
if( c < 0 )
{
case 'O':
mp4_optimize = 1;
break;
-
+ case 'I':
+ ipod_atom = 1;
+ break;
+
case 't':
titleindex = atoi( optarg );
break;
audio_mixdown = HB_AMIXDOWN_6CH;
}
break;
+ case 'D':
+ dynamic_range_compression = atof( optarg );
+ break;
case 's':
sub = atoi( optarg );
break;
abitrate = atoi( optarg );
break;
case 'Q':
- crf = 1;
+ crf = 0;
break;
case 'x':
x264opts = strdup( optarg );