diff --git a/ScreenCaptureLib/Screencast/FFmpegOptions.cs b/ScreenCaptureLib/Screencast/FFmpegOptions.cs index 84ef38d1d..55ece17da 100644 --- a/ScreenCaptureLib/Screencast/FFmpegOptions.cs +++ b/ScreenCaptureLib/Screencast/FFmpegOptions.cs @@ -78,10 +78,10 @@ public FFmpegOptions() // XviD XviD_qscale = 3; - // Vorbis + // Audio Vorbis_qscale = 3; MP3_qscale = 4; - AAC_bitrate = 64; + AAC_bitrate = 128; } public bool IsAudioSourceSelected() diff --git a/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs b/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs index 3d9af9baa..16d85f14d 100644 --- a/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs +++ b/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs @@ -176,8 +176,6 @@ public void UpdateExtensions() cbExtension.Items.Add("avi"); cbExtension.SelectedIndex = 0; - - tcFFmpegVideoCodecs.SelectedIndex = (int)Options.FFmpeg.VideoCodec; } private void UpdateUI() diff --git a/ScreenCaptureLib/Screencast/FFmpegOptionsForm.resx b/ScreenCaptureLib/Screencast/FFmpegOptionsForm.resx index 93beca915..0839679e7 100644 --- a/ScreenCaptureLib/Screencast/FFmpegOptionsForm.resx +++ b/ScreenCaptureLib/Screencast/FFmpegOptionsForm.resx @@ -121,8 +121,8 @@ 17, 17 - Constant Rate Factor (CRF): The range of the quantizer scale is 0-51: where 0 is lossless, 23 is default, and 51 is worst possible. -A lower value is a higher quality and a subjectively sane range is 18-28. + Constant Rate Factor (CRF): The range of the quantizer scale is 0-51: where 0 is lossless, 23 is default, and 51 is worst possible. +A lower value is a higher quality and a subjectively sane range is 18-28. Consider 18 to be visually lossless or nearly so: it should look the same or nearly the same as the input but it isn't technically lossless. \ No newline at end of file diff --git a/ScreenCaptureLib/Screencast/ScreencastOptions.cs b/ScreenCaptureLib/Screencast/ScreencastOptions.cs index 92d7d3ea0..0c3c4137c 100644 --- a/ScreenCaptureLib/Screencast/ScreencastOptions.cs +++ b/ScreenCaptureLib/Screencast/ScreencastOptions.cs @@ -124,10 +124,17 @@ public string GetFFmpegArgs() if (FFmpeg.IsAudioSourceSelected()) { - string audioString = GetAudioString(); - if (!string.IsNullOrEmpty(audioString)) + switch (FFmpeg.AudioCodec) { - args.Append(audioString); + case FFmpegAudioCodec.libvorbis: // http://trac.ffmpeg.org/wiki/TheoraVorbisEncodingGuide + args.AppendFormat("-c:a {0} -qscale:a {1} ", FFmpegAudioCodec.libvorbis.ToString(), FFmpeg.Vorbis_qscale); + break; + case FFmpegAudioCodec.libmp3lame: // http://trac.ffmpeg.org/wiki/Encoding%20VBR%20(Variable%20Bit%20Rate)%20mp3%20audio + args.AppendFormat("-c:a {0} -qscale:a {1} ", FFmpegAudioCodec.libmp3lame.ToString(), FFmpeg.MP3_qscale); + break; + case FFmpegAudioCodec.libvoaacenc: // http://trac.ffmpeg.org/wiki/AACEncodingGuide + args.AppendFormat("-ac 2 -c:a libvo_aacenc -b:a {0}k ", FFmpeg.AAC_bitrate); // -ac 2 required otherwise failing with 7.1 + break; } } @@ -143,25 +150,5 @@ public string GetFFmpegArgs() return args.ToString(); } - - private string GetAudioString() - { - StringBuilder sbAudioString = new StringBuilder(); - - switch (FFmpeg.AudioCodec) - { - case FFmpegAudioCodec.libvorbis: - sbAudioString.AppendFormat("-c:a {0} -qscale:a {1} ", FFmpegAudioCodec.libvorbis.ToString(), FFmpeg.Vorbis_qscale); - break; - case FFmpegAudioCodec.libmp3lame: - sbAudioString.AppendFormat("-c:a {0} -qscale:a {1} ", FFmpegAudioCodec.libmp3lame.ToString(), FFmpeg.MP3_qscale); - break; - case FFmpegAudioCodec.libvoaacenc: - sbAudioString.AppendFormat("-ac 2 -c:a {0} -b:a {1}k ", "libvo_aacenc", FFmpeg.AAC_bitrate); - break; - } - - return sbAudioString.ToString(); - } } } \ No newline at end of file