Conflicts:
	ScreenCaptureLib/Screencast/FFmpegOptionsForm.Designer.cs
This commit is contained in:
mcored 2014-05-14 20:14:39 +08:00
commit c123d56861
4 changed files with 14 additions and 29 deletions

View file

@ -78,10 +78,10 @@ public FFmpegOptions()
// XviD // XviD
XviD_qscale = 3; XviD_qscale = 3;
// Vorbis // Audio
Vorbis_qscale = 3; Vorbis_qscale = 3;
MP3_qscale = 4; MP3_qscale = 4;
AAC_bitrate = 64; AAC_bitrate = 128;
} }
public bool IsAudioSourceSelected() public bool IsAudioSourceSelected()

View file

@ -176,8 +176,6 @@ public void UpdateExtensions()
cbExtension.Items.Add("avi"); cbExtension.Items.Add("avi");
cbExtension.SelectedIndex = 0; cbExtension.SelectedIndex = 0;
tcFFmpegVideoCodecs.SelectedIndex = (int)Options.FFmpeg.VideoCodec;
} }
private void UpdateUI() private void UpdateUI()

View file

@ -121,8 +121,8 @@
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<data name="nudx264CRF.ToolTip" xml:space="preserve"> <data name="nudx264CRF.ToolTip" xml:space="preserve">
<value>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. <value>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. 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.</value> 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.</value>
</data> </data>
</root> </root>

View file

@ -124,10 +124,17 @@ public string GetFFmpegArgs()
if (FFmpeg.IsAudioSourceSelected()) if (FFmpeg.IsAudioSourceSelected())
{ {
string audioString = GetAudioString(); switch (FFmpeg.AudioCodec)
if (!string.IsNullOrEmpty(audioString))
{ {
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(); 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();
}
} }
} }