Merge pull request #421 from ferdnyc/ffmpegwriter-opts

FFmpegWriter: Overload Set___Options() methods
This commit is contained in:
Jonathan Thomas
2020-02-27 15:27:31 -06:00
committed by GitHub
4 changed files with 115 additions and 12 deletions

View File

@@ -277,6 +277,14 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std::string codec, Fraction f
info.has_video = has_video;
}
// Set video export options (overloaded function)
void FFmpegWriter::SetVideoOptions(std::string codec, int width, int height, Fraction fps, int bit_rate) {
// Call full signature with some default parameters
FFmpegWriter::SetVideoOptions(true, codec, fps, width, height,
openshot::Fraction(1, 1), false, true, bit_rate);
}
// Set audio export options
void FFmpegWriter::SetAudioOptions(bool has_audio, std::string codec, int sample_rate, int channels, ChannelLayout channel_layout, int bit_rate) {
// Set audio options
@@ -312,6 +320,15 @@ void FFmpegWriter::SetAudioOptions(bool has_audio, std::string codec, int sample
info.has_audio = has_audio;
}
// Set audio export options (overloaded function)
void FFmpegWriter::SetAudioOptions(std::string codec, int sample_rate, int bit_rate) {
// Call full signature with some default parameters
FFmpegWriter::SetAudioOptions(true, codec, sample_rate, 2,
openshot::LAYOUT_STEREO, bit_rate);
}
// Set custom options (some codecs accept additional params)
void FFmpegWriter::SetOption(StreamType stream, std::string name, std::string value) {
// Declare codec context