Skip to main content

AVF 压缩格式 V1.4.2 (Python 实现)

使用说明

from avfcomp import AVFComp, AVFDecomp, CompHandler

# compress
path = "your/path/raw.avf"
# choose from plain, gzip, bzip2, lzma(default)
Compressor = AVFComp(handler=CompHandler.LZMA)
Compressor.process_in(path)
Compressor.process_out("comp.cvf")

# decompress
path = "your/path/comp.cvf"
# choose from plain, gzip, bzip2, lzma(default)
Decompressor = AVFDecomp(handler=CompHandler.LZMA)
Decompressor.process_in(path)
Decompressor.process_out("raw.avf")

格式说明 (目前支持 Arbiter 0.52+)

  • 对录像先进行一轮预压缩(此时压缩率能够达到15%左右)

  • 可选 gzip, bzip2, lzma 二次压缩,默认采用 lzma 进行二次压缩(此时压缩率接近8%)

  • 1字节: 大版本号

  • 4字节: prefix

  • 1字节: 模式

  • 对于自定义, 用额外的字节存储参数

    • 1字节: 宽w
    • 1字节: 高h
  • 雷的排布

    • 01串表示, 长度可以通过长宽推出来。通过排布可以推出雷数和3BV。
  • prestamp

    • 由 []标志的录像信息
  • preevent

    • 2字节: \x00\x01表示 preevent 结束
  • 事件列, 目前除了按键列其他都存的差分序列, 坐标序列差分后采取zigzag编码, 如果是某些时间段移动距离小的事件, 会把整个事件全部压缩到事件列表上面, 然后根据事件出现的频率进行了从小到大的编码 (压缩什么的交给lzma)

    • 3个字节的预压缩数据总量(应该够了吧)
    • 按键序列(1-2个变长字节, 一般是一个字节)
    • 1字节 \xff表示按键序列结束(用来得出事件数量)
    • 时间戳差分序列(1-2个变长字节)
    • x坐标差分序列(1-2个变长字节)
    • y坐标差分序列(1-2个变长字节)
  • presuffix

  • 文件结尾的字符串录像信息, 只保留数据信息, 不保留文字说明信息

Metadata

Release files for avfcomp 1.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for avfcomp 1.4.3
File Size Uploaded
avfcomp-1.4.3.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for avfcomp 1.4.3
File Interpreter ABI Platform
avfcomp-1.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / avfcomp-1.4.3.tar.gz

Download URL avfcomp-1.4.3.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4d1ef22f01b0c4601a9f104ac3520936ace779a55446d2c4e50991b475e273b6
BLAKE2b-256 checksum
How to use checksums
20078c616e93d7fe8a98afb5034fcc806e7a2e00155f059d8c6b860198a1792d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / avfcomp-1.4.3-py3-none-any.whl

Download URL avfcomp-1.4.3-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18904e5a5150ba5905ac6252c8bf80a73ec447ec2f441aaa6001b3ff2a858fcc
BLAKE2b-256 checksum
How to use checksums
98c62deb9931d914ecccd32cbaf1ba9748b82eede5952724732e3823a6810577
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release history Release notifications | RSS feed

This release

1.4.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page