Project

General

Profile

Help with transcoding - vaapi: encode: unsupported codec: h264_vaapi and/or profile: (null)

Added by dorin ilut 20 days ago

hi all,

I have an Ubuntu 20.04 system. I am usually building tvheadend from git. i am encountering issues that I would need your help with in regards to transcoding. I already tried the solutions outlined here https://tvheadend.org/boards/5/topics/42180 and here https://tvheadend.org/boards/4/topics/24116. But still no go :(

for example:

2020-11-12 11:21:46.753 subscription: 004D: "188.60.141.85 [ dorin | Kodi Media Center ]" subscribing on channel "AMC HD", weight: 100, adapter: "HDHomeRun DVB-C Tuner #3 (192.168.1.202)", network: "rcs", mux: "522MHz", provider: "AMC Networks Int CE", service: "AMC HD", profile="dt", hostname="188.60.141.85", username="dorin", client="Kodi Media Center"
2020-11-12 11:21:47.473 transcode: 0001: 01:H264: > Using profile dt
2020-11-12 11:21:47.473 transcode: 0001: 02:MPEG2AUDIO: > Copy
2020-11-12 11:21:47.473 transcode: 0001: 03:MPEG2AUDIO: > Copy
2020-11-12 11:21:47.473 transcode: 0001: 04:DVBSUB: > Copy
2020-11-12 11:21:47.812 libav: AVCodecContext: mmco: unref short failure
2020-11-12 11:21:47.846 libav: AVCodecContext: reference picture missing during reorder
2020-11-12 11:21:47.846 libav: AVCodecContext: Missing reference picture, default is 2147483647
2020-11-12 11:21:47.851 libav: AVCodecContext: mmco: unref short failure
2020-11-12 11:21:47.887 vaapi: encode: unsupported codec: h264_vaapi and/or profile: (null)

in the build section I can see that vaapi is enabled:

Configure arguments:
--build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libexecdir=${prefix}/lib/tvheadend --disable-maintainer-mode --disable-dependency-tracking --disable-bintray_cache --enable-vaapi --enable-nvenc --jobs=8

Compiler:
Using C compiler: cc
Using LD flags: -ldvbcsa
Build for arch: x86_64

Binaries:
Using PYTHON: python
Using GZIP: gzip
Using BZIP2: bzip2

Options:
pie yes
ccdebug no
cardclient yes
cwc yes
cccam yes
capmt yes
constcw yes
linuxdvb yes
satip_server yes
satip_client yes
hdhomerun_client yes
hdhomerun_static yes
iptv yes
tsfile yes
dvbscan yes
timeshift yes
trace yes
avahi yes
zlib yes
libav yes
ffmpeg_static yes
libx264 yes
libx264_static yes
libx265 yes
libx265_static yes
libvpx yes
libvpx_static yes
libtheora yes
libtheora_static yes
libvorbis yes
libvorbis_static yes
libfdkaac no
libfdkaac_static no
libopus yes
libopus_static yes
nvenc yes
vaapi yes
mmal no
omx no
inotify yes
epoll yes
pcre no
pcre2 yes
uriparser yes
ccache no
tvhcsa yes
bundle no
pngquant no
kqueue no
dbus_1 yes
android no
gtimer_check no
slow_memoryinfo no
libsystemd_daemon no
pcloud_cache yes
ddci yes
cclang_threadsan no
gperftools no
execinfo yes
mmx yes
sse2 yes
W_unused_result yes
f_stack_protector yes
f_stack_protector_strong yes
f_stack_check yes
f_PIE yes
fdatasync yes
getloadavg yes
atomic32 yes
atomic64 yes
atomic_time_t yes
atomic_ptr yes
bitops64 yes
lockowner yes
qsort_r yes
gmtoff yes
recvmmsg yes
sendmmsg yes
ifnames yes
py_gzip yes
bin_pkg_config yes
bin_xgettext yes
bin_msgmerge yes
bin_gzip yes
bin_bzip2 yes
ssl yes
linuxdvbapi yes
linuxdvb_ca yes
upnp yes
bin_cmake yes
stdcpp yes
libogg_static yes
hwaccels yes
inotify_h yes
inotify_init1 yes
dvbcsa yes
epoll_create1 yes
mpegts yes
mpegts_dvb yes

