diff options
author | sr55 <[email protected]> | 2013-06-08 18:55:32 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-06-08 18:55:32 +0000 |
commit | 268a50dbe56d66957bca717f8a3c1908ddea7f0a (patch) | |
tree | 1cae4d300badfb6bb30a9faef4c2bfc581a15e64 | |
parent | bf71f7590e716bee6bc944db9084c8237610f7f5 (diff) |
Experimental preset for Windows Phone 8 Devices. Would be appreciated that anyone with a W8 Phone provides feedback.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5573 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/HBPresets.m | 105 | ||||
-rw-r--r-- | test/test.c | 71 |
2 files changed, 175 insertions, 1 deletions
diff --git a/macosx/HBPresets.m b/macosx/HBPresets.m index 0281a4365..a97284b11 100644 --- a/macosx/HBPresets.m +++ b/macosx/HBPresets.m @@ -60,6 +60,7 @@ [childrenArray addObject:[self createAppleTV3Preset]]; [childrenArray addObject:[self createAndroidPreset]]; [childrenArray addObject:[self createAndroidTabletPreset]]; + [childrenArray addObject:[self createW8PhonePreset]]; /* Add the individual presets to the folder */ [preset setObject:[NSMutableArray arrayWithArray:childrenArray] @@ -1081,6 +1082,110 @@ return preset; } +- (NSDictionary *)createW8PhonePreset +{ + NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; + + /* Preset properties (name, type: factory/user, default, folder, tooltip) */ + [preset setObject:@"Windows Phone 8" forKey:@"PresetName"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"Type"]; //factory + [preset setObject:[NSNumber numberWithInt:0] forKey:@"Default"]; + [preset setObject:[NSNumber numberWithBool:NO] forKey:@"Folder"]; + [preset setObject:@"HandBrake's preset for Windows Phone 8 devices" + forKey:@"PresetDescription"]; + + /* Container format and related settings */ + [preset setObject:@"MP4 file" forKey:@"FileFormat"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"Mp4LargeFile"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"Mp4HttpOptimize"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"Mp4iPodCompatible"]; + + /* Chapter markers */ + [preset setObject:[NSNumber numberWithInt:0] forKey:@"ChapterMarkers"]; + + /* Video encoder and advanced options */ + [preset setObject:@"H.264 (x264)" forKey:@"VideoEncoder"]; + [preset setObject:@"" forKey:@"lavcOption"]; + [preset setObject:@"" forKey:@"x264Option"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"x264UseAdvancedOptions"]; + [preset setObject:@"medium" forKey:@"x264Preset"]; + [preset setObject:@"" forKey:@"x264Tune"]; + [preset setObject:@"" forKey:@"x264OptionExtra"]; + [preset setObject:@"main" forKey:@"h264Profile"]; + [preset setObject:@"3.1" forKey:@"h264Level"]; + + /* Video rate control */ + [preset setObject:@"2500" forKey:@"VideoAvgBitrate"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"VideoTwoPass"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"VideoTurboTwoPass"]; + [preset setObject:[NSNumber numberWithInt:2] forKey:@"VideoQualityType"]; //cq + [preset setObject:[NSNumber numberWithFloat:22.0] forKey:@"VideoQualitySlider"]; + + /* Video frame rate */ + [preset setObject:@"30" forKey:@"VideoFramerate"]; + [preset setObject:@"pfr" forKey:@"VideoFramerateMode"]; + + /* Picture size */ + [preset setObject:[NSNumber numberWithInt:1] forKey:@"UsesPictureSettings"]; + [preset setObject:[NSNumber numberWithInt:1280] forKey:@"PictureWidth"]; + [preset setObject:[NSNumber numberWithInt:720] forKey:@"PictureHeight"]; + [preset setObject:[NSNumber numberWithInt:2] forKey:@"PicturePAR"]; //loose + [preset setObject:[NSNumber numberWithInt:2] forKey:@"PictureModulus"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureKeepRatio"]; //set to 0 for Loose (FIXME: why?) + + /* Picture filters */ + [preset setObject:[NSNumber numberWithInt:1] forKey:@"UsesPictureFilters"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureDecomb"]; //off + [preset setObject:@"" forKey:@"PictureDecombCustom"]; + [preset setObject:[NSNumber numberWithInt:1] forKey:@"PictureDecombDeinterlace"]; //decomb + [preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureDeinterlace"]; + [preset setObject:@"" forKey:@"PictureDeinterlaceCustom"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureDetelecine"]; + [preset setObject:@"" forKey:@"PictureDetelecineCustom"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureDenoise"]; + [preset setObject:@"" forKey:@"PictureDenoiseCustom"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureDeblock"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"VideoGrayScale"]; + + /* Picture crop */ + [preset setObject:[NSNumber numberWithInt:1] forKey:@"PictureAutoCrop"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureTopCrop"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureBottomCrop"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureLeftCrop"]; + [preset setObject:[NSNumber numberWithInt:0] forKey:@"PictureRightCrop"]; + + /* Auto Passthru */ + [preset setObject:@"AC3 (ffmpeg)" forKey:@"AudioEncoderFallback"]; + [preset setObject:[NSNumber numberWithInt:1] forKey:@"AudioAllowAACPass"]; + [preset setObject:[NSNumber numberWithInt:1] forKey:@"AudioAllowAC3Pass"]; + [preset setObject:[NSNumber numberWithInt:1] forKey:@"AudioAllowDTSHDPass"]; + [preset setObject:[NSNumber numberWithInt:1] forKey:@"AudioAllowDTSPass"]; + [preset setObject:[NSNumber numberWithInt:1] forKey:@"AudioAllowMP3Pass"]; + + /* Audio track list - no need to add "None" at the end */ + NSMutableArray *audioListArray = [[NSMutableArray alloc] init]; + /* Track 1 */ + NSMutableDictionary *audioTrack1Array = [[NSMutableDictionary alloc] init]; + [audioTrack1Array setObject:[NSNumber numberWithInt:1] forKey:@"AudioTrack"]; + [audioTrack1Array setObject:@"AAC (faac)" forKey:@"AudioEncoder"]; + [audioTrack1Array setObject:@"Dolby Pro Logic II" forKey:@"AudioMixdown"]; + [audioTrack1Array setObject:@"Auto" forKey:@"AudioSamplerate"]; + [audioTrack1Array setObject:@"128" forKey:@"AudioBitrate"]; + [audioTrack1Array setObject:[NSNumber numberWithFloat:0.0] forKey:@"AudioTrackGainSlider"]; + [audioTrack1Array setObject:[NSNumber numberWithFloat:0.0] forKey:@"AudioTrackDRCSlider"]; + [audioTrack1Array autorelease]; + [audioListArray addObject:audioTrack1Array]; + /* Add the audio track(s) to the preset's audio list */ + [preset setObject:[NSMutableArray arrayWithArray:audioListArray] forKey:@"AudioList"]; + + /* Subtitles (note: currently ignored) */ + [preset setObject:@"None" forKey:@"Subtitles"]; + + /* Clean up and return the preset */ + [preset autorelease]; + return preset; +} + - (NSDictionary *)createNormalPreset { NSMutableDictionary *preset = [[NSMutableDictionary alloc] init]; diff --git a/test/test.c b/test/test.c index 6508918e4..aaa68045e 100644 --- a/test/test.c +++ b/test/test.c @@ -1329,6 +1329,74 @@ static int HandleEvents( hb_handle_t * h ) } modulus = 2; } + if (!strcasecmp(preset_name, "Windows Phone 8")) + { + if( !mux ) + { + mux = HB_MUX_MP4; + } + vcodec = HB_VCODEC_X264; + job->vquality = 22.0; + filter_vrate_base = 900000; + filter_cfr = 2; + if( !atracks ) + { + atracks = strdup("1"); + } + if( !acodecs ) + { + acodecs = strdup("faac"); + } + if( !abitrates ) + { + abitrates = str_split("128", ','); + } + if( !mixdowns ) + { + mixdowns = strdup("dpl2"); + } + if( !arates ) + { + arates = strdup("Auto"); + } + if( !dynamic_range_compression ) + { + dynamic_range_compression = strdup("0.0"); + } + if( allowed_audio_copy == -1 ) + { + allowed_audio_copy = 0; + allowed_audio_copy |= HB_ACODEC_AAC_PASS; + allowed_audio_copy |= HB_ACODEC_AC3_PASS; + allowed_audio_copy |= HB_ACODEC_DCA_HD_PASS; + allowed_audio_copy |= HB_ACODEC_DCA_PASS; + allowed_audio_copy |= HB_ACODEC_MP3_PASS; + allowed_audio_copy &= HB_ACODEC_PASS_MASK; + } + if( acodec_fallback == NULL ) + { + acodec_fallback = "ffac3"; + } + maxWidth = 1280; + maxHeight = 720; + if (x264_preset == NULL) + { + x264_preset = strdup("medium"); + } + if (h264_profile == NULL) + { + h264_profile = strdup("main"); + } + if (h264_level == NULL) + { + h264_level = strdup("3.1"); + } + if( !anamorphic_mode ) + { + anamorphic_mode = 2; + } + modulus = 2; + } if (!strcasecmp(preset_name, "Normal")) { if( !mux ) @@ -3369,7 +3437,8 @@ static void ShowPresets() printf("\n + AppleTV 3: -e x264 -q 20.0 -r 30 --pfr -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -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 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -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 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -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 + Windows Phone 8: -e x264 -q 22.0 -r 30 --pfr -a 1 -E faac -B 128 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -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 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -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,none -R Auto,Auto -D 0.0,0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 -4 --decomb --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.1\n"); |