CLI: update built-in presets.
manicure: strcmp -> strcasecmp, makes preset names case-insensitive. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5301 b64f7644-9d1e-0410-96f1-a4d463321fa5
This commit is contained in:
parent
447eb9d29a
commit
2df5f7e5d6
@ -998,7 +998,7 @@ class Display
|
||||
|
||||
def generateAPIcalls(hash) # Makes a C version of the preset ready for coding into the CLI
|
||||
|
||||
commandString = "if (!strcmp(preset_name, \"" << hash["PresetName"] << "\"))\n{\n "
|
||||
commandString = "if (!strcasecmp(preset_name, \"" << hash["PresetName"] << "\"))\n{\n "
|
||||
|
||||
#Filename suffix
|
||||
commandString << "if( !mux )\n "
|
||||
|
64
test/test.c
64
test/test.c
@ -705,7 +705,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
{
|
||||
fprintf( stderr, "+ Using preset: %s\n", preset_name);
|
||||
|
||||
if (!strcmp(preset_name, "Universal"))
|
||||
if (!strcasecmp(preset_name, "Universal"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -740,6 +740,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
dynamic_range_compression = strdup("0.0,0.0");
|
||||
}
|
||||
maxWidth = 720;
|
||||
maxHeight = 576;
|
||||
if (x264_preset == NULL)
|
||||
{
|
||||
x264_preset = strdup("fast");
|
||||
@ -759,7 +760,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
modulus = 2;
|
||||
job->chapter_markers = 1;
|
||||
}
|
||||
if (!strcmp(preset_name, "iPod"))
|
||||
if (!strcasecmp(preset_name, "iPod"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -795,6 +796,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
dynamic_range_compression = strdup("0.0");
|
||||
}
|
||||
maxWidth = 320;
|
||||
maxHeight = 240;
|
||||
if (x264_preset == NULL)
|
||||
{
|
||||
x264_preset = strdup("medium");
|
||||
@ -810,7 +812,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
modulus = 2;
|
||||
job->chapter_markers = 1;
|
||||
}
|
||||
if (!strcmp(preset_name, "iPhone & iPod Touch"))
|
||||
if (!strcasecmp(preset_name, "iPhone & iPod touch"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -819,7 +821,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
job->largeFileSize = 1;
|
||||
vcodec = HB_VCODEC_X264;
|
||||
job->vquality = 22.0;
|
||||
job->vrate_base = 900900;
|
||||
job->vrate_base = 900000;
|
||||
job->cfr = 2;
|
||||
if( !atracks )
|
||||
{
|
||||
@ -846,6 +848,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
dynamic_range_compression = strdup("0.0");
|
||||
}
|
||||
maxWidth = 960;
|
||||
maxHeight = 640;
|
||||
if (x264_preset == NULL)
|
||||
{
|
||||
x264_preset = strdup("medium");
|
||||
@ -865,7 +868,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
modulus = 2;
|
||||
job->chapter_markers = 1;
|
||||
}
|
||||
if (!strcmp(preset_name, "iPad"))
|
||||
if (!strcasecmp(preset_name, "iPad"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -874,7 +877,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
job->largeFileSize = 1;
|
||||
vcodec = HB_VCODEC_X264;
|
||||
job->vquality = 20.0;
|
||||
job->vrate_base = 900900;
|
||||
job->vrate_base = 900000;
|
||||
job->cfr = 2;
|
||||
if( !atracks )
|
||||
{
|
||||
@ -901,6 +904,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
dynamic_range_compression = strdup("0.0");
|
||||
}
|
||||
maxWidth = 1280;
|
||||
maxHeight = 720;
|
||||
if (x264_preset == NULL)
|
||||
{
|
||||
x264_preset = strdup("medium");
|
||||
@ -920,7 +924,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
modulus = 2;
|
||||
job->chapter_markers = 1;
|
||||
}
|
||||
if (!strcmp(preset_name, "AppleTV"))
|
||||
if (!strcasecmp(preset_name, "AppleTV"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -956,6 +960,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
dynamic_range_compression = strdup("0.0,0.0");
|
||||
}
|
||||
maxWidth = 960;
|
||||
maxHeight = 720;
|
||||
if (x264_preset == NULL)
|
||||
{
|
||||
x264_preset = strdup("medium");
|
||||
@ -970,7 +975,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
}
|
||||
if (advanced_opts == NULL)
|
||||
{
|
||||
advanced_opts = strdup("cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500");
|
||||
advanced_opts = strdup("qpmin=4:cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500");
|
||||
}
|
||||
if( !anamorphic_mode )
|
||||
{
|
||||
@ -979,7 +984,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
modulus = 2;
|
||||
job->chapter_markers = 1;
|
||||
}
|
||||
if (!strcmp(preset_name, "AppleTV 2"))
|
||||
if (!strcasecmp(preset_name, "AppleTV 2"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -988,7 +993,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
job->largeFileSize = 1;
|
||||
vcodec = HB_VCODEC_X264;
|
||||
job->vquality = 20.0;
|
||||
job->vrate_base = 900900;
|
||||
job->vrate_base = 900000;
|
||||
job->cfr = 2;
|
||||
if( !atracks )
|
||||
{
|
||||
@ -1015,6 +1020,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
dynamic_range_compression = strdup("0.0,0.0");
|
||||
}
|
||||
maxWidth = 1280;
|
||||
maxHeight = 720;
|
||||
if (x264_preset == NULL)
|
||||
{
|
||||
x264_preset = strdup("medium");
|
||||
@ -1034,7 +1040,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
modulus = 2;
|
||||
job->chapter_markers = 1;
|
||||
}
|
||||
if (!strcmp(preset_name, "AppleTV 3"))
|
||||
if (!strcasecmp(preset_name, "AppleTV 3"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -1070,6 +1076,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
dynamic_range_compression = strdup("0.0,0.0");
|
||||
}
|
||||
maxWidth = 1920;
|
||||
maxHeight = 1080;
|
||||
if (x264_preset == NULL)
|
||||
{
|
||||
x264_preset = strdup("medium");
|
||||
@ -1091,7 +1098,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
modulus = 2;
|
||||
job->chapter_markers = 1;
|
||||
}
|
||||
if (!strcmp(preset_name, "Android"))
|
||||
if (!strcasecmp(preset_name, "Android"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -1099,7 +1106,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
}
|
||||
vcodec = HB_VCODEC_X264;
|
||||
job->vquality = 22.0;
|
||||
job->vrate_base = 900900;
|
||||
job->vrate_base = 900000;
|
||||
job->cfr = 2;
|
||||
if( !atracks )
|
||||
{
|
||||
@ -1126,6 +1133,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
dynamic_range_compression = strdup("0.0");
|
||||
}
|
||||
maxWidth = 720;
|
||||
maxHeight = 576;
|
||||
if (x264_preset == NULL)
|
||||
{
|
||||
x264_preset = strdup("medium");
|
||||
@ -1136,7 +1144,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
}
|
||||
if (h264_level == NULL)
|
||||
{
|
||||
h264_level = strdup("2.2");
|
||||
h264_level = strdup("3.0");
|
||||
}
|
||||
if( !anamorphic_mode )
|
||||
{
|
||||
@ -1144,7 +1152,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
}
|
||||
modulus = 2;
|
||||
}
|
||||
if (!strcmp(preset_name, "Android Tablet"))
|
||||
if (!strcasecmp(preset_name, "Android Tablet"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -1152,7 +1160,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
}
|
||||
vcodec = HB_VCODEC_X264;
|
||||
job->vquality = 22.0;
|
||||
job->vrate_base = 900900;
|
||||
job->vrate_base = 900000;
|
||||
job->cfr = 2;
|
||||
if( !atracks )
|
||||
{
|
||||
@ -1179,6 +1187,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
dynamic_range_compression = strdup("0.0");
|
||||
}
|
||||
maxWidth = 1280;
|
||||
maxHeight = 720;
|
||||
if (x264_preset == NULL)
|
||||
{
|
||||
x264_preset = strdup("medium");
|
||||
@ -1197,7 +1206,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
}
|
||||
modulus = 2;
|
||||
}
|
||||
if (!strcmp(preset_name, "Normal"))
|
||||
if (!strcasecmp(preset_name, "Normal"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -1248,7 +1257,7 @@ static int HandleEvents( hb_handle_t * h )
|
||||
modulus = 2;
|
||||
job->chapter_markers = 1;
|
||||
}
|
||||
if (!strcmp(preset_name, "High Profile"))
|
||||
if (!strcasecmp(preset_name, "High Profile"))
|
||||
{
|
||||
if( !mux )
|
||||
{
|
||||
@ -3162,21 +3171,20 @@ static void ShowPresets()
|
||||
fprintf( stderr, "%s - %s - %s\n", HB_PROJECT_TITLE, HB_PROJECT_BUILD_TITLE, HB_PROJECT_URL_WEBSITE );
|
||||
|
||||
printf("\n< Devices\n");
|
||||
printf("\n + Universal: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 -X 720 --loose-anamorphic --modulus 2 -m --x264-preset fast --h264-profile baseline --h264-level 3.0\n");
|
||||
printf("\n + iPod: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 -f mp4 -I -X 320 --modulus 2 -m --x264-preset medium --h264-profile baseline --h264-level 1.3\n");
|
||||
printf("\n + iPhone & iPod Touch: -e x264 -q 22.0 -r 29.97 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 -f mp4 -4 -X 960 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n");
|
||||
printf("\n + iPad: -e x264 -q 20.0 -r 29.97 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 -f mp4 -4 -X 1280 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n");
|
||||
printf("\n + AppleTV: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 -4 -X 960 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1 -x cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500\n");
|
||||
printf("\n + AppleTV 2: -e x264 -q 20.0 -r 29.97 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 -4 -X 1280 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n");
|
||||
printf("\n + AppleTV 3: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 -4 -X 1920 --decomb=fast --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.0\n");
|
||||
printf("\n + Android: -e x264 -q 22.0 -r 29.97 --pfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0.0 -f mp4 -X 720 --loose-anamorphic --modulus 2 --x264-preset medium --h264-profile main --h264-level 2.2\n");
|
||||
printf("\n + Android Tablet: -e x264 -q 22.0 -r 29.97 --pfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0.0 -f mp4 -X 1280 --loose-anamorphic --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.1\n");
|
||||
printf("\n + Universal: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 -X 720 -Y 576 --loose-anamorphic --modulus 2 -m --x264-preset fast --h264-profile baseline --h264-level 3.0\n");
|
||||
printf("\n + iPod: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 -f mp4 -I -X 320 -Y 240 --modulus 2 -m --x264-preset medium --h264-profile baseline --h264-level 1.3\n");
|
||||
printf("\n + iPhone & iPod touch: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 -f mp4 -4 -X 960 -Y 640 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n");
|
||||
printf("\n + iPad: -e x264 -q 20.0 -r 30 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 -f mp4 -4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n");
|
||||
printf("\n + AppleTV: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 -4 -X 960 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1 -x qpmin=4:cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500\n");
|
||||
printf("\n + AppleTV 2: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 -4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 3.1\n");
|
||||
printf("\n + AppleTV 3: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 -4 -X 1920 -Y 1080 --decomb=fast --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.0\n");
|
||||
printf("\n + Android: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0.0 -f mp4 -X 720 -Y 576 --loose-anamorphic --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.0\n");
|
||||
printf("\n + Android Tablet: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0.0 -f mp4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 --x264-preset medium --h264-profile main --h264-level 3.1\n");
|
||||
printf("\n>\n");
|
||||
printf("\n< Regular\n");
|
||||
printf("\n + Normal: -e x264 -q 20.0 -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 -f mp4 --loose-anamorphic --modulus 2 -m --x264-preset veryfast --h264-profile main --h264-level 4.0\n");
|
||||
printf("\n + High Profile: -e x264 -q 20.0 -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 -4 --decomb --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.1\n");
|
||||
printf("\n>\n");
|
||||
|
||||
}
|
||||
|
||||
static char * hb_strndup( char * str, int len )
|
||||
|
Loading…
x
Reference in New Issue
Block a user