jail(iocage)で、録画サーバその2

続き。jail内でffmpeg+vaapiを動かす件。
試行錯誤したのをはしょってるけど当初エラーが出てて、検索すると、dev/drm/0のデバイス番号が0x180以下になるようにkldのロード順を調整しろ、みたいなのがあって悩んだ。
結局うちでは関係なかったようで、ポイントは下記:

  • devfsで、jail内にdriとdrmを公開
  • libva-intel-driver と libva-intel-media-driver は、jail内にも必要(drm-kmodは親だけでOK)
iocage

prison作るところから。

# iocage create -n recorder -r 12.1-RELEASE
recorder successfully created!
# vi /etc/devfs.rules
(こんな内容で)

[devfsrules_qsv=5]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path zfs unhide
add path dri unhide
add path 'dri/*' unhide
add path drm unhide
add path 'drm/*' unhide

最初の4行は、include $devfsrules_jailでいい気がするけど、それだと全デバイス出てきてしまった。
これを読み込んで、続行。

# service devfs restart
# iocage set devfs_ruleset=5 recorder
devfs_ruleset: 4 -> 5
# iocage set ip4_addr="em0|192.168.0.12/24" recorder
ip4_addr: none -> em0|192.168.0.12/24
root@rose:~ # iocage start recorder
* Starting recorder
  + Started OK
  + Using devfs_ruleset: 1001 (cloned from devfs_ruleset 5)
  + Using IP options: ip4.addr=em0|192.168.0.12/24 ip4.saddrsel=1 ip4=new ip6.saddrsel=1 ip6=new
  + Starting services OK
  + Executing poststart OK
ffmpeg

ここからjail内で。

root@recorder:~ # pkg install ffmpeg
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
[recorder] Installing pkg-1.14.6...
[recorder] Extracting pkg-1.14.6: 100%
Updating FreeBSD repository catalogue...
[recorder] Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
[recorder] Fetching packagesite.txz: 100%    6 MiB   6.6MB/s    00:01
Processing entries: 100%
FreeBSD repository update completed. 32007 packages processed.
All repositories are up to date.
Updating database digests format: 100%
The following 57 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        aom: 2.0.0_1
        argp-standalone: 1.3_4
        ca_root_nss: 3.56
        dav1d: 0.7.1
        expat: 2.2.8
        ffmpeg: 4.3.1,1
        fontconfig: 2.13.92_2,1
        freetype2: 2.10.2
        fribidi: 0.19.7
        gettext-runtime: 0.20.2
        glib: 2.56.3_8,1
        gmp: 6.2.0
        gnutls: 3.6.15
        graphite2: 1.3.14
        harfbuzz: 2.6.8
        indexinfo: 0.3.1
        jpeg-turbo: 2.0.4
        libX11: 1.6.12,1
        libXau: 1.0.9
        libXdmcp: 1.1.3
        libXext: 1.3.4,1
        libXfixes: 5.0.3_2
        libass: 0.14.0
        libdrm: 2.4.102,1
        libepoll-shim: 0.0.20200602
        libffi: 3.2.1_3
        libiconv: 1.16
        libidn2: 2.3.0_1
        libogg: 1.3.4,4
        libpciaccess: 0.16
        libpthread-stubs: 0.4
        libtasn1: 4.16.0
        libtheora: 1.1.1_7
        libudev-devd: 0.4.2
        libunistring: 0.9.10_1
        libv4l: 1.18.0
        libva: 2.8.0
        libvdpau: 1.4
        libvorbis: 1.3.6_1,3
        libvpx: 1.8.2_1
        libx264: 0.159.2999
        libxcb: 1.13.1
        libxml2: 2.9.10
        nettle: 3.6
        opencv-core: 3.4.1_33
        opus: 1.3.1
        p11-kit: 0.23.20
        pciids: 20200529
        pcre: 8.44
        python37: 3.7.9
        readline: 8.0.4
        tpm-emulator: 0.7.4_2
        trousers: 0.3.14_3
        wayland: 1.18.0_3
        x265: 3.2.1_3
        xorgproto: 2020.1
        xvid: 1.3.7,1

Number of packages to be installed: 57

The process will require 356 MiB more space.
62 MiB to be downloaded.

