Jump to content

Hardware encoding on Ubuntu Server


szimat

Recommended Posts

godfuture

 

Just a quick how-to for those who would like to test VAAPI on Ubuntu (Server) and Emby beta.

 

1)

Install Emby Server beta (must be beta, since VAAPI is only included in beta)

 

Add emby user to group video (needed to have access to GPU), If you run Emby as a different user, you should add that user

sudo usermod -a -G video emby

2)

Install vaapi goodies:

sudo apt-get update
sudo apt-get install libva1 vainfo i965-va-driver

3) 

Install the 1.7.1 libva-driver-intel version, since the one included with 16.04 (v 1.7.0) has color issues (https://bugs.freedesktop.org/show_bug.cgi?id=94845)

 

sudo apt-add-repository ppa:wsnipex/vaapi
sudo apt-get update
sudo apt-get dist-upgrade

4)

Install ffmpeg with VAAPI support. You have two options:

 

a) compile ffmpeg with --enable-vaapi

 

or

 

b ) use the ppa (thanks to schamane for pointing out this ppa)

sudo add-apt-repository ppa:djcj/hybrid
sudo apt-get update
sudo app-get install ffmpeg

OPTIONAL:

You can check the ffmpeg version before you install with

sudo apt-get update
sudo apt-cache policy ffmpeg

Finally, do a system restart, then in Emby Server, under Transcoding enable VAAPI and save the settings.

 

Do some testing, and report your findings here. We experience some artifacts with VAAPI, I think especially at lower bitrates. At higher bitrates I believe there will be less artifacts (I need to do more testing to confirm this). Remember, VAAPI support in ffmpeg is still new, and Emby just added the support (very quickly, so much thanks), so it is still, well, beta. I'm sure it will get better by time.

 

My small home media server running an N3150 SoC performs excellent with VAAPI if transcoding is needed.

 

 

 

 

I tried to install ffmpeg with vaapi support from the ppa suggested:

apt-cache policy ffmpeg
ffmpeg:
  Installiert:           7:3.1.3-1~xenial
  Installationskandidat: 7:3.1.3-1~xenial
  Versionstabelle:
 *** 7:3.1.3-1~xenial 500
        500 http://ppa.launchpad.net/djcj/hybrid/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status
     7:2.8.6-1ubuntu2 500
        500 http://de.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
ffmpeg -buildconf
ffmpeg version 3.1.3-1~xenial Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --prefix=/usr --extra-version='1~xenial' --libdir=/usr/lib/ffmpeg --shlibdir=/usr/lib/ffmpeg --disable-static --disable-debug --toolchain=hardened --enable-pthreads --enable-runtime-cpudetect --enable-gpl --enable-shared --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv --enable-libkvazaar --enable-libopenh264 --enable-nonfree --enable-libfdk-aac --enable-libfaac
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100

  configuration:
    --prefix=/usr
    --extra-version='1
    xenial'
    --libdir=/usr/lib/ffmpeg
    --shlibdir=/usr/lib/ffmpeg
    --disable-static
    --disable-debug
    --toolchain=hardened
    --enable-pthreads
    --enable-runtime-cpudetect
    --enable-gpl
    --enable-shared
    --disable-decoder=libopenjpeg
    --disable-decoder=libschroedinger
    --enable-avresample
    --enable-avisynth
    --enable-gnutls
    --enable-ladspa
    --enable-libass
    --enable-libbluray
    --enable-libbs2b
    --enable-libcaca
    --enable-libcdio
    --enable-libflite
    --enable-libfontconfig
    --enable-libfreetype
    --enable-libfribidi
    --enable-libgme
    --enable-libgsm
    --enable-libmodplug
    --enable-libmp3lame
    --enable-libopenjpeg
    --enable-libopus
    --enable-libpulse
    --enable-librtmp
    --enable-libschroedinger
    --enable-libsnappy
    --enable-libsoxr
    --enable-libspeex
    --enable-libssh
    --enable-libtheora
    --enable-libtwolame
    --enable-libvorbis
    --enable-libvpx
    --enable-libwavpack
    --enable-libwebp
    --enable-libx265
    --enable-libxvid
    --enable-libzvbi
    --enable-openal
    --enable-opengl
    --enable-x11grab
    --enable-version3
    --enable-libopencore-amrnb
    --enable-libopencore-amrwb
    --enable-libvo-amrwbenc
    --enable-libdc1394
    --enable-libiec61883
    --enable-libzmq
    --enable-frei0r
    --enable-libx264
    --enable-libopencv
    --enable-libkvazaar
    --enable-libopenh264
    --enable-nonfree
    --enable-libfdk-aac
    --enable-libfaac

