Added Xvid args

This commit is contained in:
Jaex 2019-11-18 02:41:18 +03:00
parent b53f4c2d1f
commit c35252b081
2 changed files with 10 additions and 0 deletions

View file

@ -47,6 +47,8 @@ public enum ConverterVideoCodecs
vp8,
[Description("VP9 (WebM)")]
vp9,
[Description("MPEG-4 / Xvid")]
xvid,
[Description("GIF")]
gif,
[Description("WebP")]

View file

@ -48,6 +48,8 @@ public string OutputFileNameExtension
case ConverterVideoCodecs.vp8:
case ConverterVideoCodecs.vp9:
return "webm";
case ConverterVideoCodecs.xvid:
return "avi";
case ConverterVideoCodecs.gif:
return "gif";
case ConverterVideoCodecs.webp:
@ -93,6 +95,9 @@ public string GetFFmpegArgs()
case ConverterVideoCodecs.vp9: // https://trac.ffmpeg.org/wiki/Encode/VP9
args.Append($"-c:v libvpx-vp9 -crf {VideoQuality.Clamp(0, 63)} -b:v 0 ");
break;
case ConverterVideoCodecs.xvid: // https://trac.ffmpeg.org/wiki/Encode/MPEG-4
args.Append($"-c:v libxvid -q:v {VideoQuality.Clamp(1, 31)} ");
break;
case ConverterVideoCodecs.gif: // https://ffmpeg.org/ffmpeg-filters.html#palettegen-1
args.Append("-lavfi \"palettegen=stats_mode=full[palette],[0:v][palette]paletteuse=dither=sierra2_4a\" ");
break;
@ -115,6 +120,9 @@ public string GetFFmpegArgs()
case ConverterVideoCodecs.vp9:
args.Append("-c:a libvorbis -q:a 3 ");
break;
case ConverterVideoCodecs.xvid: // https://trac.ffmpeg.org/wiki/Encode/MP3
args.Append("-c:a libmp3lame -q:a 4 ");
break;
}
// Output file path