blakeblackshear.frigate/57316f1e.8b05c337.js

1 line
9.2 KiB
JavaScript
Raw Normal View History

(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{79:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return a})),t.d(n,"toc",(function(){return d})),t.d(n,"default",(function(){return u}));var r=t(3),i=t(7),c=(t(0),t(99)),o={id:"nvdec",title:"nVidia hardware decoder"},a={unversionedId:"configuration/nvdec",id:"configuration/nvdec",isDocsHomePage:!1,title:"nVidia hardware decoder",description:"Certain nvidia cards include a hardware decoder, which can greatly improve the",source:"@site/docs/configuration/nvdec.md",slug:"/configuration/nvdec",permalink:"/frigate/configuration/nvdec",editUrl:"https://github.com/blakeblackshear/frigate/edit/master/docs/docs/configuration/nvdec.md",version:"current"},d=[{value:"Docker setup",id:"docker-setup",children:[{value:"Requirements",id:"requirements",children:[]},{value:"Setting up docker-compose",id:"setting-up-docker-compose",children:[]},{value:"Setting up the configuration file",id:"setting-up-the-configuration-file",children:[]}]}],p={toc:d};function u(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(c.b)("p",null,"Certain nvidia cards include a hardware decoder, which can greatly improve the\nperformance of video decoding. In order to use NVDEC, a special build of\nffmpeg with NVDEC support is required. The special docker architecture 'amd64nvidia'\nincludes this support for amd64 platforms. An aarch64 for the Jetson, which\nalso includes NVDEC may be added in the future."),Object(c.b)("h2",{id:"docker-setup"},"Docker setup"),Object(c.b)("h3",{id:"requirements"},"Requirements"),Object(c.b)("p",null,Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://www.nvidia.com/en-us/drivers/unix/"}),"nVidia closed source driver")," required to access NVDEC.\n",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/NVIDIA/nvidia-docker"}),"nvidia-docker")," required to pass NVDEC to docker."),Object(c.b)("h3",{id:"setting-up-docker-compose"},"Setting up docker-compose"),Object(c.b)("p",null,"In order to pass NVDEC, the docker engine must be set to ",Object(c.b)("inlineCode",{parentName:"p"},"nvidia")," and the environment variables\n",Object(c.b)("inlineCode",{parentName:"p"},"NVIDIA_VISIBLE_DEVICES=all")," and ",Object(c.b)("inlineCode",{parentName:"p"},"NVIDIA_DRIVER_CAPABILITIES=compute,utility,video")," must be set."),Object(c.b)("p",null,"In a docker compose file, these lines need to be set:"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{}),"services:\n frigate:\n ...\n image: blakeblackshear/frigate:stable-amd64nvidia\n runtime: nvidia\n environment:\n - NVIDIA_VISIBLE_DEVICES=all\n - NVIDIA_DRIVER_CAPABILITIES=compute,utility,video\n")),Object(c.b)("h3",{id:"setting-up-the-configuration-file"},"Setting up the configuration file"),Object(c.b)("p",null,"In your frigate config.yml, you'll need to set ffmpeg to use the hardware decoder.\nThe decoder you choose will depend on the input video."),Object(c.b)("p",null,"A list of supported codecs (you can use ",Object(c.b)("inlineCode",{parentName:"p"},"ffmpeg -decoders | grep cuvid")," in the container to get a list)"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{})," V..... h263_cuvid Nvidia CUVID H263 decoder (codec h263)\n V..... h264_cuvid Nvidia CUVID H264 decoder (codec h264)\n V..... hevc_cuvid Nvidia CUVID HEVC decoder (codec hevc)\n V..... mjpeg_cuvid Nvidia CUVID MJPEG decoder (codec mjpeg)\n V..... mpeg1_cuvid Nvidia CUVID MPEG1VIDEO decoder (codec mpeg1video)\n V..... mpeg2_cuvid Nvidia CUVID MPEG2VIDEO decoder (codec mpeg2video)\n V..... mpeg4_cuvid Nvidia CUVID MPEG4 decoder (codec mpeg4)\n V..... vc1_cuvid Nvidia CUVID VC1 decoder (codec vc1)\n V..... vp8_cuvid Nvidia CUVID VP8 decoder (codec vp8)\n V..... vp9_cuvid Nvidia CUVID VP9 decoder (codec vp9)\n")),Object(c