But there is no vaapi support included. Does someone know where to get ffmpeg for Ubuntu 16.04 with vaapi support? I do not want to compile it myself...

Link to comment
Share on other sites

It is not listed for some reason, we already discussed this, but it is enabled. Just try to use it, you will see it works.

Btw, it is quite easy to compile, just takes some time. I will look for the link with a great guide and post it here.

 

Sent from my Xperia Z3 Compact using Tapatalk

Link to comment
Share on other sites

godfuture

My CPU load is as before. I read VA API is producing a lot artefacts, but the quality is quite the same. Conclusion: VA API seems not active/used.

Looking at intel_gpu_top proofs it:

                   render busy:   0%:                                        render space: 0/131072
                bitstream busy:   0%:                                     bitstream space: 0/131072
                  blitter busy:   0%:                                       blitter space: 0/131072

                          task  percent busy
                                                              vert fetch: 0 (0/sec)
                                                              prim fetch: 0 (0/sec)
                                                           VS invocations: 0 (0/sec)
                                                           GS invocations: 0 (0/sec)
                                                                GS prims: 0 (0/sec)
                                                           CL invocations: 0 (0/sec)
                                                                CL prims: 0 (0/sec)
                                                           PS invocations: 0 (0/sec)
                                                           PS depth pass: 0 (0/sec)
Link to comment
Share on other sites

Did you select vaapi transcoding in Emby server? If it is selected, and for some reason ffmpeg doesn't support vaapi, you will have an error message.

 

Sent from my Xperia Z3 Compact using Tapatalk

Link to comment
Share on other sites

godfuture

Did you select vaapi transcoding in Emby server? If it is selected, and for some reason ffmpeg doesn't support vaapi, you will have an error message.

 

Sent from my Xperia Z3 Compact using Tapatalk

Yes. You are right about the build config of ffmpeg. Even ffmpeg -buildconf never mentions vaapi, Emby is stating that vaapi is available:

2016-09-10 19:58:25.9608 Info MediaEncoder: FFMpeg: /usr/bin/ffmpeg
2016-09-10 19:58:25.9608 Info MediaEncoder: FFProbe: /usr/bin/ffprobe
2016-09-10 19:58:25.9608 Info MediaEncoder: Validating media encoder at /usr/bin/ffmpeg
2016-09-10 19:58:26.0949 Info MediaEncoder: Encoder available: libx264
2016-09-10 19:58:26.0949 Info MediaEncoder: Encoder available: libx265
2016-09-10 19:58:26.0964 Info MediaEncoder: Encoder available: mpeg4
2016-09-10 19:58:26.0972 Info MediaEncoder: Encoder available: msmpeg4
2016-09-10 19:58:26.0986 Info MediaEncoder: Encoder available: libvpx
2016-09-10 19:58:26.1002 Info MediaEncoder: Encoder available: libvpx-vp9
2016-09-10 19:58:26.1018 Info MediaEncoder: Encoder available: aac
2016-09-10 19:58:26.1038 Info MediaEncoder: Encoder available: libmp3lame
2016-09-10 19:58:26.1058 Info MediaEncoder: Encoder available: libopus
2016-09-10 19:58:26.1083 Info MediaEncoder: Encoder available: libvorbis
2016-09-10 19:58:26.1110 Info MediaEncoder: Encoder available: srt
2016-09-10 19:58:26.1198 Info MediaEncoder: Encoder available: h264_vaapi
2016-09-10 19:58:26.1214 Info MediaEncoder: Encoder validation complete

