Add new static function to determine if video/audio codecs names are valid (#134)

This commit is contained in:
Jonathan Thomas
2018-06-28 21:57:56 -05:00
committed by GitHub
parent 079109f387
commit ef1fb6320b
2 changed files with 12 additions and 0 deletions

View File

@@ -296,6 +296,15 @@ void FFmpegWriter::SetOption(StreamType stream, string name, string value)
}
/// Determine if codec name is valid
bool FFmpegWriter::IsValidCodec(string codec_name) {
// Find the codec (if any)
if (avcodec_find_encoder_by_name(codec_name.c_str()) == NULL)
return false;
else
return true;
}
// Prepare & initialize streams and open codecs
void FFmpegWriter::PrepareStreams()
{