flavtool
flavtoolは、味覚情報を埋め込み可能なファイル形式:FlavMP4の解析、 編集を可能にするpythonツールキットです。
インストール方法
pip install flavtool
使用方法
ツールキットは、parser, analyzer,codec,composerに分けられます。
parser
MP4ファイルを構文解析します。
from flavtool.parser import Parser
p = Parser("pathmp4")
box = p.parse()
box = p.parse()
#メディアデータをメモリに読み込まないようにするには、read_mdat_bytes=falseとしてください
box = p.parse(read_mdat_bytes=False)
# boxには構文解析されたBoxの集合が入ります
box.print()
analyzer
パースされた情報を元に、トラック情報、メディア情報などを整理します。
from flavtool.parser import Parser
from flavtool.analyzer import analyze
p = Parser("pathmp4")
box = p.parse(read_mdat_bytes=False)
#解析
flav_mp4 = analyze(box)
#味のトラック情報を取得
taste_track = flav_mp4.tracks["tast"]
#味のデータを取得(Chunk, Sample構造を取っています)
taste_media_data = flav_mp4.tracks["tast"]
codec
味データのデコード/エンコードを行います
from flavtool.codec import get_decoder, get_encoder
import numpy as np
taste = np.array([1,2,3,4,5], dtype=np.uint8)
#非圧縮5次元味データのエンコーダを取得する
encoder = get_encoder("raw5")
#エンコード (5次元 uin8 ndarray -> bytes)
byte_data = encoder(taste)
#デコード (bytes -> 5次元 ndarray uint8)
decoder = get_decoder("raw5")
taste_data = decoder(byte_data)
composer
与えられたFlavMP4構造体の情報を元にMP4データを再合成します
from flavtool.parser import Parser
from flavtool.analyzer import analyze
##サンプルコード準備中
p = Parser("pathmp4")
box = p.parse(read_mdat_bytes=False)
#解析
flav_mp4 = analyze(box)
#味のトラック情報を取得
taste_track = flav_mp4.tracks["tast"]
#味のデータを取得(Chunk, Sample構造を取っています)
taste_media_data = flav_mp4.tracks["tast"]
Metadata
Release files for flavtool 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| flavtool-0.1.1.tar.gz | 18.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flavtool-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.8 kB
Release files / flavtool-0.1.1.tar.gz
| Download URL | flavtool-0.1.1.tar.gz |
|---|---|
| Size | 18.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da2acccf25d82abd62e7306b1e01d8a46d1a6fed0bd171958a1a6622eec6e40e
|
|
BLAKE2b-256 checksum How to use checksums |
3aa2ba79d8a091b352880c89fb4e5a87ed01eb7b570b3f11ec987da7148341fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / flavtool-0.1.1-py3-none-any.whl
| Download URL | flavtool-0.1.1-py3-none-any.whl |
|---|---|
| Size | 33.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b142f0799816ee0335bc6ac036d705b08d5cac1444669594077fadcb4f984de4
|
|
BLAKE2b-256 checksum How to use checksums |
7cefeb4c404bc5c41c599a4dd3b2915b02f4ab58a641cf37f5b797e703d6d82f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for flavtool 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.