For me it is quite hard to check whether VA API is used or not. I have restarted my server after installation of ffmpeg. I tested several movies. All I see is the cpu load didn't change (sometimes 80% both cores or 100% one core) and gpu load is zero. When VAAPI is enabled, a part of the movies does not even play. I can see the poster of the movie, but it never starts.

 

How can I check VA API is used? Why is still so much CPU used? intel_gpu_top should reflect the gpu usage of VA API, right?

Link to comment
Share on other sites

I can't seem to get VAAPI to work on my fresh Ubuntu 16.04 system with Emby 3.0.7100.0

I've followed the step by step guide and get the following transcoding error:

https://192.168.13.10:8920/emby/videos/d2f74931e633224e83832a6f0c76c88a/stream.mkv?DeviceId=41e70fae21b675864e79eed1ae00e11e&MediaSourceId=d2f74931e633224e83832a6f0c76c88a&VideoCodec=h264&AudioCodec=mp3,aac&AudioStreamIndex=2&VideoBitrate=2680000&AudioBitrate=320000&MaxAudioChannels=6&StartTimeTicks=4214883469&Level=51&Profile=high&PlaySessionId=a0ae858a25ee45df938cc255d614876c&api_key=365dfb01bf7d46fd921173987360b0b4&CopyTimestamps=true&EnableSubtitlesInManifest=false&Tag=89336d3285dcdd5336d24bc823f12aa6

{"Protocol":"File","Id":"d2f74931e633224e83832a6f0c76c88a","Path":"/extern/media3/Test/Big Buck Bunny (2008)/Big Buck Bunny (2008) 1080p.mp4","Type":"Default","Container":"mp4","Name":"1080P/H264/MP3","ETag":"89336d3285dcdd5336d24bc823f12aa6","RunTimeTicks":6345330000,"ReadAtNativeFramerate":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"RequiresOpening":false,"RequiresClosing":false,"VideoType":"VideoFile","MediaStreams":[{"Codec":"h264","CodecTag":"avc1","Language":"und","TimeBase":"1/30000","CodecTimeBase":"1/60","NalLengthSize":"4","IsInterlaced":false,"IsAVC":true,"BitRate":2998715,"BitDepth":8,"RefFrames":1,"IsDefault":true,"IsForced":false,"Height":1080,"Width":1920,"AverageFrameRate":30,"RealFrameRate":30,"Profile":"High","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"PixelFormat":"yuv420p","Level":41,"IsAnamorphic":false},{"Codec":"mp3","CodecTag":"mp4a","Language":"und","TimeBase":"1/48000","CodecTimeBase":"1/48000","DisplayTitle":"Und MP3 stereo Default","IsInterlaced":false,"ChannelLayout":"stereo","BitRate":160000,"Channels":2,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0},{"Codec":"ac3","CodecTag":"ac-3","Language":"und","TimeBase":"1/48000","CodecTimeBase":"1/48000","DisplayTitle":"Und Dolby Digital 5.1 Default","IsInterlaced":false,"ChannelLayout":"5.1","BitRate":320000,"Channels":6,"SampleRate":48000,"IsDefault":true,"IsForced":false,"Type":"Audio","Index":2,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Level":0}],"PlayableStreamFileNames":[],"Formats":[],"Bitrate":3481424,"RequiredHttpHeaders":{}}

/usr/bin/ffmpeg -ss 00:07:01.488 -fflags +genpts -hwaccel vaapi -hwaccel_output_format vaapi -vaapi_device /dev/dri/renderD128 -i file:"/extern/media3/Test/Big Buck Bunny (2008)/Big Buck Bunny (2008) 1080p.mp4" -map 0:0 -map 0:2 -map -0:s -codec:v:0 h264_vaapi -force_key_frames "expr:gte(t,n_forced*5)" -vf "format=nv12|vaapi,hwupload" -copyts -avoid_negative_ts disabled -start_at_zero -b:v 2680000 -maxrate 2680000 -bufsize 5360000 -vsync -1 -level 41 -map_metadata -1 -threads 0 -codec:a:0 libmp3lame -ac 2 -ab 320000 -af "aresample=async=1,volume=2" -y "/var/lib/emby-server/transcoding-temp/d6852384cb1619fe1dc3fe5c6261cc9e.mkv"