Packages:
openssl 1.1.1f
zlib 1.2.11
libpcre2-8 10.34
liburiparser 0.9.3
avahi-client 0.7
libva 1.7.0
libva-x11 1.7.0
libva-drm 1.7.0
dbus-1 1.12.16

Installation paths:
Prefix: /usr
Binaries: ${prefix}/bin
Libraries: ${prefix}/lib
Data files: ${prefix}/share
Man pages: /usr/share/man

Attached are print screens for the stream profile and codec profile.

Any guidance would be more than welcomed.


Replies (11)

RE: Help with transcoding - vaapi: encode: unsupported codec: h264_vaapi and/or profile: (null) - Added by dorin ilut 20 days ago

Hi Saen,

I have a Dell Latitude with a Intel Xeon processor, 32Gb Ram, and two video cards: an Intel HD Graphics P530 and and Nvidia Quadro M1000M. Funny thing is that transcoding works in a docker container that has a much older version of tvheadend. The reasoning for having a docker container and a local install is because I wanted to separate adapters.

[email protected]:~$ sudo lshw -C display
*-display
description: 3D controller
product: GM107GLM [Quadro M1000M]
vendor: NVIDIA Corporation
physical id: 0
bus info: [email protected]:01:00.0
version: a2
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list rom
configuration: driver=nvidia latency=0
resources: irq:148 memory:dc000000-dcffffff memory:b0000000-bfffffff memory:c0000000-c1ffffff ioport:e000(size=128) memory:dd000000-dd07ffff
*-display
description: VGA compatible controller
product: HD Graphics P530
vendor: Intel Corporation
physical id: 2
bus info: [email protected]:00:02.0
version: 06
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:146 memory:db000000-dbffffff memory:70000000-7fffffff ioport:f000(size=64) memory:c0000-dffff

RE: Help with transcoding - vaapi: encode: unsupported codec: h264_vaapi and/or profile: (null) - Added by dorin ilut 19 days ago

find below:

[email protected]:~$ sudo vainfo
[sudo] password for dorin: 
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 ()
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointVLD
[email protected]:~$ sudo nvidia-smi
Fri Nov 13 07:41:37 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.80.02    Driver Version: 450.80.02    CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Quadro M1000M       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   25C    P8    N/A /  N/A |    437MiB /  2004MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1221      G   /usr/lib/xorg/Xorg                436MiB |
+-----------------------------------------------------------------------------+

RE: Help with transcoding - vaapi: encode: unsupported codec: h264_vaapi and/or profile: (null) - Added by dorin ilut 19 days ago

also as an idea that I do not think there is an issue with the drivers or hardware, but rather something in the build. see below how it looks in the docker container running HTS Tvheadend 4.3-1857~g221c29b40

020-11-13 06:49:29.181 subscription: 00F3: "172.17.0.1 [ dorin | Kodi Media Center ]" subscribing on channel "AMC HD", weight: 100, adapter: "Philips TDA10023 DVB-C #0 : DVB-C #0", network: "digi", mux: "522MHz", provider: "AMC Networks Int CE", service: "AMC HD", profile="dt", hostname="172.17.0.1", username="dorin", client="Kodi Media Center" 
2020-11-13 06:49:29.515 transcode: 0001: 01:H264: ==> Using profile dt
2020-11-13 06:49:29.515 transcode: 0001: 02:MPEG2AUDIO: ==> Copy
2020-11-13 06:49:29.515 transcode: 0001: 03:MPEG2AUDIO: ==> Copy
2020-11-13 06:49:29.515 transcode: 0001: 04:DVBSUB: ==> Copy

RE: Help with transcoding - vaapi: encode: unsupported codec: h264_vaapi and/or profile: (null) - Added by dorin ilut 19 days ago

Can't test, as the docker container does not have nvidia configured. here are the config options from the tvheadend in docker container:

Configure arguments:
  --disable-ffmpeg_static --disable-libfdkaac_static --disable-libtheora_static --disable-libopus_static --disable-libvorbis_static --disable-libvpx_static --disable-libx264_static --disable-libx265_static --disable-libfdkaac --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --disable-avahi --disable-dbus_1 --disable-bintray_cache --disable-hdhomerun_static --enable-hdhomerun_client --enable-libav --enable-pngquant --enable-trace --enable-vaapi --infodir=/usr/share/info --localstatedir=/var --mandir=/usr/share/man --prefix=/usr --sysconfdir=/config

