Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[教程分享] 在TRUENAS上利用jail运行 #173

Open
frankcui95 opened this issue Aug 25, 2023 · 2 comments
Open

[教程分享] 在TRUENAS上利用jail运行 #173

frankcui95 opened this issue Aug 25, 2023 · 2 comments

Comments

@frankcui95
Copy link
Contributor

frankcui95 commented Aug 25, 2023

TRUENAS CORE 运行 blrec

前言

文章适用:FREEBSD 版本的 TRUENAS

文章不适用:DEBIAN 版本的 TRUENAS SCALE

编写此文档时 pip install得到的blrec 的版本为 1.13.0

此文章只有命令行控制台输出和成功运行 blrec 的截图

此文章不包含如何配置 jail 的 mount

部署步骤

首先在 FREENAS 里面创建一个 jail,,选择 basejail, 名称 blrec

Release 13.1 会出现Undefined symbol "strverscmp@FBSD_1.7" 无法运行ffmpeg和blrec

Release选择12.4

进入 jail 控制台

iocage console blrec

屏幕出现类似输出

FreeBSD 13.1-RELEASE-p7 n245428-4dfb91682c1 TRUENAS

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories:   https://www.FreeBSD.org/security/
FreeBSD Handbook:      https://www.FreeBSD.org/handbook/
FreeBSD FAQ:           https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums:        https://forums.FreeBSD.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages:  man man
FreeBSD directory layout:      man hier

Edit /etc/motd to change this login announcement.

安装 pkg

basejail 没有 pkg 工具, 先安装 pkg, 一路按y继续

pkg

屏幕输出

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:13:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
[blrec] Installing pkg-1.19.2...
Newer FreeBSD version for package pkg:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1302001
- running kernel: 1301000
Ignore the mismatch and continue? [y/N]: y
[blrec] Extracting pkg-1.19.2: 100%
pkg: not enough arguments
Usage: pkg [-v] [-d] [-l] [-N] [-j <jail name or id>|-c <chroot path>|-r <rootdir>] [-C <configuration file>] [-R <repo config dir>] [-o var=value] [-4|-6] <command> [<args>]

For more information on available commands and options see 'pkg help'.

更新pkg包源, 一路按y继续

pkg update

输出

Updating FreeBSD repository catalogue...
[blrec] Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
[blrec] Fetching packagesite.pkg: 100%    7 MiB   7.0MB/s    00:01
Processing entries:   0%
Newer FreeBSD version for package zziplib:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1302001
- running kernel: 1301000
Ignore the mismatch and continue? [y/N]: y
Processing entries: 100%
FreeBSD repository update completed. 33869 packages processed.
All repositories are up to date.

安装依赖 python

ffmpeg4会安装

安装依赖ffmpeg4

ffmpeg版本是6,py-av10和cython3不兼容会出现编译错误,这里选择安装ffmpeg4

pkg install ffmpeg4

屏幕输出

root@blrec:~ # pkg install ffmpeg4
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
The following 69 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        Imath: 3.1.9
        aom: 3.6.1
        argp-standalone: 1.5.0
        brotli: 1.0.9,1
        dav1d: 1.2.1
        expat: 2.5.0
        ffmpeg4: 4.4.4_2
        fontconfig: 2.14.2,1
        freetype2: 2.12.1_2
        fribidi: 1.0.13
        gdk-pixbuf2: 2.42.10
        gettext-runtime: 0.21.1
        giflib: 5.2.1
        glib: 2.76.4,2
        gmp: 6.2.1
        gnutls: 3.7.9
        graphite2: 1.3.14
        harfbuzz: 7.3.0
        highway: 1.0.4_1
        indexinfo: 0.3.1
        jbigkit: 2.1_1
        jpeg-turbo: 2.1.5.1
        lame: 3.100_4
        libX11: 1.8.6,1
        libXau: 1.0.9
        libXdmcp: 1.1.3
        libXext: 1.3.4,1
        libXfixes: 6.0.0
        libass: 0.17.1_1
        libdeflate: 1.18
        libdrm: 2.4.115,1
        libepoll-shim: 0.0.20230411
        libffi: 3.4.4
        libiconv: 1.17
        libidn2: 2.3.4
        libjxl: 0.8.2
        liblz4: 1.9.4,1
        libogg: 1.3.5,4
        libpciaccess: 0.17
        libtasn1: 4.19.0
        libudev-devd: 0.5.1
        libunibreak: 5.1,1
        libunistring: 1.1
        libv4l: 1.23.0
        libva: 2.18.0
        libvdpau: 1.5
        libvorbis: 1.3.7_2,3
        libvpx: 1.13.0
        libx264: 0.164.3095
        libxcb: 1.15_1
        libxml2: 2.10.4
        mpdecimal: 2.5.1
        nettle: 3.9.1
        openexr: 3.1.11
        opus: 1.4
        p11-kit: 0.24.1_2
        pcre2: 10.42
        png: 1.6.39
        python39: 3.9.17
        readline: 8.2.1
        shared-mime-info: 2.2_1
        svt-av1: 1.6.0
        tiff: 4.4.0_1
        vmaf: 2.3.1
        wayland: 1.22.0
        webp: 1.3.0_1
        x265: 3.4_2
        xorgproto: 2022.1_1
        zstd: 1.5.5

Number of packages to be installed: 69

The process will require 405 MiB more space.
72 MiB to be downloaded.