ffmpeg version 3.1.3-1~xenial Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --prefix=/usr --extra-version='1~xenial' --libdir=/usr/lib/ffmpeg --shlibdir=/usr/lib/ffmpeg --disable-static --disable-debug --toolchain=hardened --enable-pthreads --enable-runtime-cpudetect --enable-gpl --enable-shared --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv --enable-libkvazaar --enable-libopenh264 --enable-nonfree --enable-libfdk-aac --enable-libfaac
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
libva info: VA-API version 0.39.2
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file:/extern/media3/Test/Big Buck Bunny (2008)/Big Buck Bunny (2008) 1080p.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2013-12-16 17:44:39
    title           : Big Buck Bunny, Sunflower version
    artist          : Blender Foundation 2008, Janus Bager Kristensen 2013
    comment         : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
    genre           : Animation
    composer        : Sacha Goedegebure
  Duration: 00:10:34.53, start: 0.000000, bitrate: 3481 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 2998 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2013-12-16 17:44:39
      handler_name    : GPAC ISO Video Handler
    Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, s16p, 160 kb/s (default)
    Metadata:
      creation_time   : 2013-12-16 17:44:42
      handler_name    : GPAC ISO Audio Handler
    Stream #0:2(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 320 kb/s (default)
    Metadata:
      creation_time   : 2013-12-16 17:44:42
      handler_name    : GPAC ISO Audio Handler
    Side data:
      audio service type: main
[h264_vaapi @ 0x2163340] Encoding entrypoint not found (7 / 6).
Output #0, matroska, to '/var/lib/emby-server/transcoding-temp/d6852384cb1619fe1dc3fe5c6261cc9e.mkv':
    Stream #0:0: Unknown: none, SAR 1:1 DAR 0:0 (default)
    Metadata:
      encoder         : Lavc57.48.101 h264_vaapi
    Stream #0:1: Unknown: none (default)
    Metadata:
      encoder         : Lavc57.48.101 libmp3lame
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
  Stream #0:2 -> #0:1 (ac3 (native) -> mp3 (libmp3lame))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Kodi with VVAPI is working fine on the same machine. Any clues what I could try?

Edited by Martum
Link to comment
Share on other sites

I dont know, just an idea, but try stopping Kodi and X, and try Emby then.

 

Sent from my Xperia Z3 Compact using Tapatalk

Thanks. Already tried it with only the Emby service running but it doesn't change anything.

Link to comment
Share on other sites

It works for me, still with artifacts, but works. However, it doesn't work with Firefox. I tried Emby Android app, and Chrome, both work fine. Give a try with Chrome or Android app.

 

Sent from my Xperia Z3 Compact using Tapatalk

Link to comment
Share on other sites

uglymagoo

I also got it running on my Debian 8 server with a self compiled ffmpeg 3.1.3. First tests look very promising. Thanks for this support. I just switched from Plex to emby and I am just loving it :) 

Link to comment
Share on other sites

I guess you compiled ffmpeg now, so the latest version. What about artifacts, especially on lower bitrates, 720p 2Mbs for example?

 

Sent from my Xperia Z3 Compact using Tapatalk

Link to comment
Share on other sites

uglymagoo

Yes the picture quality is worse than software transcoding at the moment. More block artifacts at 4Mbps. At 2Mbps also "jumping objects". However, 8-10 Mbps is my typical use case, so I am really happy about the reduced load :)

Link to comment
Share on other sites

uglymagoo

Did someone try to burn in picture based subtitles with enabled vaapi? I think it is broken in emby, but I am also unable to get the filter graph right from the terminal. I always end up with "Impossible to convert between the formats ... ". 

Link to comment
Share on other sites

Did someone try to burn in picture based subtitles with enabled vaapi? I think it is broken in emby, but I am also unable to get the filter graph right from the terminal. I always end up with "Impossible to convert between the formats ... ". 

 

Thanks for the report. Looks like you've submitted a pull request with some fixes, thanks for that as well !