Proceed with this action? [y/N]: y
[recorder] [1/57] Fetching ffmpeg-4.3.1,1.txz: 100%   15 MiB  16.1MB/s    00:01
[recorder] [2/57] Fetching libxcb-1.13.1.txz: 100%    1 MiB   1.1MB/s    00:01
[recorder] [3/57] Fetching libXdmcp-1.1.3.txz: 100%   14 KiB  14.5kB/s    00:01
[recorder] [4/57] Fetching xorgproto-2020.1.txz: 100%  217 KiB 222.6kB/s    00:01
[recorder] [5/57] Fetching libXau-1.0.9.txz: 100%   11 KiB  11.4kB/s    00:01
[recorder] [6/57] Fetching libxml2-2.9.10.txz: 100%  827 KiB 846.9kB/s    00:01
[recorder] [7/57] Fetching libpthread-stubs-0.4.txz: 100%    2 KiB   2.0kB/s    00:01
[recorder] [8/57] Fetching libX11-1.6.12,1.txz: 100%    2 MiB   1.7MB/s    00:01
[recorder] [9/57] Fetching fontconfig-2.13.92_2,1.txz: 100%  380 KiB 389.4kB/s    00:01
[recorder] [10/57] Fetching expat-2.2.8.txz: 100%  124 KiB 126.9kB/s    00:01
[recorder] [11/57] Fetching freetype2-2.10.2.txz: 100%    1 MiB   1.4MB/s    00:01
[recorder] [12/57] Fetching gettext-runtime-0.20.2.txz: 100%  161 KiB 165.1kB/s    00:01
[recorder] [13/57] Fetching indexinfo-0.3.1.txz: 100%    6 KiB   5.8kB/s    00:01
[recorder] [14/57] Fetching gnutls-3.6.15.txz: 100%    2 MiB   2.6MB/s    00:01
[recorder] [15/57] Fetching trousers-0.3.14_3.txz: 100%  476 KiB 487.9kB/s    00:01
[recorder] [16/57] Fetching tpm-emulator-0.7.4_2.txz: 100%  114 KiB 116.6kB/s    00:01
[recorder] [17/57] Fetching gmp-6.2.0.txz: 100%  478 KiB 489.3kB/s    00:01
[recorder] [18/57] Fetching p11-kit-0.23.20.txz: 100%  438 KiB 448.8kB/s    00:01
[recorder] [19/57] Fetching libtasn1-4.16.0.txz: 100%  599 KiB 613.7kB/s    00:01
[recorder] [20/57] Fetching ca_root_nss-3.56.txz: 100%  285 KiB 291.5kB/s    00:01
[recorder] [21/57] Fetching libffi-3.2.1_3.txz: 100%   35 KiB  35.3kB/s    00:01
[recorder] [22/57] Fetching nettle-3.6.txz: 100%    1 MiB   1.3MB/s    00:01
[recorder] [23/57] Fetching libidn2-2.3.0_1.txz: 100%  110 KiB 112.9kB/s    00:01
[recorder] [24/57] Fetching libunistring-0.9.10_1.txz: 100%  528 KiB 540.3kB/s    00:01
[recorder] [25/57] Fetching xvid-1.3.7,1.txz: 100%  280 KiB 286.7kB/s    00:01
[recorder] [26/57] Fetching x265-3.2.1_3.txz: 100%    2 MiB   1.9MB/s    00:01
[recorder] [27/57] Fetching libx264-0.159.2999.txz: 100%  676 KiB 692.6kB/s    00:01
[recorder] [28/57] Fetching libvpx-1.8.2_1.txz: 100%    1 MiB   1.4MB/s    00:01
[recorder] [29/57] Fetching libvdpau-1.4.txz: 100%   56 KiB  57.4kB/s    00:01
[recorder] [30/57] Fetching libXext-1.3.4,1.txz: 100%   95 KiB  97.1kB/s    00:01
[recorder] [31/57] Fetching libva-2.8.0.txz: 100%  148 KiB 151.5kB/s    00:01
[recorder] [32/57] Fetching libXfixes-5.0.3_2.txz: 100%   15 KiB  15.2kB/s    00:01
[recorder] [33/57] Fetching wayland-1.18.0_3.txz: 100%  119 KiB 121.8kB/s    00:01
[recorder] [34/57] Fetching libepoll-shim-0.0.20200602.txz: 100%   18 KiB  18.3kB/s    00:01
[recorder] [35/57] Fetching libdrm-2.4.102,1.txz: 100%  238 KiB 244.2kB/s    00:01
[recorder] [36/57] Fetching libpciaccess-0.16.txz: 100%   22 KiB  22.1kB/s    00:01
[recorder] [37/57] Fetching pciids-20200529.txz: 100%  211 KiB 216.2kB/s    00:01
[recorder] [38/57] Fetching libv4l-1.18.0.txz: 100%  363 KiB 372.1kB/s    00:01
[recorder] [39/57] Fetching jpeg-turbo-2.0.4.txz: 100%  342 KiB 350.3kB/s    00:01
[recorder] [40/57] Fetching libudev-devd-0.4.2.txz: 100%   15 KiB  14.9kB/s    00:01
[recorder] [41/57] Fetching argp-standalone-1.3_4.txz: 100%   34 KiB  34.6kB/s    00:01
[recorder] [42/57] Fetching libtheora-1.1.1_7.txz: 100%  169 KiB 173.6kB/s    00:01
[recorder] [43/57] Fetching libvorbis-1.3.6_1,3.txz: 100%  342 KiB 350.0kB/s    00:01
[recorder] [44/57] Fetching libogg-1.3.4,4.txz: 100%  192 KiB 196.7kB/s    00:01
[recorder] [45/57] Fetching libass-0.14.0.txz: 100%  136 KiB 139.1kB/s    00:01
[recorder] [46/57] Fetching harfbuzz-2.6.8.txz: 100%  697 KiB 714.2kB/s    00:01
[recorder] [47/57] Fetching graphite2-1.3.14.txz: 100%  101 KiB 103.3kB/s    00:01
[recorder] [48/57] Fetching glib-2.56.3_8,1.txz: 100%    3 MiB   3.2MB/s    00:01
[recorder] [49/57] Fetching python37-3.7.9.txz: 100%   16 MiB  16.8MB/s    00:01
[recorder] [50/57] Fetching readline-8.0.4.txz: 100%  354 KiB 362.8kB/s    00:01
[recorder] [51/57] Fetching pcre-8.44.txz: 100%    1 MiB   1.3MB/s    00:01
[recorder] [52/57] Fetching libiconv-1.16.txz: 100%  608 KiB 622.3kB/s    00:01
[recorder] [53/57] Fetching fribidi-0.19.7.txz: 100%   80 KiB  82.0kB/s    00:01
[recorder] [54/57] Fetching dav1d-0.7.1.txz: 100%  376 KiB 385.3kB/s    00:01
[recorder] [55/57] Fetching aom-2.0.0_1.txz: 100%    3 MiB   3.1MB/s    00:01
[recorder] [56/57] Fetching opencv-core-3.4.1_33.txz: 100%    2 MiB   2.2MB/s    00:01
[recorder] [57/57] Fetching opus-1.3.1.txz: 100%  328 KiB 336.1kB/s    00:01
Checking integrity... done (0 conflicting)
[recorder] [1/57] Installing xorgproto-2020.1...
[recorder] [1/57] Extracting xorgproto-2020.1: 100%
[recorder] [2/57] Installing indexinfo-0.3.1...
[recorder] [2/57] Extracting indexinfo-0.3.1: 100%
[recorder] [3/57] Installing libXdmcp-1.1.3...
[recorder] [3/57] Extracting libXdmcp-1.1.3: 100%
[recorder] [4/57] Installing libXau-1.0.9...
[recorder] [4/57] Extracting libXau-1.0.9: 100%
[recorder] [5/57] Installing libxml2-2.9.10...
[recorder] [5/57] Extracting libxml2-2.9.10: 100%
[recorder] [6/57] Installing libpthread-stubs-0.4...
[recorder] [6/57] Extracting libpthread-stubs-0.4: 100%
[recorder] [7/57] Installing gettext-runtime-0.20.2...
[recorder] [7/57] Extracting gettext-runtime-0.20.2: 100%
[recorder] [8/57] Installing libffi-3.2.1_3...
[recorder] [8/57] Extracting libffi-3.2.1_3: 100%
[recorder] [9/57] Installing readline-8.0.4...
[recorder] [9/57] Extracting readline-8.0.4: 100%
[recorder] [10/57] Installing libxcb-1.13.1...
[recorder] [10/57] Extracting libxcb-1.13.1: 100%
[recorder] [11/57] Installing gmp-6.2.0...
[recorder] [11/57] Extracting gmp-6.2.0: 100%
[recorder] [12/57] Installing pciids-20200529...
[recorder] [12/57] Extracting pciids-20200529: 100%
[recorder] [13/57] Installing python37-3.7.9...
[recorder] [13/57] Extracting python37-3.7.9: 100%
[recorder] [14/57] Installing pcre-8.44...
[recorder] [14/57] Extracting pcre-8.44: 100%
[recorder] [15/57] Installing libiconv-1.16...
[recorder] [15/57] Extracting libiconv-1.16: 100%
[recorder] [16/57] Installing libX11-1.6.12,1...
[recorder] [16/57] Extracting libX11-1.6.12,1: 100%
[recorder] [17/57] Installing expat-2.2.8...
[recorder] [17/57] Extracting expat-2.2.8: 100%
[recorder] [18/57] Installing freetype2-2.10.2...
[recorder] [18/57] Extracting freetype2-2.10.2: 100%
[recorder] [19/57] Installing tpm-emulator-0.7.4_2...
===> Creating groups.
Creating group '_tss' with gid '601'.
===> Creating users
Creating user '_tss' with uid '601'.
[recorder] [19/57] Extracting tpm-emulator-0.7.4_2: 100%
[recorder] [20/57] Installing libtasn1-4.16.0...
[recorder] [20/57] Extracting libtasn1-4.16.0: 100%
[recorder] [21/57] Installing ca_root_nss-3.56...
[recorder] [21/57] Extracting ca_root_nss-3.56: 100%
[recorder] [22/57] Installing libunistring-0.9.10_1...
[recorder] [22/57] Extracting libunistring-0.9.10_1: 100%
[recorder] [23/57] Installing libepoll-shim-0.0.20200602...
[recorder] [23/57] Extracting libepoll-shim-0.0.20200602: 100%
[recorder] [24/57] Installing libpciaccess-0.16...
[recorder] [24/57] Extracting libpciaccess-0.16: 100%
[recorder] [25/57] Installing libogg-1.3.4,4...
[recorder] [25/57] Extracting libogg-1.3.4,4: 100%
[recorder] [26/57] Installing graphite2-1.3.14...
[recorder] [26/57] Extracting graphite2-1.3.14: 100%
[recorder] [27/57] Installing glib-2.56.3_8,1...
[recorder] [27/57] Extracting glib-2.56.3_8,1: 100%
No schema files found: doing nothing.
[recorder] [28/57] Installing fontconfig-2.13.92_2,1...
[recorder] [28/57] Extracting fontconfig-2.13.92_2,1: 100%
Running fc-cache to build fontconfig cache...
Font directories:
        /usr/local/share/fonts
        /usr/local/lib/X11/fonts
