Transcode, limit output birate to the media bitrate (no need to upscale)

This commit is contained in:
emeric
2014-09-01 14:59:07 +02:00
parent 07624995e7
commit c8837d6d68
10 changed files with 84 additions and 30 deletions
+14
View File
@@ -53,6 +53,7 @@ InputMediaFile::InputMediaFile(const boost::filesystem::path& p)
_streams.push_back( Stream(avStreamId,
type,
avStream.getCodecContext().getBitRate(),
avStream.getMetadata().get("language"), // TODO define somewhere else?
avStream.getCodecContext().getCodecDesc()
));
@@ -90,5 +91,18 @@ InputMediaFile::getStreams(Stream::Type type) const
return res;
}
const Stream&
InputMediaFile::getStream(Stream::Id index) const
{
BOOST_FOREACH(const Stream& stream, _streams)
{
if (stream.getId() == index)
return stream;
}
LMS_LOG(MOD_TRANSCODE, SEV_CRIT) << "Cannot find stream index " << index << " in stream map!";
throw std::runtime_error("InputMediaFile::getStream, cannot find stream idx");
}
} // namespace Transcode