|
@@ -18,8 +18,11 @@ namespace Publicate.Video {
|
|
return info.height >= 720;
|
|
return info.height >= 720;
|
|
}
|
|
}
|
|
public override void setup_for (VideoInfo info) {
|
|
public override void setup_for (VideoInfo info) {
|
|
- codec_names = "avc1.64001f, mp4a.40.2";
|
|
|
|
|
|
+ codec_names = "avc1.42c028, mp4a.40.2";
|
|
var width = (int) (info.ratio_frac * 720);
|
|
var width = (int) (info.ratio_frac * 720);
|
|
|
|
+ if(width % 2 != 0) {
|
|
|
|
+ width++;
|
|
|
|
+ }
|
|
size = @"$(width)x720";
|
|
size = @"$(width)x720";
|
|
fps = get_low_framerate (info.frame_rate);
|
|
fps = get_low_framerate (info.frame_rate);
|
|
}
|
|
}
|
|
@@ -33,12 +36,12 @@ namespace Publicate.Video {
|
|
"-pix_fmt", "yuv420p",
|
|
"-pix_fmt", "yuv420p",
|
|
"-profile:v", "baseline",
|
|
"-profile:v", "baseline",
|
|
"-movflags", "+faststart",
|
|
"-movflags", "+faststart",
|
|
- "-b:v", "1024k",
|
|
|
|
- "-minrate", "512k",
|
|
|
|
- "-maxrate", "1485k",
|
|
|
|
|
|
+ "-b:v", "750k",
|
|
|
|
+ "-minrate", "375k",
|
|
|
|
+ "-maxrate", "1088k",
|
|
"-threads", get_num_processors().to_string(),
|
|
"-threads", get_num_processors().to_string(),
|
|
- "-preset", "slow",
|
|
|
|
- "-crf", "33",
|
|
|
|
|
|
+ "-preset", "slower",
|
|
|
|
+ "-crf", "39",
|
|
"-c:v", "libx264",
|
|
"-c:v", "libx264",
|
|
"-c:a", "aac",
|
|
"-c:a", "aac",
|
|
"-pass", pass.to_string(),
|
|
"-pass", pass.to_string(),
|
|
@@ -64,11 +67,14 @@ namespace Publicate.Video {
|
|
return @"480p H.264";
|
|
return @"480p H.264";
|
|
}
|
|
}
|
|
public override bool suitable_for (VideoInfo info) {
|
|
public override bool suitable_for (VideoInfo info) {
|
|
- return info.height >= 720;
|
|
|
|
|
|
+ return info.height >= 480;
|
|
}
|
|
}
|
|
public override void setup_for (VideoInfo info) {
|
|
public override void setup_for (VideoInfo info) {
|
|
- codec_names = "avc1.64001f, mp4a.40.2";
|
|
|
|
- var width = (int) (info.ratio_frac * 720);
|
|
|
|
|
|
+ codec_names = "avc1.42c01f, mp4a.40.2";
|
|
|
|
+ var width = (int) (info.ratio_frac * 480);
|
|
|
|
+ if(width % 2 != 0) {
|
|
|
|
+ width++;
|
|
|
|
+ }
|
|
size = @"$(width)x480";
|
|
size = @"$(width)x480";
|
|
fps = get_low_framerate (info.frame_rate);
|
|
fps = get_low_framerate (info.frame_rate);
|
|
}
|
|
}
|
|
@@ -82,12 +88,64 @@ namespace Publicate.Video {
|
|
"-pix_fmt", "yuv420p",
|
|
"-pix_fmt", "yuv420p",
|
|
"-profile:v", "baseline",
|
|
"-profile:v", "baseline",
|
|
"-movflags", "+faststart",
|
|
"-movflags", "+faststart",
|
|
- "-b:v", "750k",
|
|
|
|
- "-minrate", "375k",
|
|
|
|
- "-maxrate", "1088k",
|
|
|
|
|
|
+ "-b:v", "500k",
|
|
|
|
+ "-minrate", "175k",
|
|
|
|
+ "-maxrate", "750k",
|
|
|
|
+ "-threads", get_num_processors().to_string(),
|
|
|
|
+ "-preset", "slower",
|
|
|
|
+ "-crf", "42",
|
|
|
|
+ "-c:v", "libx264",
|
|
|
|
+ "-c:a", "aac",
|
|
|
|
+ "-pass", pass.to_string(),
|
|
|
|
+ "-passlogfile", @"$(output_path).logfile",
|
|
|
|
+ "-y",
|
|
|
|
+ output_path
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public class H264Video240pProfile : EncodingProfile {
|
|
|
|
+
|
|
|
|
+ public override string[] get_first_pass_command (string input_path, string output_path) {
|
|
|
|
+ return get_command (input_path, output_path, 1);
|
|
|
|
+ }
|
|
|
|
+ public override string[] get_second_pass_command (string input_path, string output_path) {
|
|
|
|
+ return get_command (input_path, output_path, 2);
|
|
|
|
+ }
|
|
|
|
+ public override string output_name () {
|
|
|
|
+ return @"240p.mp4";
|
|
|
|
+ }
|
|
|
|
+ public override string version_label (){
|
|
|
|
+ return @"240p H.264";
|
|
|
|
+ }
|
|
|
|
+ public override bool suitable_for (VideoInfo info) {
|
|
|
|
+ return info.height >= 240;
|
|
|
|
+ }
|
|
|
|
+ public override void setup_for (VideoInfo info) {
|
|
|
|
+ codec_names = "avc1.42c015, mp4a.40.2";
|
|
|
|
+ var width = (int) (info.ratio_frac * 240);
|
|
|
|
+ if(width % 2 != 0) {
|
|
|
|
+ width++;
|
|
|
|
+ }
|
|
|
|
+ size = @"$(width)x240";
|
|
|
|
+ fps = get_low_framerate (info.frame_rate);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private string[] get_command(string input_path, string output_path, int pass) {
|
|
|
|
+ return new string[] {
|
|
|
|
+ "ffmpeg",
|
|
|
|
+ "-i", input_path,
|
|
|
|
+ "-r", fps.to_string(),
|
|
|
|
+ "-vf", @"scale=$(size)",
|
|
|
|
+ "-pix_fmt", "yuv420p",
|
|
|
|
+ "-profile:v", "baseline",
|
|
|
|
+ "-movflags", "+faststart",
|
|
|
|
+ "-b:v", "125k",
|
|
|
|
+ "-minrate", "70k",
|
|
|
|
+ "-maxrate", "425k",
|
|
"-threads", get_num_processors().to_string(),
|
|
"-threads", get_num_processors().to_string(),
|
|
- "-preset", "slow",
|
|
|
|
- "-crf", "34",
|
|
|
|
|
|
+ "-preset", "slower",
|
|
|
|
+ "-crf", "48",
|
|
"-c:v", "libx264",
|
|
"-c:v", "libx264",
|
|
"-c:a", "aac",
|
|
"-c:a", "aac",
|
|
"-pass", pass.to_string(),
|
|
"-pass", pass.to_string(),
|