/usr/local/share/fonts: skipping, no such directory
/usr/local/lib/X11/fonts: skipping, no such directory
/var/db/fontconfig: cleaning cache directory
fc-cache: succeeded
[recorder] [29/57] Installing trousers-0.3.14_3...
===> Creating groups.
Using existing group '_tss'.
===> Creating users
Using existing user '_tss'.
[recorder] [29/57] Extracting trousers-0.3.14_3: 100%
[recorder] [30/57] Installing p11-kit-0.23.20...
[recorder] [30/57] Extracting p11-kit-0.23.20: 100%
[recorder] [31/57] Installing nettle-3.6...
[recorder] [31/57] Extracting nettle-3.6: 100%
[recorder] [32/57] Installing libidn2-2.3.0_1...
[recorder] [32/57] Extracting libidn2-2.3.0_1: 100%
[recorder] [33/57] Installing libXext-1.3.4,1...
[recorder] [33/57] Extracting libXext-1.3.4,1: 100%
[recorder] [34/57] Installing libXfixes-5.0.3_2...
[recorder] [34/57] Extracting libXfixes-5.0.3_2: 100%
[recorder] [35/57] Installing wayland-1.18.0_3...
[recorder] [35/57] Extracting wayland-1.18.0_3: 100%
[recorder] [36/57] Installing libdrm-2.4.102,1...
[recorder] [36/57] Extracting libdrm-2.4.102,1: 100%
[recorder] [37/57] Installing jpeg-turbo-2.0.4...
[recorder] [37/57] Extracting jpeg-turbo-2.0.4: 100%
[recorder] [38/57] Installing libudev-devd-0.4.2...
[recorder] [38/57] Extracting libudev-devd-0.4.2: 100%
[recorder] [39/57] Installing argp-standalone-1.3_4...
[recorder] [39/57] Extracting argp-standalone-1.3_4: 100%
[recorder] [40/57] Installing libvorbis-1.3.6_1,3...
[recorder] [40/57] Extracting libvorbis-1.3.6_1,3: 100%
[recorder] [41/57] Installing harfbuzz-2.6.8...
[recorder] [41/57] Extracting harfbuzz-2.6.8: 100%
[recorder] [42/57] Installing fribidi-0.19.7...
[recorder] [42/57] Extracting fribidi-0.19.7: 100%
[recorder] [43/57] Installing gnutls-3.6.15...
[recorder] [43/57] Extracting gnutls-3.6.15: 100%
[recorder] [44/57] Installing xvid-1.3.7,1...
[recorder] [44/57] Extracting xvid-1.3.7,1: 100%
[recorder] [45/57] Installing x265-3.2.1_3...
[recorder] [45/57] Extracting x265-3.2.1_3: 100%
[recorder] [46/57] Installing libx264-0.159.2999...
[recorder] [46/57] Extracting libx264-0.159.2999: 100%
[recorder] [47/57] Installing libvpx-1.8.2_1...
[recorder] [47/57] Extracting libvpx-1.8.2_1: 100%
[recorder] [48/57] Installing libvdpau-1.4...
[recorder] [48/57] Extracting libvdpau-1.4: 100%
[recorder] [49/57] Installing libva-2.8.0...
[recorder] [49/57] Extracting libva-2.8.0: 100%
[recorder] [50/57] Installing libv4l-1.18.0...
[recorder] [50/57] Extracting libv4l-1.18.0: 100%
[recorder] [51/57] Installing libtheora-1.1.1_7...
[recorder] [51/57] Extracting libtheora-1.1.1_7: 100%
[recorder] [52/57] Installing libass-0.14.0...
[recorder] [52/57] Extracting libass-0.14.0: 100%
[recorder] [53/57] Installing dav1d-0.7.1...
[recorder] [53/57] Extracting dav1d-0.7.1: 100%
[recorder] [54/57] Installing aom-2.0.0_1...
[recorder] [54/57] Extracting aom-2.0.0_1: 100%
[recorder] [55/57] Installing opencv-core-3.4.1_33...
[recorder] [55/57] Extracting opencv-core-3.4.1_33: 100%
[recorder] [56/57] Installing opus-1.3.1...
[recorder] [56/57] Extracting opus-1.3.1: 100%
[recorder] [57/57] Installing ffmpeg-4.3.1,1...
[recorder] [57/57] Extracting ffmpeg-4.3.1,1: 100%
Message from python37-3.7.9:

