]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/nvenc: Check capabilities for interlaced encoding
authorTimo Rothenpieler <timo@rothenpieler.org>
Mon, 6 Jun 2016 19:19:29 +0000 (21:19 +0200)
committerTimo Rothenpieler <timo@rothenpieler.org>
Mon, 6 Jun 2016 21:52:55 +0000 (23:52 +0200)
libavcodec/nvenc.c

index d3115f4141c4a4e549386f20a305765405696f70..ae1612ff2a981b461bd5ec1cf427ec7e6a501e6b 100644 (file)
@@ -306,6 +306,14 @@ static int nvenc_check_capabilities(AVCodecContext *avctx)
         return AVERROR(ENOSYS);
     }
 
+    ret = nvenc_check_cap(avctx, NV_ENC_CAPS_SUPPORT_FIELD_ENCODING);
+    if (ret < 1 && avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
+        av_log(avctx, AV_LOG_VERBOSE,
+               "Interlaced encoding is not supported. Supported level: %d\n",
+               ret);
+        return AVERROR(ENOSYS);
+    }
+
     return 0;
 }