Fri 26 May 2017 Nils Amiet

linux hevc video

For this to work you will need an NVIDIA GPU.

Get the mpv-build scripts, tune the mpv and ffmpeg options and build:

#!/bin/sh

mkdir -p ~/git
cd ~/git
git clone https://github.com/mpv-player/mpv-build.git
cd mpv-build

# write mpv_options file
cat << EOF > mpv_options
--enable-cuda-hwaccel
EOF

# write ffmpeg_options file
cat << EOF > ffmpeg_options
--enable-cuda
--enable-cuvid
--enable-nonfree
EOF

# build
./rebuild -j10

Play a 10bit HEVC video with:

~/git/mpv-build/mpv/build/mpv --hwdec=cuda --vo=opengl <VIDEO_FILE>

This is especially useful for 60 frame per second 2160p 10bit HEVC videos since most CPUs cannot decode those fast enough for smooth playback.