--
Note that some standard Python modules are provided as separate ports
as they require additional dependencies. They are available as:

py37-gdbm       databases/py-gdbm@py37
py37-sqlite3    databases/py-sqlite3@py37
py37-tkinter    x11-toolkits/py-tkinter@py37
Message from freetype2-2.10.2:

--
The 2.7.x series now uses the new subpixel hinting mode (V40 port's option) as
the default, emulating a modern version of ClearType. This change inevitably
leads to different rendering results, and you might change port's options to
adapt it to your taste (or use the new "FREETYPE_PROPERTIES" environment
variable).

The environment variable "FREETYPE_PROPERTIES" can be used to control the
driver properties. Example:

FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
        cff:no-stem-darkening=1 \
        autofitter:warping=1

This allows to select, say, the subpixel hinting mode at runtime for a given
application.

If LONG_PCF_NAMES port's option was enabled, the PCF family names may include
the foundry and information whether they contain wide characters. For example,
"Sony Fixed" or "Misc Fixed Wide", instead of "Fixed". This can be disabled at
run time with using pcf:no-long-family-names property, if needed. Example:

FREETYPE_PROPERTIES=pcf:no-long-family-names=1

How to recreate fontconfig cache with using such environment variable,
if needed:
# env FREETYPE_PROPERTIES=pcf:no-long-family-names=1 fc-cache -fsv

The controllable properties are listed in the section "Controlling FreeType
Modules" in the reference's table of contents
(/usr/local/share/doc/freetype2/reference/site/index.html, if documentation was installed).
Message from ca_root_nss-3.56:

--
FreeBSD does not, and can not warrant that the certification authorities
whose certificates are included in this package have in any way been
audited for trustworthiness or RFC 3647 compliance.

Assessment and verification of trust is the complete responsibility of the
system administrator.


This package installs symlinks to support root certificates discovery by
default for software that uses OpenSSL.

This enables SSL Certificate Verification by client software without manual
intervention.

If you prefer to do this manually, replace the following symlinks with
either an empty file or your site-local certificate bundle.

  * /etc/ssl/cert.pem
  * /usr/local/etc/ssl/cert.pem
  * /usr/local/openssl/cert.pem
Message from trousers-0.3.14_3:

--
To run tcsd automatically, add the following line to /etc/rc.conf:

tcsd_enable="YES"

You might want to edit /usr/local/etc/tcsd.conf to reflect your setup.

If you want to use tcsd with software TPM emulator, use the following
configuration in /etc/rc.conf:

tcsd_enable="YES"
tcsd_mode="emulator"
tpmd_enable="YES"

To use TPM, add your_account to '_tss' group like following:

# pw groupmod _tss -m your_account
Message from argp-standalone-1.3_4:

--
===>   NOTICE:

The argp-standalone port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port
Message from opencv-core-3.4.1_33:

--
===>   NOTICE:

The opencv-core port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://www.freebsd.org/doc/en/articles/contributing/ports-contributing.html#maintain-port

依存pkgが多い。。emacsみたいに、X11抜き版があればいいのに。
最後にこれ。これなしでffmpeg -hwaccel vaapi を動かすとdecoderが初期化できないとかいうエラーが出る。オプションが違うのかとか悩んだけど、結局 /usr/local/lib/dri/i915_drv_video.so があれば動いた。

root@recorder:~ # pkg install libva-intel-driver libva-intel-media-driver
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        gmmlib: 20.2.2
        libva-intel-driver: 2.4.1
        libva-intel-media-driver: 20.2.0

Number of packages to be installed: 3

The process will require 209 MiB more space.
31 MiB to be downloaded.

Proceed with this action? [y/N]: y
[recorder] [1/3] Fetching libva-intel-driver-2.4.1.txz: 100%  898 KiB 919.7kB/s    00:01
[recorder] [2/3] Fetching libva-intel-media-driver-20.2.0.txz: 100%   30 MiB  15.6MB/s    00:02
[recorder] [3/3] Fetching gmmlib-20.2.2.txz: 100%  190 KiB 195.0kB/s    00:01
Checking integrity... done (0 conflicting)
[recorder] [1/3] Installing gmmlib-20.2.2...
[recorder] [1/3] Extracting gmmlib-20.2.2: 100%
[recorder] [2/3] Installing libva-intel-driver-2.4.1...
[recorder] [2/3] Extracting libva-intel-driver-2.4.1: 100%
[recorder] [3/3] Installing libva-intel-media-driver-20.2.0...
[recorder] [3/3] Extracting libva-intel-media-driver-20.2.0: 100%
root@recorder:~ #
お試し

ソースは、ホスト側にあったch.21の60秒のTSファイル、b25解除済み。ffmpegのオプションは謎。

root@recorder:/tmp # ffmpeg -hwaccel vaapi -init_hw_device vaapi=foo:/dev/dri/renderD128 -hwaccel_output_format vaapi -i 21.ts -vf 'hwupload,deinterlace_vaapi' -qp 23 -c:v h264_vaapi -c:a copy -absf aac_adtstoasc -f mp4 test.mp4
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
  configuration: --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --pkgconfigdir=/usr/local/libdata/pkgconfig --enable-shared --enable-pic --enable-gpl --enable-avresample --cc=cc --cxx=c++ --disable-alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --enable-libaom --disable-libaribb24 --enable-asm --enable-libass --disable-libbs2b --disable-libcaca --disable-libcdio --disable-libcelt --disable-libcodec2 --enable-libdav1d --disable-libdavs2 --disable-libdc1394 --disable-debug --enable-htmlpages --enable-libdrm --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --disable-libfribidi --disable-gcrypt --disable-libglslang --disable-libgme --enable-gmp --enable-gnutls --enable-version3 --disable-libgsm --enable-iconv --disable-libilbc --disable-libjack --disable-libklvanc --disable-libkvazaar --disable-ladspa --disable-libmp3lame --disable-liblensfun --disable-libbluray --disable-librsvg --disable-librtmp --enable-libxml2 --disable-lto --disable-lv2 --disable-mbedtls --disable-libmfx --disable-libmodplug --disable-libmysofa --disable-nonfree --disable-openal --disable-opencl --enable-libopencv --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-libopenmpt --disable-openssl --enable-optimizations --enable-libopus --disable-pocketsphinx --disable-libpulse --disable-librabbitmq --disable-librav1e --enable-runtime-cpudetect --disable-librubberband --disable-sdl2 --disable-libsmbclient --disable-libsnappy --disable-sndio --disable-libsoxr --disable-libspeex --disable-libsrt --disable-libssh --disable-libtensorflow --disable-libtesseract --enable-libtheora --disable-libtwolame --enable-libv4l2 --enable-vaapi --disable-vapoursynth --enable-vdpau --disable-libvidstab --disable-libvmaf --enable-libvorbis --disable-libvo-amrwbenc --enable-libvpx --disable-vulkan --disable-libwavpack --disable-libwebp --enable-libx264 --enable-libx265 --disable-libxavs2 --enable-libxcb --enable-libxvid --disable-outdev=xv --disable-libzimg --disable-libzmq --disable-libzvbi
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[AVHWDeviceContext @ 0x8009fe1c0] libva: /usr/local/lib/dri/iHD_drv_video.so init failed
[mpeg2video @ 0x8066a4300] Invalid frame dimensions 0x0.
Last message repeated 10 times
[NULL @ 0x808f6d700] non-existing PPS 0 referenced
Last message repeated 3 times
[h264 @ 0x808f6d700] non-existing PPS 0 referenced
[h264 @ 0x808f6d700] decode_slice_header error
[h264 @ 0x808f6d700] no frame!
[h264 @ 0x808f6d700] non-existing PPS 0 referenced
[h264 @ 0x808f6d700] decode_slice_header error
[h264 @ 0x808f6d700] no frame!
[h264 @ 0x808f6d700] non-existing PPS 0 referenced
[h264 @ 0x808f6d700] decode_slice_header error
[h264 @ 0x808f6d700] no frame!
[h264 @ 0x808f6d700] non-existing PPS 0 referenced
[h264 @ 0x808f6d700] decode_slice_header error
[h264 @ 0x808f6d700] no frame!
[mpeg2video @ 0x8066a4300] Invalid frame dimensions 0x0.
[h264 @ 0x808f6d700] non-existing PPS 0 referenced
Last message repeated 3 times
[h264 @ 0x808f6d700] decode_slice_header error
[h264 @ 0x808f6d700] no frame!
[h264 @ 0x808f6d700] non-existing PPS 0 referenced
[h264 @ 0x808f6d700] decode_slice_header error
[h264 @ 0x808f6d700] no frame!
[h264 @ 0x808f6d700] non-existing PPS 0 referenced
[h264 @ 0x808f6d700] decode_slice_header error
[h264 @ 0x808f6d700] no frame!
[h264 @ 0x808f6d700] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x808f6d700] decode_slice_header error
[h264 @ 0x808f6d700] no frame!
[mpegts @ 0x8067d8c00] start time for stream 2 is not set in estimate_timings_from_pts
[mpegts @ 0x8067d8c00] start time for stream 3 is not set in estimate_timings_from_pts
[mpegts @ 0x8067d8c00] start time for stream 12 is not set in estimate_timings_from_pts
[mpegts @ 0x8067d8c00] start time for stream 13 is not set in estimate_timings_from_pts
[mpegts @ 0x8067d8c00] PES packet size mismatch
[mpegts @ 0x8067d8c00] Packet corrupt (stream = 1, dts = 1448927695).
[mpegts @ 0x8067d8c00] stream 10 : no PTS found at end of file, duration not set
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 4 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 5 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 6 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 7 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 8 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 9 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 14 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 15 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 16 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 17 (Unknown: none ([13][0][0][0] / 0x000D)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 0x8067d8c00] Could not find codec parameters for stream 18 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from '21.ts':
  Duration: 00:00:59.61, start: 16039.963289, bitrate: 17154 kb/s
  Program 1056
    Metadata:
      service_name    : ?|娶
      service_provider:
    Stream #0:0[0x111]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Side data:
      cpb: bitrate max/min/avg: 20000000/0/0 buffer size: 9781248 vbv_delay: N/A
    Stream #0:1[0x112]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 189 kb/s
    Stream #0:2[0x114]: Subtitle: arib_caption (Profile A) ([6][0][0][0] / 0x0006)
    Stream #0:3[0x115]: Data: bin_data ([6][0][0][0] / 0x0006)
    Stream #0:4[0x810]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:5[0x811]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:6[0x816]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:7[0x81a]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:8[0x81b]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:9[0x81f]: Unknown: none ([13][0][0][0] / 0x000D)
  Program 1057
    Metadata:
      service_name    : ?|娶
      service_provider:
    Stream #0:0[0x111]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Side data:
      cpb: bitrate max/min/avg: 20000000/0/0 buffer size: 9781248 vbv_delay: N/A
    Stream #0:1[0x112]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 189 kb/s
    Stream #0:2[0x114]: Subtitle: arib_caption (Profile A) ([6][0][0][0] / 0x0006)
    Stream #0:3[0x115]: Data: bin_data ([6][0][0][0] / 0x0006)
    Stream #0:4[0x810]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:5[0x811]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:6[0x816]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:7[0x81a]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:8[0x81b]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:9[0x81f]: Unknown: none ([13][0][0][0] / 0x000D)
  Program 1058
    Metadata:
      service_name    : ?|娶
      service_provider:
    Stream #0:0[0x111]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Side data:
      cpb: bitrate max/min/avg: 20000000/0/0 buffer size: 9781248 vbv_delay: N/A
    Stream #0:1[0x112]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 189 kb/s
    Stream #0:2[0x114]: Subtitle: arib_caption (Profile A) ([6][0][0][0] / 0x0006)
    Stream #0:3[0x115]: Data: bin_data ([6][0][0][0] / 0x0006)
    Stream #0:4[0x810]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:5[0x811]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:6[0x816]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:7[0x81a]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:8[0x81b]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:9[0x81f]: Unknown: none ([13][0][0][0] / 0x000D)
  Program 1440
    Metadata:
      service_name    : ?|娶
      service_provider:
    Stream #0:10[0x151]: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p(progressive), 320x180, 14.99 fps, 14.99 tbr, 90k tbn, 29.97 tbc
    Stream #0:11[0x152]: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 49 kb/s
    Stream #0:13[0x154]: Subtitle: arib_caption (Profile C) ([6][0][0][0] / 0x0006)
    Stream #0:14[0x850]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:15[0x851]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:16[0x85a]: Unknown: none ([13][0][0][0] / 0x000D)
    Stream #0:17[0x85b]: Unknown: none ([13][0][0][0] / 0x000D)
  Program 1060
    Metadata:
      service_name    : ?|娶NW;~
      service_provider:
    Stream #0:12[0x12]: Data: epg
    Stream #0:18[0x135]: Unknown: none
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_vaapi))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[aac_adtstoasc @ 0x8009feb80] Error parsing ADTS frame header!
Error applying bitstream filters to an output packet for stream #0:1.
Output #0, mp4, to 'test.mp4':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: h264 (h264_vaapi) (High) (avc1 / 0x31637661), vaapi_vld, 1440x1080 [SAR 4:3 DAR 16:9], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc
  Metadata:
    encoder         : Lavc58.91.100 h264_vaapi
  Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s