Compiler:
  Using C compiler:                        cc
  Using LD flags:                           -lhdhomerun -ldvbcsa
  Build for arch:                          x86_64

Binaries:
  Using PYTHON:                            python
  Using GZIP:                              gzip
  Using BZIP2:                             bzip2

Options:
  pie                                      yes
  ccdebug                                  no
  cardclient                               yes
  cwc                                      yes
  cccam                                    yes
  capmt                                    yes
  constcw                                  yes
  linuxdvb                                 yes
  satip_server                             yes
  satip_client                             yes
  hdhomerun_client                         yes
  hdhomerun_static                         no
  iptv                                     yes
  tsfile                                   yes
  dvbscan                                  yes
  timeshift                                yes
  trace                                    yes
  avahi                                    no
  zlib                                     yes
  libav                                    yes
  ffmpeg_static                            no
  libx264                                  yes
  libx264_static                           no
  libx265                                  yes
  libx265_static                           no
  libvpx                                   yes
  libvpx_static                            no
  libtheora                                yes
  libtheora_static                         no
  libvorbis                                yes
  libvorbis_static                         no
  libfdkaac                                no
  libfdkaac_static                         no
  libopus                                  yes
  libopus_static                           no
  nvenc                                    no
  vaapi                                    yes
  mmal                                     no
  omx                                      no
  inotify                                  yes
  epoll                                    yes
  pcre                                     no
  pcre2                                    yes
  uriparser                                yes
  ccache                                   no
  tvhcsa                                   yes
  bundle                                   no
  pngquant                                 yes
  kqueue                                   no
  dbus_1                                   no
  android                                  no
  gtimer_check                             no
  slow_memoryinfo                          no
  libsystemd_daemon                        no
  pcloud_cache                             yes
  ddci                                     yes
  cclang_threadsan                         no
  gperftools                               no
  mmx                                      yes
  sse2                                     yes
  W_unused_result                          yes
  f_stack_protector                        yes
  f_stack_protector_strong                 yes
  f_stack_check                            yes
  f_PIE                                    yes
  strlcat                                  yes
  strlcpy                                  yes
  fdatasync                                yes
  getloadavg                               yes
  atomic32                                 yes
  atomic64                                 yes
  atomic_time_t                            yes
  atomic_ptr                               yes
  bitops64                                 yes
  stime                                    yes
  gmtoff                                   yes
  recvmmsg                                 yes
  sendmmsg                                 yes
  libiconv                                 yes
  ifnames                                  yes
  py_gzip                                  yes
  bin_pkg_config                           yes
  bin_xgettext                             yes
  bin_msgmerge                             yes
  bin_gzip                                 yes
  bin_bzip2                                yes
  ssl                                      yes
  linuxdvbapi                              yes
  linuxdvb_ca                              yes
  libhdhomerun                             yes
  upnp                                     yes
  hwaccels                                 yes
  inotify_h                                yes
  inotify_init1                            yes
  dvbcsa                                   yes
  epoll_create1                            yes
  mpegts                                   yes
  mpegts_dvb                               yes

Packages:
  openssl                                  1.1.1d
  zlib                                     1.2.11
  libpcre2-8                               10.34
  liburiparser                             0.9.3
  libavfilter                              7.57.100
  libswresample                            3.5.100
  libavresample                            4.0.0
  libswscale                               5.5.100
  libavformat                              58.29.100
  libavcodec                               58.54.100
  libavutil                                56.31.100
  libva                                    1.6.0
  libva-x11                                1.6.0
  libva-drm                                1.6.0

Installation paths:
  Prefix:                                  /usr
  Binaries:                                ${prefix}/bin
  Libraries:                               ${prefix}/lib
  Data files:                              ${prefix}/share
  Man pages:                               /usr/share/man

RE: Help with transcoding - vaapi: encode: unsupported codec: h264_vaapi and/or profile: (null) - Added by dorin ilut 19 days ago

Both. so on this system there are two running instances. the one in the docker can tanscode with vaapi. the one that is native cannot.

RE: Help with transcoding - vaapi: encode: unsupported codec: h264_vaapi and/or profile: (null) - Added by dorin ilut 19 days ago

it might be. I am only transcoding one channel. therefore don't need too much power. only the possibility of getting the stream down to 2000kbs when i go to uncivilised counties like Germany, where they don't have internet connections.

    (1-11/11)