Link to comment
Share on other sites

scheideggstrasse

wow. thanks to everyone which is involved in the va api development.

works like a charm on ubuntu 16.04 with my intel nuc.

didn't test how much transodings are working now at the same time yet.

but the server load dropped from ~6-7 load avg. to 0.8

intel gpu monitor shows a load of 30-40%

Link to comment
Share on other sites

Thanks for the report. Looks like you've submitted a pull request with some fixes, thanks for that as well !

 

That change (PR  #2167) cut down my vaapi-transcoding performance in half. Not necessarily in all cases but my test case is 4k_60p h.264 big bucks bunny to 2 Mbs 720p. When I have time, I'll create a shell script wrapper to rewrite ffmpeg options.

 

The most annoying thing is that even after the previously mentioned PR the GPU or CPU are neither used more than 50%., but the transcoding is still causing pauses in the (test) video. Undoing to PR #2167 changes consume equal amount of resources (both the cpu and gpu) but the transcoding is fine and happens faster than the playback requires.

 

BR,

A

Link to comment
Share on other sites

uglymagoo

@@Andy777 Yes, the 60fps version of Big Bunny Bunny is also causing problems on my Xeon 1245v2, the 30fps version is OK. My PR sacrifices performance to support all transcoding scenarios in Emby. Essentially, for optimal performance, the video input parameters in Emby have to depend not only on the input and the selected hardware acceleration, but also on the video output (only change resolution --> keep the frames in the gpu; use complex video filter e.g. for graphical subs --> copy frames to main memory). I already have a simple solution ready to deploy. I will try it this weekend and get back to you. 

  • Like 1
Link to comment
Share on other sites

Guest plexman

Hi everybody,

 

I want to share that I have Hardware Acceleration with VAAPI working perfectly (Tested playing on browser only). This is my setup:

 

- Intel i5-6600 (Skylake)

- Ubuntu server 16.04.1

- FFmpeg 3.1.3-2

Emby server 3.0.7200.0

 

So apparently with Ubuntu 16.04 if you have a Skylake processor you don't have to download any VAAPI or Intel GPU driver because everything comes by default with Ubuntu (At least I did not install anything). If you need it check post #72 of @@szimat

 

  • I only installed vainfo to check my VAAPI status, this is what I get when I type "vainfo" in bash:
error: can't connect to X server!
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 1.7.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
  • Installed FFmpeg 3.1 with this repository:

ppa:jonathonf/ffmpeg-3

 

taken from here. Then ffmpeg command output shows this:

ffmpeg version 3.1.3-2~xenial1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 20160609
  configuration: --prefix=/usr --extra-version='2~xenial1' --libdir=/usr/lib/ffmpeg --shlibdir=/usr/lib/ffmpeg --disable-static --disable-debug --toolchain=hardened --enable-pthreads --enable-runtime-cpudetect --enable-gpl --enable-shared --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv --enable-libkvazaar --enable-libopenh264 --enable-nonfree --enable-libfdk-aac --enable-libfaac
  • Added emby user to video group as @@szimat said:
usermod -a -G video emby
  • Enabled VA-API Hardware transcoding in Emby settings, and added de VA-API Device:

57e5702ec5829_vaapi.png

 

  • Restarted the server and tested two movies, SD and HD in lower qualities than the original. Playing perfectly without freezing or seeing anything strange. Emby server VA-API transcoding logs attached.

I hope it helps somebody with other setups or similar and to Luke to know that it's working at least in my case.

vaapi_hd.txt

vaapi_sd.txt

Edited by plexman
Link to comment
Share on other sites

@@Andy777

Essentially, for optimal performance, the video input parameters in Emby have to depend not only on the input and the selected hardware acceleration, but also on the video output (only change resolution --> keep the frames in the gpu; use complex video filter e.g. for graphical subs --> copy frames to main memory).

 

I already have a simple solution ready to deploy. I will try it this weekend and get back to you. 

That is just super! I wish I had similar skills. Took me two hours to realize that Bash script is not a viable wrapper between Emby and Ffmpeg.

BR,

Andy777

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...