frame=   59 fps=0.0 q=-0.0 size=     512kB time=00:00:01.86 bitrate=2244.9kbits/s dup=25 drop=0 spee
frame=  110 fps=110 q=-0.0 size=    1280kB time=00:00:03.57 bitrate=2937.1kbits/s dup=25 drop=0 spee
・・省略・・
frame= 1766 fps= 99 q=-0.0 size=   54784kB time=00:00:58.82 bitrate=7629.2kbits/s dup=25 drop=0 spee
[mpegts @ 0x8067d8c00] PES packet size mismatch
[mpegts @ 0x8067d8c00] Packet corrupt (stream = 1, dts = 1448927695).
frame= 1786 fps= 99 q=-0.0 Lsize=   55976kB time=00:00:59.52 bitrate=7703.5kbits/s dup=26 drop=0 speed=3.29x
video:54553kB audio:1363kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.108436%

同じファイルを x264 でやってみたら。

root@recorder:/tmp # ffmpeg -i 21.ts -vf bwdif=0 -c:v libx264 -c:a copy -absf aac_adtstoasc -f mp4 test.mp4
・・省略・・
frame= 1786 fps= 15 q=-1.0 Lsize=   28957kB time=00:00:59.49 bitrate=3987.3kbits/s dup=25 drop=0 speed=0.507x
video:27530kB audio:1363kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.221393%

0.507x → 3.29x だ、よしよし。