Proceed with this action? [y/N]: y
[blrec] [1/69] Fetching png-1.6.39.pkg: 100%  294 KiB 301.0kB/s    00:01
[blrec] [2/69] Fetching libass-0.17.1_1.pkg: 100%  147 KiB 150.3kB/s    00:01
[blrec] [3/69] Fetching libxcb-1.15_1.pkg: 100%    1 MiB   1.1MB/s    00:01
[blrec] [4/69] Fetching mpdecimal-2.5.1.pkg: 100%  320 KiB 327.9kB/s    00:01
[blrec] [5/69] Fetching freetype2-2.12.1_2.pkg: 100%    1 MiB   1.1MB/s    00:01
[blrec] [6/69] Fetching jpeg-turbo-2.1.5.1.pkg: 100%  362 KiB 371.0kB/s    00:01
[blrec] [7/69] Fetching x265-3.4_2.pkg: 100%    2 MiB   1.9MB/s    00:01
[blrec] [8/69] Fetching libx264-0.164.3095.pkg: 100%  678 KiB 694.7kB/s    00:01
[blrec] [9/69] Fetching libidn2-2.3.4.pkg: 100%  134 KiB 137.1kB/s    00:01
[blrec] [10/69] Fetching highway-1.0.4_1.pkg: 100%  557 KiB 570.6kB/s    00:01
[blrec] [11/69] Fetching liblz4-1.9.4,1.pkg: 100%  145 KiB 148.1kB/s    00:01
[blrec] [12/69] Fetching nettle-3.9.1.pkg: 100%    1 MiB   1.5MB/s    00:01
[blrec] [13/69] Fetching libudev-devd-0.5.1.pkg: 100%   16 KiB  16.8kB/s    00:01
[blrec] [14/69] Fetching opus-1.4.pkg: 100%  330 KiB 337.5kB/s    00:01
[blrec] [15/69] Fetching ffmpeg4-4.4.4_2.pkg: 100%    9 MiB   9.9MB/s    00:01
[blrec] [16/69] Fetching libunibreak-5.1,1.pkg: 100%   27 KiB  27.1kB/s    00:01
[blrec] [17/69] Fetching zstd-1.5.5.pkg: 100%  545 KiB 557.9kB/s    00:01
[blrec] [18/69] Fetching libunistring-1.1.pkg: 100%  554 KiB 567.4kB/s    00:01
[blrec] [19/69] Fetching pcre2-10.42.pkg: 100%    1 MiB   1.4MB/s    00:01
[blrec] [20/69] Fetching brotli-1.0.9,1.pkg: 100%  352 KiB 360.2kB/s    00:01
[blrec] [21/69] Fetching libvorbis-1.3.7_2,3.pkg: 100%  347 KiB 354.9kB/s    00:01
[blrec] [22/69] Fetching gmp-6.2.1.pkg: 100%  472 KiB 483.8kB/s    00:01
[blrec] [23/69] Fetching Imath-3.1.9.pkg: 100%  103 KiB 105.1kB/s    00:01
[blrec] [24/69] Fetching libiconv-1.17.pkg: 100%  621 KiB 635.7kB/s    00:01
[blrec] [25/69] Fetching libdeflate-1.18.pkg: 100%   74 KiB  76.2kB/s    00:01
[blrec] [26/69] Fetching svt-av1-1.6.0.pkg: 100%    2 MiB   2.0MB/s    00:01
[blrec] [27/69] Fetching gettext-runtime-0.21.1.pkg: 100%  166 KiB 170.0kB/s    00:01
[blrec] [28/69] Fetching libXext-1.3.4,1.pkg: 100%   95 KiB  97.1kB/s    00:01
[blrec] [29/69] Fetching fribidi-1.0.13.pkg: 100%   79 KiB  81.4kB/s    00:01
[blrec] [30/69] Fetching vmaf-2.3.1.pkg: 100%  286 KiB 292.6kB/s    00:01
[blrec] [31/69] Fetching libva-2.18.0.pkg: 100%  167 KiB 171.0kB/s    00:01
[blrec] [32/69] Fetching libdrm-2.4.115,1.pkg: 100%  249 KiB 255.3kB/s    00:01
[blrec] [33/69] Fetching libtasn1-4.19.0.pkg: 100%  159 KiB 163.2kB/s    00:01
[blrec] [34/69] Fetching argp-standalone-1.5.0.pkg: 100%   30 KiB  30.5kB/s    00:01
[blrec] [35/69] Fetching libogg-1.3.5,4.pkg: 100%  193 KiB 197.2kB/s    00:01
[blrec] [36/69] Fetching libXfixes-6.0.0.pkg: 100%   14 KiB  14.5kB/s    00:01
[blrec] [37/69] Fetching p11-kit-0.24.1_2.pkg: 100%  454 KiB 464.4kB/s    00:01
[blrec] [38/69] Fetching indexinfo-0.3.1.pkg: 100%    6 KiB   5.9kB/s    00:01
[blrec] [39/69] Fetching libXau-1.0.9.pkg: 100%   11 KiB  11.3kB/s    00:01
[blrec] [40/69] Fetching libxml2-2.10.4.pkg: 100%    1 MiB   1.2MB/s    00:01
[blrec] [41/69] Fetching wayland-1.22.0.pkg: 100%  126 KiB 129.1kB/s    00:01
[blrec] [42/69] Fetching aom-3.6.1.pkg: 100%    4 MiB   3.9MB/s    00:01
[blrec] [43/69] Fetching fontconfig-2.14.2,1.pkg: 100%  472 KiB 483.2kB/s    00:01
[blrec] [44/69] Fetching python39-3.9.17.pkg: 100%   18 MiB  18.4MB/s    00:01
[blrec] [45/69] Fetching gdk-pixbuf2-2.42.10.pkg: 100%  473 KiB 484.8kB/s    00:01
[blrec] [46/69] Fetching gnutls-3.7.9.pkg: 100%    3 MiB   2.6MB/s    00:01
[blrec] [47/69] Fetching dav1d-1.2.1.pkg: 100%  563 KiB 576.5kB/s    00:01
[blrec] [48/69] Fetching libepoll-shim-0.0.20230411.pkg: 100%   24 KiB  24.5kB/s    00:01
[blrec] [49/69] Fetching libjxl-0.8.2.pkg: 100%    7 MiB   7.2MB/s    00:01
[blrec] [50/69] Fetching libX11-1.8.6,1.pkg: 100%    2 MiB   1.7MB/s    00:01
[blrec] [51/69] Fetching openexr-3.1.11.pkg: 100%    2 MiB   2.2MB/s    00:01
[blrec] [52/69] Fetching glib-2.76.4,2.pkg: 100%    3 MiB   3.6MB/s    00:01
[blrec] [53/69] Fetching giflib-5.2.1.pkg: 100%  232 KiB 237.2kB/s    00:01
[blrec] [54/69] Fetching xorgproto-2022.1_1.pkg: 100%  222 KiB 227.0kB/s    00:01
[blrec] [55/69] Fetching libvpx-1.13.0.pkg: 100%    1 MiB   1.3MB/s    00:01
[blrec] [56/69] Fetching jbigkit-2.1_1.pkg: 100%   75 KiB  76.4kB/s    00:01
[blrec] [57/69] Fetching webp-1.3.0_1.pkg: 100%  410 KiB 420.1kB/s    00:01
[blrec] [58/69] Fetching libffi-3.4.4.pkg: 100%   42 KiB  42.5kB/s    00:01
[blrec] [59/69] Fetching readline-8.2.1.pkg: 100%  367 KiB 376.2kB/s    00:01
[blrec] [60/69] Fetching libvdpau-1.5.pkg: 100%   61 KiB  62.1kB/s    00:01
[blrec] [61/69] Fetching libXdmcp-1.1.3.pkg: 100%   14 KiB  14.2kB/s    00:01
[blrec] [62/69] Fetching graphite2-1.3.14.pkg: 100%   98 KiB 100.0kB/s    00:01
[blrec] [63/69] Fetching shared-mime-info-2.2_1.pkg: 100%  531 KiB 543.5kB/s    00:01
[blrec] [64/69] Fetching tiff-4.4.0_1.pkg: 100%  865 KiB 885.5kB/s    00:01
[blrec] [65/69] Fetching libv4l-1.23.0.pkg: 100%  370 KiB 378.5kB/s    00:01
[blrec] [66/69] Fetching expat-2.5.0.pkg: 100%  107 KiB 110.0kB/s    00:01
[blrec] [67/69] Fetching harfbuzz-7.3.0.pkg: 100%    1 MiB   1.1MB/s    00:01
[blrec] [68/69] Fetching lame-3.100_4.pkg: 100%  357 KiB 365.8kB/s    00:01
[blrec] [69/69] Fetching libpciaccess-0.17.pkg: 100%   16 KiB  16.1kB/s    00:01
Checking integrity... done (0 conflicting)
[blrec] [1/69] Installing indexinfo-0.3.1...
[blrec] [1/69] Extracting indexinfo-0.3.1: 100%
[blrec] [2/69] Installing mpdecimal-2.5.1...
[blrec] [2/69] Extracting mpdecimal-2.5.1: 100%
[blrec] [3/69] Installing gettext-runtime-0.21.1...
[blrec] [3/69] Extracting gettext-runtime-0.21.1: 100%
[blrec] [4/69] Installing libffi-3.4.4...
[blrec] [4/69] Extracting libffi-3.4.4: 100%
[blrec] [5/69] Installing readline-8.2.1...
[blrec] [5/69] Extracting readline-8.2.1: 100%
[blrec] [6/69] Installing liblz4-1.9.4,1...
[blrec] [6/69] Extracting liblz4-1.9.4,1: 100%
[blrec] [7/69] Installing pcre2-10.42...
[blrec] [7/69] Extracting pcre2-10.42: 100%
[blrec] [8/69] Installing libiconv-1.17...
[blrec] [8/69] Extracting libiconv-1.17: 100%
[blrec] [9/69] Installing libxml2-2.10.4...
[blrec] [9/69] Extracting libxml2-2.10.4: 100%
[blrec] [10/69] Installing python39-3.9.17...
[blrec] [10/69] Extracting python39-3.9.17: 100%
[blrec] [11/69] Installing xorgproto-2022.1_1...
[blrec] [11/69] Extracting xorgproto-2022.1_1: 100%
[blrec] [12/69] Installing jpeg-turbo-2.1.5.1...
[blrec] [12/69] Extracting jpeg-turbo-2.1.5.1: 100%
[blrec] [13/69] Installing zstd-1.5.5...
[blrec] [13/69] Extracting zstd-1.5.5: 100%
[blrec] [14/69] Installing libdeflate-1.18...
[blrec] [14/69] Extracting libdeflate-1.18: 100%
[blrec] [15/69] Installing libXau-1.0.9...
[blrec] [15/69] Extracting libXau-1.0.9: 100%
[blrec] [16/69] Installing glib-2.76.4,2...
[blrec] [16/69] Extracting glib-2.76.4,2: 100%
[blrec] [17/69] Installing jbigkit-2.1_1...
[blrec] [17/69] Extracting jbigkit-2.1_1: 100%
[blrec] [18/69] Installing libXdmcp-1.1.3...
[blrec] [18/69] Extracting libXdmcp-1.1.3: 100%
[blrec] [19/69] Installing png-1.6.39...
[blrec] [19/69] Extracting png-1.6.39: 100%
[blrec] [20/69] Installing libxcb-1.15_1...
[blrec] [20/69] Extracting libxcb-1.15_1: 100%
[blrec] [21/69] Installing brotli-1.0.9,1...
[blrec] [21/69] Extracting brotli-1.0.9,1: 100%
[blrec] [22/69] Installing Imath-3.1.9...
[blrec] [22/69] Extracting Imath-3.1.9: 100%
[blrec] [23/69] Installing shared-mime-info-2.2_1...
[blrec] [23/69] Extracting shared-mime-info-2.2_1: 100%
[blrec] [24/69] Installing tiff-4.4.0_1...
[blrec] [24/69] Extracting tiff-4.4.0_1: 100%
[blrec] [25/69] Installing freetype2-2.12.1_2...
[blrec] [25/69] Extracting freetype2-2.12.1_2: 100%
[blrec] [26/69] Installing highway-1.0.4_1...
[blrec] [26/69] Extracting highway-1.0.4_1: 100%
[blrec] [27/69] Installing libunistring-1.1...
[blrec] [27/69] Extracting libunistring-1.1: 100%
[blrec] [28/69] Installing gmp-6.2.1...
[blrec] [28/69] Extracting gmp-6.2.1: 100%
[blrec] [29/69] Installing libtasn1-4.19.0...
[blrec] [29/69] Extracting libtasn1-4.19.0: 100%
[blrec] [30/69] Installing gdk-pixbuf2-2.42.10...
[blrec] [30/69] Extracting gdk-pixbuf2-2.42.10: 100%
[blrec] [31/69] Installing libepoll-shim-0.0.20230411...
[blrec] [31/69] Extracting libepoll-shim-0.0.20230411: 100%
[blrec] [32/69] Installing libX11-1.8.6,1...
[blrec] [32/69] Extracting libX11-1.8.6,1: 100%
[blrec] [33/69] Installing openexr-3.1.11...
[blrec] [33/69] Extracting openexr-3.1.11: 100%
[blrec] [34/69] Installing giflib-5.2.1...
[blrec] [34/69] Extracting giflib-5.2.1: 100%
[blrec] [35/69] Installing graphite2-1.3.14...
[blrec] [35/69] Extracting graphite2-1.3.14: 100%
[blrec] [36/69] Installing expat-2.5.0...
[blrec] [36/69] Extracting expat-2.5.0: 100%
[blrec] [37/69] Installing libpciaccess-0.17...
[blrec] [37/69] Extracting libpciaccess-0.17: 100%
[blrec] [38/69] Installing libidn2-2.3.4...
[blrec] [38/69] Extracting libidn2-2.3.4: 100%
[blrec] [39/69] Installing nettle-3.9.1...
[blrec] [39/69] Extracting nettle-3.9.1: 100%
[blrec] [40/69] Installing libudev-devd-0.5.1...
[blrec] [40/69] Extracting libudev-devd-0.5.1: 100%
[blrec] [41/69] Installing libunibreak-5.1,1...
[blrec] [41/69] Extracting libunibreak-5.1,1: 100%
[blrec] [42/69] Installing libXext-1.3.4,1...
[blrec] [42/69] Extracting libXext-1.3.4,1: 100%
[blrec] [43/69] Installing fribidi-1.0.13...
[blrec] [43/69] Extracting fribidi-1.0.13: 100%
[blrec] [44/69] Installing vmaf-2.3.1...
[blrec] [44/69] Extracting vmaf-2.3.1: 100%
[blrec] [45/69] Installing libdrm-2.4.115,1...
[blrec] [45/69] Extracting libdrm-2.4.115,1: 100%
[blrec] [46/69] Installing argp-standalone-1.5.0...
[blrec] [46/69] Extracting argp-standalone-1.5.0: 100%
[blrec] [47/69] Installing libogg-1.3.5,4...
[blrec] [47/69] Extracting libogg-1.3.5,4: 100%
[blrec] [48/69] Installing libXfixes-6.0.0...
[blrec] [48/69] Extracting libXfixes-6.0.0: 100%
[blrec] [49/69] Installing p11-kit-0.24.1_2...
[blrec] [49/69] Extracting p11-kit-0.24.1_2: 100%
[blrec] [50/69] Installing wayland-1.22.0...
[blrec] [50/69] Extracting wayland-1.22.0: 100%
[blrec] [51/69] Installing fontconfig-2.14.2,1...
[blrec] [51/69] Extracting fontconfig-2.14.2,1: 100%
[blrec] [52/69] Installing libjxl-0.8.2...
[blrec] [52/69] Extracting libjxl-0.8.2: 100%
[blrec] [53/69] Installing harfbuzz-7.3.0...
[blrec] [53/69] Extracting harfbuzz-7.3.0: 100%
[blrec] [54/69] Installing libass-0.17.1_1...
[blrec] [54/69] Extracting libass-0.17.1_1: 100%
[blrec] [55/69] Installing x265-3.4_2...
[blrec] [55/69] Extracting x265-3.4_2: 100%
[blrec] [56/69] Installing libx264-0.164.3095...
[blrec] [56/69] Extracting libx264-0.164.3095: 100%
[blrec] [57/69] Installing opus-1.4...
[blrec] [57/69] Extracting opus-1.4: 100%
[blrec] [58/69] Installing libvorbis-1.3.7_2,3...
[blrec] [58/69] Extracting libvorbis-1.3.7_2,3: 100%
[blrec] [59/69] Installing svt-av1-1.6.0...
[blrec] [59/69] Extracting svt-av1-1.6.0: 100%
[blrec] [60/69] Installing libva-2.18.0...
[blrec] [60/69] Extracting libva-2.18.0: 100%
[blrec] [61/69] Installing aom-3.6.1...
[blrec] [61/69] Extracting aom-3.6.1: 100%
[blrec] [62/69] Installing gnutls-3.7.9...
[blrec] [62/69] Extracting gnutls-3.7.9: 100%
[blrec] [63/69] Installing dav1d-1.2.1...
[blrec] [63/69] Extracting dav1d-1.2.1: 100%
[blrec] [64/69] Installing libvpx-1.13.0...
[blrec] [64/69] Extracting libvpx-1.13.0: 100%
[blrec] [65/69] Installing webp-1.3.0_1...
[blrec] [65/69] Extracting webp-1.3.0_1: 100%
[blrec] [66/69] Installing libvdpau-1.5...
[blrec] [66/69] Extracting libvdpau-1.5: 100%
[blrec] [67/69] Installing libv4l-1.23.0...
[blrec] [67/69] Extracting libv4l-1.23.0: 100%
[blrec] [68/69] Installing lame-3.100_4...
[blrec] [68/69] Extracting lame-3.100_4: 100%
[blrec] [69/69] Installing ffmpeg4-4.4.4_2...
[blrec] [69/69] Extracting ffmpeg4-4.4.4_2: 100%
Building the Shared MIME-Info database cache
Generating GIO modules cache
Running fc-cache to build fontconfig cache...
Compiling glib schemas
No schema files found: doing nothing.
Generating gdk-pixbuf modules cache
=====
Message from python39-3.9.17:

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

