Skip to content
Snippets Groups Projects

Resolves #296 removal of NvPipe

Merged Nicolas Pope requested to merge feature/296/directnvenc into master
@@ -28,9 +28,9 @@ bool OpenCVEncoder::supports(ftl::codecs::codec_t codec) {
}
bool OpenCVEncoder::encode(const cv::cuda::GpuMat &in, ftl::codecs::Packet &pkt) {
bool is_colour = in.type() == CV_8UC4 || in.type() == CV_8UC1;
bool is_colour = in.type() == CV_8UC4;
if (pkt.codec == codec_t::Any) pkt.codec = (is_colour && in.type() != CV_8UC1) ? codec_t::JPG : codec_t::PNG;
if (pkt.codec == codec_t::Any) pkt.codec = (is_colour) ? codec_t::JPG : codec_t::PNG;
if (!supports(pkt.codec)) return false;
if (!is_colour && pkt.codec == codec_t::JPG) {
@@ -50,7 +50,7 @@ bool OpenCVEncoder::encode(const cv::cuda::GpuMat &in, ftl::codecs::Packet &pkt)
in.download(tmp_);
if (!is_colour) {
if (!is_colour && in.type() == CV_32F) {
tmp_.convertTo(tmp_, CV_16U, 1000.0f);
}
Loading