mirakc-tools for Japanese TV broadcast contents
Get the repository including the Git submodule:
git clone --recursive https://github.com/mirakc/mirakc-arib.gitMake sure that tools listed below has already been installed:
- autoconf
- automake
- cmake
- dos2unix
- gcc/g++
- libtool
- make
- ninja (optional)
- patch
- pkg-config
Then:
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release
ninja -C build vendor
ninja -C build
build/bin/mirakc-arib -hThis repository provides a pre-commit hook that runs MegaLinter with the same configuration as the GitHub Actions workflow. Installing it is optional. However, if you wish to contribute changes, enabling it is highly recommended to catch lint and formatting errors before you commit.
The MegaLinter pre-commit hook requires Docker and pre-commit. MegaLinter runs in Docker using
scripts/mega-linter.sh and compose.mega-linter.yml. On Linux, we recommend
Docker Rootless mode for local runs to prevent the directories and files in
megalinter-reports from being owned by root. This is not a concern in
environments where file ownership inside the container does not map to the host
filesystem, such as Docker Desktop on macOS.
Once Docker and pre-commit are installed, run the following to enable pre-commit hooks:
pre-commit installThe MegaLinter pre-commit hook lints only the staged files and applies any fixes it can make
automatically (APPLY_FIXES=all). When it reports an error or applies a fix, it
aborts the commit. After it applies fixes, re-stage the changed files and commit
again.
The MegaLinter pre-commit hook also skips project-only linters, which cannot run on a file subset. We therefore recommend a full-repository check before pushing (see Running MegaLinter manually).
If you need to commit while lint errors remain, pass --no-verify to
git commit. This skips pre-commit hooks for that single commit without uninstalling them.
Warning
Do not use npx mega-linter-runner to run MegaLinter locally. It may pull a
different version of MegaLinter than the one used in the GitHub Actions
workflow, which can cause inconsistent results.
You can also run MegaLinter directly through scripts/mega-linter.sh.
Unlike the MegaLinter pre-commit hook, it runs with APPLY_FIXES=none by default, so it
only reports problems without modifying any files.
Run it without arguments to lint the whole repository with all linters:
./scripts/mega-linter.shPass file paths as arguments to lint only those files:
./scripts/mega-linter.sh compose.mega-linter.ymlSet ENABLE_LINTERS to run only a specific linter:
ENABLE_LINTERS=EDITORCONFIG_EDITORCONFIG_CHECKER ./scripts/mega-linter.sh compose.mega-linter.ymlSee compose.mega-linter.yml for the full list of environment variables that can
be overridden.
Use a CMake toolchain file like below:
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_TOOLCHAIN_FILE=/path/to/toolchain.cmake
ninja -C build vendor
ninja -C buildContent shown below is a CMake toolchain file which can be used for a cross compilation on a Debian-based Linux distribution, targeting AArch64 like ROCK64:
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(MIRAKC_ARIB_HOST_TRIPLE aarch64-linux-gnu)
set(CMAKE_C_COMPILER ${MIRAKC_ARIB_HOST_TRIPLE}-gcc)
set(CMAKE_C_COMPILER_TARGET ${MIRAKC_ARIB_HOST_TRIPLE})
set(CMAKE_CXX_COMPILER ${MIRAKC_ARIB_HOST_TRIPLE}-g++)
set(CMAKE_CXX_COMPILER_TARGET ${MIRAKC_ARIB_HOST_TRIPLE})Make sure that a toolchain for the cross compilation has been installed before
running cmake with a CMake toolchain file.
Several CMake toolchain files are included in the toolchain.cmake.d folder.
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Debug -D MIRAKC_ARIB_TEST=ON
ninja -C build vendor
ninja -C build check
ninja -C build test
ninja -C build cli-testsThe check target requires clang-format.
Define the MIRAKC_ARIB_LOG environment variable like below:
cat file.ts | MIRAKC_ARIB_LOG=info mirakc-arib scan-servicesOne of the following log levels can be specified:
- trace
- debug
- info
- warning
- error
- critical
- off
tsp creates a thread for each plug-in. This approach can work effectively
when running a single tsp with multiple plug-ins.
Usages of mirakc-arib are different from tsp:
- Multiple mirakc-arib sub-commands may be executed in parallel
- Costs of context switching may be considerable
- It seems not to be a good idea to construct a mirakc-arib sub-command of
multiple plug-ins
- Communication costs between plug-ins may be considerable
mirakc-arib is static-linked against the following libraries:
- mirakc/docopt.cpp forked from docopt/docopt.cpp (BSL-1.0 OR MIT)
- fmtlib/fmt (MIT)
- gabime/spdlog w/ patches/spdlog.patch (MIT)
- Tencent/rapidjson (MIT)
- tplgy/cppcodec (MIT)
- mirakc/tsduck-arib forked from tsduck/tsduck (BSD-2-Clause)
- mirakc/aribb24 forked from nkoriyama/aribb24 (LGPL-3.0)
- DBCTRADO/LibISDB w/ patches/LibISDB.patch (GPL-2.0-or-later)
The following libraries are used for testing purposes:
- google/googletest (BSD-3-Clause)
- google/benchmark (Apache-2.0)
- Add more unit tests
ARIB STD specifications can be freely downloaded from this page.
- ARIB STD-B10: Additional definitions of tables and descriptors
- ARIB STD-B24: Character encoding
mirakc-arib is implemented based on knowledge gained from the following software implementations:
Licensed under:
- the GNU General Public License, version 2.0 or later (GPL-2.0-or-later) (LICENSE or https://www.gnu.org/licenses/gpl-2.0.html)