py39-gdbm       databases/py-gdbm@py39
py39-sqlite3    databases/py-sqlite3@py39
py39-tkinter    x11-toolkits/py-tkinter@py39
=====
Message from freetype2-2.12.1_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/index.html, if documentation was installed).
=====
Message from wayland-1.22.0:

--
Wayland requires XDG_RUNTIME_DIR to be defined to a path that will
contain "wayland-%d" unix(4) sockets. This is usually handled by
consolekit2 (via ck-launch-session) or pam_xdg (via login).
=====
Message from libjxl-0.8.2:

--
Additional packages recommended for new users:
- imlib2-jxl (e.g., feh, scrot)
- kf5-kimageformats (e.g., nomacs, flameshot, skanlite)
- gimp-jxl-plugin

跑一下ffmpeg4 看看会不会出现错误

root@blrec:~ # /usr/local/ffmpeg4/bin/ffmpeg
ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers
  built with FreeBSD clang version 13.0.0 ([email protected]:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
  configuration: --prefix=/usr/local/ffmpeg4 --mandir=/usr/local/ffmpeg4/man --datadir=/usr/local/ffmpeg4/share/ffmpeg4 --docdir=/usr/local/ffmpeg4/share/doc/ffmpeg4 --pkgconfigdir=/usr/local/ffmpeg4/libdata/pkgconfig --disable-static --disable-libcelt --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-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 --enable-libmp3lame --disable-liblensfun --disable-libbluray --disable-librsvg --disable-librtmp --enable-libxml2 --disable-lto --disable-lv2 --disable-mbedtls --disable-libmfx --disable-libmodplug --disable-libmysofa --enable-network --disable-nonfree --enable-nvenc --disable-openal --disable-opencl --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-libopenmpt --disable-openssl --disable-libopenvino --enable-optimizations --enable-libopus --disable-pocketsphinx --disable-libpulse --disable-librabbitmq --disable-librav1e --disable-librist --enable-runtime-cpudetect --disable-librubberband --disable-sdl2 --disable-libsmbclient --disable-libsnappy --disable-sndio --disable-libsoxr --disable-libspeex --disable-libsrt --disable-libssh --enable-libsvtav1 --disable-libtensorflow --disable-libtesseract --disable-libtheora --disable-libtwolame --disable-libuavs3d --enable-libv4l2 --enable-vaapi --disable-vapoursynth --enable-vdpau --disable-libvidstab --enable-libvmaf --enable-libvorbis --disable-libvo-amrwbenc --enable-libvpx --disable-vulkan --enable-libwebp --enable-libx264 --enable-libx265 --disable-libxavs2 --enable-libxcb --disable-libxvid --disable-outdev=xv --disable-libzimg --disable-libzmq --disable-libzvbi
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

处理在默认path找不到ffmpeg和ffprobe

cd /usr/local/bin
ln -s ../ffmpeg4/bin/ffmpeg
ln -s ../ffmpeg4/bin/ffprobe
cd ~

通过pip安装blrec

根据官方指引 用pip安装blrec

先安装pip,不用理他说不推荐用root用户运行pip

pkg install py39-pip
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        py39-pip: 23.1.2
        py39-setuptools: 63.1.0_1

Number of packages to be installed: 2

The process will require 27 MiB more space.
4 MiB to be downloaded.

Proceed with this action? [y/N]: y
[blrec] [1/2] Fetching py39-pip-23.1.2.pkg: 100%    3 MiB   2.7MB/s    00:01
[blrec] [2/2] Fetching py39-setuptools-63.1.0_1.pkg: 100%    1 MiB   1.1MB/s    00:01
Checking integrity... done (0 conflicting)
[blrec] [1/2] Installing py39-setuptools-63.1.0_1...
[blrec] [1/2] Extracting py39-setuptools-63.1.0_1: 100%
[blrec] [2/2] Installing py39-pip-23.1.2...
[blrec] [2/2] Extracting py39-pip-23.1.2: 100%
=====
Message from py39-pip-23.1.2:

--
pip MUST ONLY be used:

 * With the --user flag, OR
 * To install or manage Python packages in virtual environments

Failure to follow this warning can and will result in an inconsistent
system-wide Python environment (LOCALBASE/lib/pythonX.Y/site-packages) and
cause errors.

Avoid using pip as root unless you know what you're doing. <<--- 不理他

安装blrec的依赖

pkg install libxml2 libxslt pkgconf rust

屏幕输出

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 10 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        ca_root_nss: 3.89.1
        curl: 8.1.2
        libgcrypt: 1.10.2
        libgpg-error: 1.47
        libnghttp2: 1.53.0
        libpsl: 0.21.2_3
        libssh2: 1.11.0,3
        libxslt: 1.1.37
        pkgconf: 1.8.1,1
        rust: 1.70.0_1

Number of packages to be installed: 10

The process will require 1 GiB more space.
135 MiB to be downloaded.

Proceed with this action? [y/N]: y
[blrec] [1/10] Fetching rust-1.70.0_1.pkg: 100%  131 MiB  34.4MB/s    00:04
[blrec] [2/10] Fetching libxslt-1.1.37.pkg: 100%  279 KiB 286.1kB/s    00:01
[blrec] [3/10] Fetching libgcrypt-1.10.2.pkg: 100%  888 KiB 908.9kB/s    00:01
[blrec] [4/10] Fetching libgpg-error-1.47.pkg: 100%  321 KiB 328.4kB/s    00:01
[blrec] [5/10] Fetching curl-8.1.2.pkg: 100%    1 MiB   1.5MB/s    00:01
[blrec] [6/10] Fetching libnghttp2-1.53.0.pkg: 100%  130 KiB 133.0kB/s    00:01
[blrec] [7/10] Fetching libssh2-1.11.0,3.pkg: 100%  268 KiB 274.6kB/s    00:01
[blrec] [8/10] Fetching libpsl-0.21.2_3.pkg: 100%   59 KiB  60.3kB/s    00:01
[blrec] [9/10] Fetching pkgconf-1.8.1,1.pkg: 100%   67 KiB  68.6kB/s    00:01
[blrec] [10/10] Fetching ca_root_nss-3.89.1.pkg: 100%  269 KiB 275.3kB/s    00:01
Checking integrity... done (0 conflicting)
[blrec] [1/10] Installing libgpg-error-1.47...
[blrec] [1/10] Extracting libgpg-error-1.47: 100%
[blrec] [2/10] Installing libnghttp2-1.53.0...
[blrec] [2/10] Extracting libnghttp2-1.53.0: 100%
[blrec] [3/10] Installing libssh2-1.11.0,3...
[blrec] [3/10] Extracting libssh2-1.11.0,3: 100%
[blrec] [4/10] Installing libpsl-0.21.2_3...
[blrec] [4/10] Extracting libpsl-0.21.2_3: 100%
[blrec] [5/10] Installing ca_root_nss-3.89.1...
[blrec] [5/10] Extracting ca_root_nss-3.89.1: 100%
[blrec] [6/10] Installing libgcrypt-1.10.2...
[blrec] [6/10] Extracting libgcrypt-1.10.2: 100%
[blrec] [7/10] Installing curl-8.1.2...
[blrec] [7/10] Extracting curl-8.1.2: 100%
[blrec] [8/10] Installing rust-1.70.0_1...
[blrec] [8/10] Extracting rust-1.70.0_1: 100%
[blrec] [9/10] Installing libxslt-1.1.37...
[blrec] [9/10] Extracting libxslt-1.1.37: 100%
[blrec] [10/10] Installing pkgconf-1.8.1,1...
[blrec] [10/10] Extracting pkgconf-1.8.1,1: 100%
=====
Message from ca_root_nss-3.89.1:

--
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

处理pkgconfig找不到libavformat.pc

setenv PKG_CONFIG_PATH /usr/local/ffmpeg4/libdata/pkgconfig

如果pip install blrec遇到错误 av/logging.pyx:351:28: Cannot assign type 'void (void *, int, const char *, va_list) except * nogil' to 'av_log_callback'

处理cpython3.0的py-av的bug

echo "cython<3.0" >> /root/c.txt
setenv PIP_CONSTRAINT /root/c.txt

执行安装

pip install blrec

屏幕输出

root@blrec:~ # pip install blrec
Collecting blrec
  Downloading blrec-1.13.0-py3-none-any.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 3.5 MB/s eta 0:00:00
Collecting python-liquid<2.0.0,>=1.2.1 (from blrec)
  Downloading python_liquid-1.9.4-py3-none-any.whl (199 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.2/199.2 kB 4.5 MB/s eta 0:00:00
Collecting typing-extensions>=3.10.0.0 (from blrec)
  Downloading typing_extensions-4.7.1-py3-none-any.whl (33 kB)
Collecting ordered-set<5.0.0,>=4.1.0 (from blrec)
  Downloading ordered_set-4.1.0-py3-none-any.whl (7.6 kB)
Collecting fastapi<0.89.0,>=0.88.0 (from blrec)
  Downloading fastapi-0.88.0-py3-none-any.whl (55 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.5/55.5 kB 1.4 MB/s eta 0:00:00
Collecting email-validator<2.0.0,>=1.1.3 (from blrec)
  Downloading email_validator-1.3.1-py2.py3-none-any.whl (22 kB)
Collecting click<8.1.0 (from blrec)
  Downloading click-8.0.4-py3-none-any.whl (97 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.5/97.5 kB 3.2 MB/s eta 0:00:00
Collecting typer<0.8.0,>=0.7.0 (from blrec)
  Downloading typer-0.7.0-py3-none-any.whl (38 kB)
Collecting aiohttp<4.0.0,>=3.8.1 (from blrec)
  Downloading aiohttp-3.8.5.tar.gz (7.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.4/7.4 MB 25.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting requests<3.0.0,>=2.24.0 (from blrec)
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB 1.9 MB/s eta 0:00:00
Collecting aiofiles<23.0.0,>=22.1.0 (from blrec)
  Downloading aiofiles-22.1.0-py3-none-any.whl (14 kB)
Collecting tenacity<9.0.0,>=8.0.1 (from blrec)
  Downloading tenacity-8.2.3-py3-none-any.whl (24 kB)
Collecting colorama<0.5.0,>=0.4.4 (from blrec)
  Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting humanize<4.0.0,>=3.13.1 (from blrec)
  Downloading humanize-3.14.0-py3-none-any.whl (98 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.4/98.4 kB 3.7 MB/s eta 0:00:00
Collecting tqdm<5.0.0,>=4.62.3 (from blrec)
  Downloading tqdm-4.66.1-py3-none-any.whl (78 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 kB 1.6 MB/s eta 0:00:00
Collecting attrs<22.0.0,>=21.2.0 (from blrec)
  Downloading attrs-21.4.0-py2.py3-none-any.whl (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.6/60.6 kB 1.8 MB/s eta 0:00:00
Collecting lxml<5.0.0,>=4.6.4 (from blrec)
  Downloading lxml-4.9.3.tar.gz (3.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.6/3.6 MB 28.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting toml<0.11.0,>=0.10.2 (from blrec)
  Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting m3u8<4.0.0,>=3.3.0 (from blrec)
  Downloading m3u8-3.5.0-py3-none-any.whl (24 kB)
Collecting av<11.0.0,>=10.0.0 (from blrec)
  Downloading av-10.0.0.tar.gz (2.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 19.4 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting jsonpath==0.82 (from blrec)
  Downloading jsonpath-0.82.tar.gz (9.6 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting psutil<6.0.0,>=5.8.0 (from blrec)
  Downloading psutil-5.9.5.tar.gz (493 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 493.5/493.5 kB 10.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting reactivex<5.0.0,>=4.0.0 (from blrec)
  Downloading reactivex-4.0.4-py3-none-any.whl (217 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 217.8/217.8 kB 3.0 MB/s eta 0:00:00
Collecting bitarray<3.0.0,>=2.2.5 (from blrec)
  Downloading bitarray-2.8.1.tar.gz (128 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128.8/128.8 kB 7.4 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting brotli<2.0.0,>=1.0.9 (from blrec)
  Downloading Brotli-1.0.9.zip (510 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 510.2/510.2 kB 11.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting uvicorn[standard]<0.21.0,>=0.20.0 (from blrec)
  Downloading uvicorn-0.20.0-py3-none-any.whl (56 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.9/56.9 kB 993.5 kB/s eta 0:00:00
Collecting charset-normalizer<4.0,>=2.0 (from aiohttp<4.0.0,>=3.8.1->blrec)
  Downloading charset_normalizer-3.2.0-py3-none-any.whl (46 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.7/46.7 kB 1.8 MB/s eta 0:00:00
Collecting multidict<7.0,>=4.5 (from aiohttp<4.0.0,>=3.8.1->blrec)
  Downloading multidict-6.0.4.tar.gz (51 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.3/51.3 kB 1.2 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting async-timeout<5.0,>=4.0.0a3 (from aiohttp<4.0.0,>=3.8.1->blrec)
  Downloading async_timeout-4.0.3-py3-none-any.whl (5.7 kB)
Collecting yarl<2.0,>=1.0 (from aiohttp<4.0.0,>=3.8.1->blrec)
  Downloading yarl-1.9.2.tar.gz (184 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 184.7/184.7 kB 6.6 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting frozenlist>=1.1.1 (from aiohttp<4.0.0,>=3.8.1->blrec)
  Downloading frozenlist-1.4.0.tar.gz (90 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.7/90.7 kB 3.1 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting aiosignal>=1.1.2 (from aiohttp<4.0.0,>=3.8.1->blrec)
  Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Collecting dnspython>=1.15.0 (from email-validator<2.0.0,>=1.1.3->blrec)
  Downloading dnspython-2.4.2-py3-none-any.whl (300 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 300.4/300.4 kB 6.5 MB/s eta 0:00:00
Collecting idna>=2.0.0 (from email-validator<2.0.0,>=1.1.3->blrec)
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 3.4 MB/s eta 0:00:00
Collecting pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2 (from fastapi<0.89.0,>=0.88.0->blrec)
  Downloading pydantic-1.10.12-py3-none-any.whl (158 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 158.4/158.4 kB 5.3 MB/s eta 0:00:00
Collecting starlette==0.22.0 (from fastapi<0.89.0,>=0.88.0->blrec)
  Downloading starlette-0.22.0-py3-none-any.whl (64 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.3/64.3 kB 2.0 MB/s eta 0:00:00
Collecting anyio<5,>=3.4.0 (from starlette==0.22.0->fastapi<0.89.0,>=0.88.0->blrec)
  Downloading anyio-3.7.1-py3-none-any.whl (80 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.9/80.9 kB 2.1 MB/s eta 0:00:00
Collecting iso8601 (from m3u8<4.0.0,>=3.3.0->blrec)
  Downloading iso8601-2.0.0-py3-none-any.whl (7.5 kB)
Collecting python-dateutil>=2.8.1 (from python-liquid<2.0.0,>=1.2.1->blrec)
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 7.1 MB/s eta 0:00:00
Collecting urllib3<3,>=1.21.1 (from requests<3.0.0,>=2.24.0->blrec)
  Downloading urllib3-2.0.4-py3-none-any.whl (123 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 123.9/123.9 kB 3.8 MB/s eta 0:00:00
Collecting certifi>=2017.4.17 (from requests<3.0.0,>=2.24.0->blrec)
  Downloading certifi-2023.7.22-py3-none-any.whl (158 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 158.3/158.3 kB 4.0 MB/s eta 0:00:00
Collecting h11>=0.8 (from uvicorn[standard]<0.21.0,>=0.20.0->blrec)
  Downloading h11-0.14.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 1.5 MB/s eta 0:00:00
Collecting httptools>=0.5.0 (from uvicorn[standard]<0.21.0,>=0.20.0->blrec)
  Downloading httptools-0.6.0.tar.gz (191 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 191.2/191.2 kB 3.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting python-dotenv>=0.13 (from uvicorn[standard]<0.21.0,>=0.20.0->blrec)
  Downloading python_dotenv-1.0.0-py3-none-any.whl (19 kB)
Collecting pyyaml>=5.1 (from uvicorn[standard]<0.21.0,>=0.20.0->blrec)
  Downloading PyYAML-6.0.1.tar.gz (125 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 125.2/125.2 kB 5.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting uvloop!=0.15.0,!=0.15.1,>=0.14.0 (from uvicorn[standard]<0.21.0,>=0.20.0->blrec)
  Downloading uvloop-0.17.0.tar.gz (2.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 13.5 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting watchfiles>=0.13 (from uvicorn[standard]<0.21.0,>=0.20.0->blrec)
  Downloading watchfiles-0.20.0.tar.gz (37 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting websockets>=10.4 (from uvicorn[standard]<0.21.0,>=0.20.0->blrec)
  Downloading websockets-11.0.3-py3-none-any.whl (118 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.1/118.1 kB 2.9 MB/s eta 0:00:00
Collecting six>=1.5 (from python-dateutil>=2.8.1->python-liquid<2.0.0,>=1.2.1->blrec)
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting sniffio>=1.1 (from anyio<5,>=3.4.0->starlette==0.22.0->fastapi<0.89.0,>=0.88.0->blrec)
  Downloading sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting exceptiongroup (from anyio<5,>=3.4.0->starlette==0.22.0->fastapi<0.89.0,>=0.88.0->blrec)
  Downloading exceptiongroup-1.1.3-py3-none-any.whl (14 kB)
Building wheels for collected packages: jsonpath, aiohttp, av, bitarray, brotli, lxml, psutil, frozenlist, httptools, multidict, pyyaml, uvloop, watchfiles, yarl
  Building wheel for jsonpath (pyproject.toml) ... done
  Created wheel for jsonpath: filename=jsonpath-0.82-py3-none-any.whl size=5609 sha256=107dd7a6689983c9e58d48082340d3f355819b5eaf07c0e7fc48876cd5edc61d
  Stored in directory: /root/.cache/pip/wheels/42/6a/ff/5a6f028a06347fbccf0e0ba7af11b20eb76b8c3e62382874af
  Building wheel for aiohttp (pyproject.toml) ... done
  Created wheel for aiohttp: filename=aiohttp-3.8.5-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=366119 sha256=9d95149b224ab356835ddb4c72d354069b21b46f68dc9494a8f02bd5c35bea4a
  Stored in directory: /root/.cache/pip/wheels/21/e8/ad/2a45ae6e95ae552b28b9551914b4b7aa57d07666813409d0de
  Building wheel for av (pyproject.toml) ... done
  Created wheel for av: filename=av-10.0.0-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=1524765 sha256=4823a12e5a6e69be43bda93d8d3dbe4195cbf455337295980582e785804eb6bf
  Stored in directory: /root/.cache/pip/wheels/d4/6a/c4/883fe6de0f1f6b09df45e11a9aba3e5f64600621ffb06c889e
  Building wheel for bitarray (pyproject.toml) ... done
  Created wheel for bitarray: filename=bitarray-2.8.1-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=129779 sha256=d6a1f254ac939a4007f6c03ff524508f2c7dde87bd4ba6227efb9b2ba4ff5f26
  Stored in directory: /root/.cache/pip/wheels/07/de/d6/f22eed64f0aedb90fb4b20d95f01768abe734396ac85eba488
  Building wheel for brotli (pyproject.toml) ... done
  Created wheel for brotli: filename=Brotli-1.0.9-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=379473 sha256=dabdd01928ba75905acd4267d49d0b0cbf406b52c20732b8b83e90b987837154
  Stored in directory: /root/.cache/pip/wheels/fc/64/ad/723809ab7a5b321a3e5997a75e00f388547f49f73b3192a32a
  Building wheel for lxml (pyproject.toml) ... done
  Created wheel for lxml: filename=lxml-4.9.3-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=1772007 sha256=829489dc05863679bb05ca2c408897c656d8d0f01d4d62fe8e05484e47117ae3
  Stored in directory: /root/.cache/pip/wheels/5c/05/aa/530f84480d476c5bb9ea09877eea78fb144ec047fbb00ee2ca
  Building wheel for psutil (pyproject.toml) ... done
  Created wheel for psutil: filename=psutil-5.9.5-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=251427 sha256=d720d5df0c8c528f8928fa0b838da1e478f3a9f382ff22d45ce3cf5a52578906
  Stored in directory: /root/.cache/pip/wheels/74/d1/7d/d9ae7d9aea0f1cebed73f37868df7b5f3333e7f30163b3e558
  Building wheel for frozenlist (pyproject.toml) ... done
  Created wheel for frozenlist: filename=frozenlist-1.4.0-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=50720 sha256=efd8a97847a2a66376015d42d5a05742c86b868bef4940924ba110e73aebd0f6
  Stored in directory: /root/.cache/pip/wheels/14/b4/1d/9f2f3e0888f8a14c071ebf791c72f502c2209187ec0c3426fe
  Building wheel for httptools (pyproject.toml) ... done
  Created wheel for httptools: filename=httptools-0.6.0-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=176115 sha256=ad176f8f5e32c054cdd8aa0ab286e794d5f36d690686c4fc21d38484e5110121
  Stored in directory: /root/.cache/pip/wheels/b2/3b/b3/5fbf3a11e6139b7fa6a242100d27bb8583a9ac4c551cb602b9
  Building wheel for multidict (pyproject.toml) ... done
  Created wheel for multidict: filename=multidict-6.0.4-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=31516 sha256=bd0bc610af68fd0c208c4bfbb92e459e396e6a0167771f618772beff9cf47cbf
  Stored in directory: /root/.cache/pip/wheels/5e/d2/ef/42687947d952e529d22fb28f3d2104f2f849f70dab9dcbdbbc
  Building wheel for pyyaml (pyproject.toml) ... done
  Created wheel for pyyaml: filename=PyYAML-6.0.1-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=45375 sha256=c5c1f6d50cd22de938d9561a3a0aff169d073e08469a61e2b662e8152be430c3
  Stored in directory: /root/.cache/pip/wheels/1c/ff/88/3a317d1db793206ab64cb66367bf6f84186b75849656be786a
  Building wheel for uvloop (pyproject.toml) ... done
  Created wheel for uvloop: filename=uvloop-0.17.0-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=1646788 sha256=7b75d10269debc24011a1018b9f1aadcc46b489f3b92623ba11226c6e4a3a99f
  Stored in directory: /root/.cache/pip/wheels/d3/a4/26/26c10e0495f1fc3ee65c2e82a79f50790f8fcd2d4b49735fcd
  Building wheel for watchfiles (pyproject.toml) ... done
  Created wheel for watchfiles: filename=watchfiles-0.20.0-cp37-abi3-freebsd_13_1_RELEASE_p7_amd64.whl size=441240 sha256=1f67796aa18364cec78267b6c49dfc6cefa1fe26b5566aeb1b7106d9967dcd15
  Stored in directory: /root/.cache/pip/wheels/cb/b3/a7/296ce7f9301e4e84cc70a1ee3e0a56a3bc8d96f872bc41c487
  Building wheel for yarl (pyproject.toml) ... done
  Created wheel for yarl: filename=yarl-1.9.2-cp39-cp39-freebsd_13_1_release_p7_amd64.whl size=68368 sha256=2529290137df44041404488dbb540005313d635dc982df5d9ef7654b249cb32a
  Stored in directory: /root/.cache/pip/wheels/a1/f4/a8/831855a235f9d3d7c609704a45ffc9f4c0679fe08262d345a2
Successfully built jsonpath aiohttp av bitarray brotli lxml psutil frozenlist httptools multidict pyyaml uvloop watchfiles yarl
Installing collected packages: jsonpath, brotli, bitarray, av, websockets, uvloop, urllib3, typing-extensions, tqdm, toml, tenacity, sniffio, six, pyyaml, python-dotenv, psutil, ordered-set, multidict, lxml, iso8601, idna, humanize, httptools, h11, frozenlist, exceptiongroup, dnspython, colorama, click, charset-normalizer, certifi, attrs, async-timeout, aiofiles, yarl, uvicorn, typer, requests, reactivex, python-dateutil, pydantic, m3u8, email-validator, anyio, aiosignal, watchfiles, starlette, python-liquid, aiohttp, fastapi, blrec
Successfully installed aiofiles-22.1.0 aiohttp-3.8.5 aiosignal-1.3.1 anyio-3.7.1 async-timeout-4.0.3 attrs-21.4.0 av-10.0.0 bitarray-2.8.1 blrec-1.13.0 brotli-1.0.9 certifi-2023.7.22 charset-normalizer-3.2.0 click-8.0.4 colorama-0.4.6 dnspython-2.4.2 email-validator-1.3.1 exceptiongroup-1.1.3 fastapi-0.88.0 frozenlist-1.4.0 h11-0.14.0 httptools-0.6.0 humanize-3.14.0 idna-3.4 iso8601-2.0.0 jsonpath-0.82 lxml-4.9.3 m3u8-3.5.0 multidict-6.0.4 ordered-set-4.1.0 psutil-5.9.5 pydantic-1.10.12 python-dateutil-2.8.2 python-dotenv-1.0.0 python-liquid-1.9.4 pyyaml-6.0.1 reactivex-4.0.4 requests-2.31.0 six-1.16.0 sniffio-1.3.0 starlette-0.22.0 tenacity-8.2.3 toml-0.10.2 tqdm-4.66.1 typer-0.7.0 typing-extensions-4.7.1 urllib3-2.0.4 uvicorn-0.20.0 uvloop-0.17.0 watchfiles-0.20.0 websockets-11.0.3 yarl-1.9.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

看看安装哪里去了 应该在/usr/local/bin/blrec

which blrec

测试运行

root@blrec:~ # blrec --host 0.0.0.0 --port 80
[2023-08-25 22:37:50,226] [INFO] [configure_logging] log file: /root/.blrec/logs/blrec_2023-08-25-223750-226696.log
[2023-08-25 22:37:50,228] [INFO] [application] Launched Application v1.13.0
[2023-08-25 22:37:50,228] [INFO] [task_manager] Loading all tasks...
[2023-08-25 22:37:50,228] [INFO] [task_manager] Load all tasks complete

去看看能不能打开网页控制台

用浏览器打开http://<你jail的ip>/

看看上面的日志里面有没有错误

root@blrec:~ # cat  /root/.blrec/logs/blrec_2023-08-25-223750-226696.log
[2023-08-25 22:37:50,226] [INFO] [configure_logging] log file: /root/.blrec/logs/blrec_2023-08-25-223750-226696.log
[2023-08-25 22:37:50,227] [DEBUG] [exception_handler] Enabled Exception Handler
[2023-08-25 22:37:50,227] [DEBUG] [space_monitor] Enabled space monitor
[2023-08-25 22:37:50,227] [DEBUG] [space_reclaimer] Enabled space reclaimer
[2023-08-25 22:37:50,227] [DEBUG] [application] Default umask 18
[2023-08-25 22:37:50,228] [INFO] [application] Launched Application v1.13.0
[2023-08-25 22:37:50,228] [INFO] [task_manager] Loading all tasks...
[2023-08-25 22:37:50,228] [INFO] [task_manager] Load all tasks complete
[2023-08-25 22:39:37,824] [INFO] [application] Exiting Application...
[2023-08-25 22:39:37,824] [DEBUG] [task_manager] Stopping all tasks...
[2023-08-25 22:39:37,824] [DEBUG] [task_manager] Stopped all tasks
[2023-08-25 22:39:37,824] [DEBUG] [task_manager] Destroying all tasks...
[2023-08-25 22:39:37,826] [INFO] [main] Exit

gunicorn不能用于启动blrec

配置blrec随jail启动

mkdir /usr/local/etc/rc.d
touch /usr/local/etc/rc.d/blrec
chmod 0755 /usr/local/etc/rc.d/blrec

写入以下内容

#!/bin/sh

# PROVIDE: blrec
# REQUIRE: NETWORKING
# KEYWORD: shutdown

. /etc/rc.subr

name=blrec
rcvar=blrec_enable

blrec_command="/usr/local/bin/blrec"
command="/usr/sbin/daemon"
pidfile="/var/run/${name}d.pid"

start_precmd="${name}_prestart"

# read configuration and set defaults
load_rc_config $name

blrec_enable=${blrec_enable:-"NO"}

blrec_host=${blrec_host:-"0.0.0.0"}
blrec_port=${blrec_port:-"80"}
blrec_pidfile=${blrec_pidfile:-"/var/run/blrec.pid"}

blrec_config=${blrec_config:-"/cfg/config.toml"}
blrec_rec=${blrec_rec:-"/rec"}
blrec_log=${blrec_log:-"/log"}

blrec_ssl_enable=${blrec_ssl_enable:-"NO"}
blrec_key_file=${blrec_key_file:-"/path/to/key-file"}
blrec_cert_file=${blrec_cert_file:-"/path/to/cert-file"}

blrec_apikey_enable=${blrec_apikey_enable:-"NO"}
blrec_api_key=${blrec_api_key:-"bili2233"}

blrec_prestart() {
  blrec_args="--host ${blrec_host} --port ${blrec_port} --config ${blrec_config} --log-dir ${blrec_log} --out-dir ${blrec_rec}"
  if [ $blrec_ssl_enable = "YES" ];then
    blrec_args="${blrec_args} --key-file ${blrec_key_file} --cert-file ${blrec_cert_file}"
  fi

  if [ $blrec_apikey_enable = "YES" ];then
    blrec_args="${blrec_args} --api-key ${blrec_api_key}"
  fi
  rc_flags="-P ${pidfile} -p ${blrec_pidfile} -r -o ${blrec_log}/blrecd.log ${blrec_command} ${blrec_args}"
}

run_rc_command "$1"

配置blrec设置

# 创建blrec使用的文件夹
mkdir /cfg
touch /cfg/config.toml
mkdir /log
mkdir /rec
# 设置自启
sysrc blrec_enable=YES
# 修复blrec找不到ffmpeg
sysrc blrec_env="PATH=/usr/local/ffmpeg4/bin:/usr/local/bin"

启动blrec

启动服务

root@blrec:/ # service blrec start
Starting blrec.

看看服务有没有正常运行

root@blrec:/ # service blrec status
blrec is running as pid 60988.
root@blrec:/ # ps aux
USER   PID %CPU %MEM    VSZ   RSS TT  STAT STARTED    TIME COMMAND
root 47012  0.0  0.0  11420  2812  -  SsJ  22:18   0:00.02 /usr/sbin/syslogd -c -ss
root 47050  0.0  0.0  11240  2596  -  IsJ  22:18   0:00.03 /usr/sbin/cron -J 15 -s
root 60988  0.0  0.0  10836  2312  -  IsJ  00:34   0:00.00 daemon: /usr/local/bin/blrec[60989] (daemon)
root 60989  0.0  0.1 199752 98564  -  SJ   00:34   0:01.14 /usr/local/bin/python3.9 /usr/local/bin/blrec --host 0.0.0.0 --port 80 --config /cfg/config.toml --log-dir /log --out-dir /rec
root 58726  0.0  0.0  12044  3108  0  IJ   22:53   0:00.00 login [pam] (login)
root 58727  0.0  0.0  13480  4060  0  SJ   22:53   0:00.24 -csh (csh)
root 61027  0.0  0.0  11844  3160  0  R+J  00:36   0:00.00 ps aux
image

停掉jail再打开,看看有没有自动启动

root@truenas[~]# iocage stop blrec
* Stopping blrec
  + Executing prestop OK
  + Stopping services OK
  + Tearing down VNET OK
  + Removing devfs_ruleset: 1002 OK
  + Removing jail process OK
  + Executing poststop OK
root@truenas[~]# iocage start blrec
No default gateway found for ipv6.
* Starting blrec
  + Started OK
  + Using devfs_ruleset: 1002 (iocage generated default)
  + Configuring VNET OK
  + Using IP options: vnet
  + Starting services OK
  + Executing poststart OK
root@truenas[~]# iocage exec blrec service blrec status
blrec is running as pid 61655.

后续设置

杂项

默认监听所有ip的80端口,夫人,你也不想在jail已经是个独立ip还要输入端口号或者访问不到localhost吧?

/log/blrecd.log是重定向的blrec的控制台输出(标准输出)

blrec的rc脚本里面把-o ${blrec_log}/blrecd.log改成-f可以关掉

没测试以非root身份用户运行blrec 可以尝试在rc脚本加入blrec_user=${blrec_user:-"blrec"}修改rc_flags加入-u ${blrec_user} 监听端口改成高端口

修改配置,日志,录制目录

sysrc blrec_config=/cfg/config.toml
sysrc blrec_rec=/rec
sysrc blrec_log=/log

使用SSL

理论上正确配置key和cert就可以

sysrc blrec_ssl_enable=YES
sysrc blrec_key_file=/path/to/key-file
sysrc blrec_cert_file=/path/to/cert-file

使用api key

理论上正确配置rc.conf就可以

sysrc blrec_apikey_enable=YES
sysrc blrec_api_key=bili2233

挂载/rec到disk pool某个文件夹下

在truenas的web界面里面修改即可,略

@frankcui95
Copy link
Contributor Author

@acgnhiki 如果你觉得有用,可以Pin在首页(狗头)

@acgnhiki acgnhiki pinned this issue Sep 28, 2023
@frankcui95
Copy link
Contributor Author

@acgnhiki
freebsd 没有malloc_trim

[2023-08-29 12:17:45,395] [CRITICAL] [exception_handler] [1569975] AttributeError
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/blrec/event/event_emitter.py", line 41, in _emit
await coro(*args, **kwds)
File "/usr/local/lib/python3.9/site-packages/blrec/core/recorder.py", line 382, in on_live_ended
await self._stop_recording()
File "/usr/local/lib/python3.9/site-packages/blrec/core/recorder.py", line 468, in _stop_recording
await self._stream_recorder.stop()
File "/usr/local/lib/python3.9/site-packages/blrec/utils/mixins.py", line 106, in stop
await self._do_stop()
File "/usr/local/lib/python3.9/site-packages/blrec/core/stream_recorder.py", line 259, in _do_stop
malloc_trim(0)
File "/usr/local/lib/python3.9/site-packages/blrec/utils/libc.py", line 16, in malloc_trim
return libc.malloc_trim(pad) == 1
File "/usr/local/lib/python3.9/ctypes/init.py", line 387, in getattr
func = self.getitem(name)
File "/usr/local/lib/python3.9/ctypes/init.py", line 392, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: Undefined symbol "malloc_trim"

另外还有一个不知道怎么看详细错误的flv转mp4的错误

[2023-08-28 02:42:35,938] [ERROR] [postprocessor] [1569975] Failed to remux '/rec/1569975/2023-08/blive_1569975_27-150351.flv' to '/rec/1569975/2023-08/blive_1569975_27-150351.mp4'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant