"Video Development" "Cuda development" ffmpeg Nvidia Hardware Acceleration Summary

Source: Internet
Author: User
Tags sca cuda toolkit visual studio 2010

Original link: https://developer.nvidia.com/ffmpeg

gpu-accelerated video processing integrated into the most popular Open-source multimedia tools.

FFmpeg and Libav is among the most popular Open-source multimedia manipulation tools with a library of plugins that can B E applied to various parts of the audio and video processing pipelines and has achieved wide adoption across the world.

Video encoding, decoding and transcoding is some of the most popular applications of FFmpeg. Thanks to the FFmpeg and LIBAV community and contributions from NVIDIA engineers, both of these tools now s Upport native nvidia GPU hardware accelerated video encoding and decoding through the integration of the NVIDIA video Code C SDK.

Leveraging FFmpeg ' s Audio codec, Stream muxing, and RTP protocols, the FFmpeg ' s integration of NVIDIA Video codec SDK Enab Les high performance hardware accelerated video pipelines. FFmpeg uses Video Codec SDK

If you had an NVIDIA GPU which supports hardware-accelerated video encoding and decoding, it ' s simply a matter of Compili ng FFmpeg binary with the required support for NVIDIA libraries and using the resulting binaries to speed up video Encodin G/decoding.

FFmpeg supports following functionality accelerated by video hardware on NVIDIA gpus:hardware-accelerated encoding of H.2 hardware-accelerated decoding** of H. hevc*, HEVC, VP9, VP8, MPEG2, and mpeg4* granular control over encoding SE Ttings such as encoding preset, rate control and other video quality parameters Create high-performance end-to-end Hardwar e-accelerated video processing, 1:n encoding and 1:n transcoding pipeline using built-in filters in FFmpeg ability to add Your own custom high-performance Cuda filters using the GKFX Cuda context implementation in FFmpeg Windows/linux support

* Support are dependent on HW. For a full list of GPUs and formats supported, please see the available GPU support Matrix.
* * HW decode support is added to LIBAV in the

Operating System Windows 7, 8, ten, and Linux
Dependencies Nvencode Api-nvidia Quadro, Tesla, GRID or GeForce products with Kepler, Maxwell and Pascal generation GPUs.

Nvdecode Api-nvidia Quadro, Tesla, GRID or GeForce products with Fermi, Kepler, Maxwell and Pascal generation GPUs.

GPU Support Matrix

Appropriate NVIDIA Display Driver

DirectX SDK (Windows only) Optional:cuda Toolkit 7.5
Development environment Windows:visual Studio 2010/2013/2015, Msys/mingw
LINUX:GCC 4.8 or higher
FFmpeg GPU hw-acceleration support Table
  Fermi Kepler Maxwell (1st Gen) Maxwell ( 2nd Gen) Maxwell (GM206) Pascal
H. Encoding N/a FFmpeg v3.3 FFmpeg v3.3 Ffmpe G v3.3 FFmpeg v3.3 FFmpeg v3.3
HEVC encoding N/a N/A N/A FFmpeg v3.3 FFmpeg v3.3 FFmpeg v3.3
MPEG2, MPEG-4, H. Decoding FFmpeg v3.3 FFmpeg v3.3 FFmpeg v3.3 FFmpeg v3.3 FFmpeg v3.3 FFmpeg v3.3
HEVC decoding N/a N/a N/a N/a FFmpeg v3.3 FFmpeg v3.3
VP9 decoding N/a N/a N/a FFmpeg v3.3 FFmpeg v3.3 FFmpeg v3.3

For guidelines on NVIDIA gpu-accelerated Video encoding/decoding performance, please visit the video Codec SDK page for More details. Getting Started with Ffmpeg/libav using NVIDIA GPUs

Using NVIDIA hardware acceleration in FFMPEG/LIBAV requires the following steps Download the latest FFmpeg or libav source Code, by cloning the corresponding GIT repositories ffmpeg:https://git. Ffmpeg.org/ffmpeg.git libav:https://github.com/libav/libav Download and install the compatible driver from NVIDIA Web sit e downoad and install the Cuda Toolkit cuda Toolkit Use the following configure command (use correct CUDA library path in Config command below)
./configure--enable-cuda--enable-cuvid--enable-nvenc--enable-nonfree--enable-libnpp
--extra-cflags=-i/usr/local/cuda/include--extra-ldflags=-l/usr/local/cuda/lib64 Use following command for build: Make-j use FFMPEG/LIBAV binary as required. To start with FFmpeg, try the below sample command line for 1:2 transcoding
Ffmpeg-y-hwaccel cuvid-c:v h264_cuvid-vsync 0-i <input.mp4>–vf scale_npp=1920:1072
-vcodec h264_nvenc <output0.264>-vf scale_npp=1280:720-vcodec h264_nvenc <output1.264>

