Skip to main content

味覚情報を埋め込み可能なファイル形式:FlavMP4のキャプチャ、書き出しを行う

Project description

flavpy

flavpyは、味覚情報を埋め込み可能なファイル形式:FlavMP4のキャプチャ、書き込みを行います

インストール方法

pip install flavpy

使用方法

FlavCaptureで読み込み、FlavWriterで書き込みを行います

FlavCapture

FlavMP4ファイルを読み込みます

import flavpy

#コンテキストマネージャを使う場合
with flavpy.FlavCapture("taste.mp4", modal="taste") as cap:
    while True:
        # ret 読み込み成功したかどうか
        # data 読み込んだデータ(ndarray)
        # delta フレームの持続時間(メディア時間基準)
        ret, data, delta = cap.read()
        if not ret:
            break

FlavWriter

FlavMP4ファイルを書き込みます

import flavpy
import numpy as np
#コンテキストマネージャを使う場合 (使わない場合は最後にwriter.export()してください)

#ここでは、add_modalでファイルを指定して、動画ファイルに味覚を付与しています。
with flavpy.FlavWriter("output2.mp4","taste",codec="raw5", fps=60, add_modal_on="output.mp4") as writer:
    data = [[(i*10)%256, i%256, i%256, i%256, i%256] for i in range(100)]
    for d in data:
        writer.write(np.array(d,dtype=np.uint8))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flavpy-1.0.2.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

flavpy-1.0.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file flavpy-1.0.2.tar.gz.

File metadata

  • Download URL: flavpy-1.0.2.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for flavpy-1.0.2.tar.gz
Algorithm Hash digest
SHA256 66d3701cced4f571d9936d9b438998769d1562dd32e7140928d9a60b6e35cb57
MD5 a8f442656034cfc35268735d0828b340
BLAKE2b-256 12b1b8f49e281d81453b3382a42c57abd365a29837fcafdf636ea1a549fe3dc9

See more details on using hashes here.

File details

Details for the file flavpy-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: flavpy-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for flavpy-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 465a2a735572ef1edd83de4fd64924780dd4979e1c1f06ac551b56db4eb799c6
MD5 616c4997c9418393297b18f15e42de55
BLAKE2b-256 e4e2391e1cc2a703646c497fe0b1386ccd8c6a26e523ddb9ad8793e048dc8893

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page