For more information on FFmpeg Licensing, please see this page. FFmpeg in Action

FFmpeg is used by many projects, including Google Chrome and VLC player. You can easily integrate Nvidia Hardware-acceleration-these applications by configuring FFmpeg-use NVIDIA GPUs for V IDEO encoding and decoding tasks.

Handbrake is a open-source video transcoder available for Linux, Mac, and Windows.

Handbrake works with most common video files and formats, including ones created by consumer and professional video camera s, mobile devices such as phones and tablets, game and computer screen recordings, and DVD and Blu-ray discs. Handbrake leverages tools such as LIBAV, x264, and x265 to create new MP4 or MKV video files from these.

Plex Media Server is a client-server Media player system and software suite this runs on Windows, MacOS, Linux, FreeBSD or A NAS. Plex organizes all of the videos, music, and photos from your computer ' s personal Media Library and let's stream to your Devices.

The Plex Transcoder uses FFmpeg to handle, and translates your media into, the format your client device supports. How to use ffmpeg/libav with NVIDIA gpu-acceleration Decode a single H. YUV

To decode a single H. Encoded elementary Bitstream file into YUV, use the following Command:ffmpeg:ffmpeg-vsync 0-c : v h264_cuvid-i <input.mp4> F rawvideo <output.yuv>
Libav:avconv-vsync 0-c:v h264_cuvid-i <input.mp4>-F rawvideo <output.yuv>

Example Applications:video Analytics, video inferencing video post-processing video playback Encode a single YUV fil E to a bitstream

To encode a single YUV file into an H.264/HEVC bitstream, use the following command: h . ffmpeg:ffmpeg-f Raw Video-s:v 1920x1080-r 30-pix_fmt yuv420p-i <input.yuv>-c:v h264_nvenc-preset slow-cq 10-bf 2-g Ut.mp4>
Libav:avconv-f rawvideo-s:v 1920x1080-r 30-pix_fmt yuv420p-i <input.yuv>-c:v h264_nvenc-preset SLOW-CQ 10- BF 2-g <output.mp4>
HEVC (No b-frames) Ffmpeg:ffmpeg-f rawvideo-s:v 1920x1080-r 30-pix_fmt yuv420p-i <input.yuv>-vcodec hevc_nvenc-preset SLOW-CQ 10-g <output.mp4>
Libav:avconv-f rawvideo-s:v 1920x1080-r 30-pix_fmt yuv420p-i <input.yuv>-vcodec hevc_nvenc-preset SLOW-CQ 1 0-g <output.mp4>

Example applications:surveillance archiving footages from remote cameras archiving raw captured video from a single Camer A transcode a single video file

To does 1:1 transcode, use the following command:ffmpeg:ffmpeg-hwaccel cuvid-c:v h264_cuvid-i <input.mp4>-VF SCA Le_npp=1280:720-c:v H264_nvenc <output.mp4>
Libav:avconv-hwaccel cuvid-c:v h264_cuvid-i <input.mp4>-vf scale_npp=1280:720-c:v h264_nvenc <output.mp4> ;

Example applications:accelerated transcoding of consumer videos transcode a single video file to N streams

To does 1:n Transcode, use the following command:ffmpeg:ffmpeg-hwaccel cuvid-c:v h264_cuvid-i <input.mp4>-VF SCA Le_npp=1280:720-vcodec h264_nvenc <output0.mp4>-vf scale_npp 640:480-vcodec h264_nvenc <output1.mp4>
Libav:avconv-hwaccel cuvid-c:v h264_cuvid-i <input.mp4>-vf scale_npp=1280:720-vcodec h264_nvenc <output0.mp 4>-vf scale_npp 640:480-vcodec h264_nvenc <output1.mp4>

Example applications:commercial (data center) video transcoding Resou

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.