A compression/decompression library for AVF files.
Project description
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
结束
- 2字节:
-
事件列, 目前除了按键列其他都存的差分序列, 坐标序列差分后采取zigzag编码, 如果是某些时间段移动距离小的事件, 会把整个事件全部压缩到事件列表上面, 然后根据事件出现的频率进行了从小到大的编码
(压缩什么的交给lzma)- 3个字节的预压缩数据总量(
应该够了吧) - 按键序列(1-2个变长字节, 一般是一个字节)
- 1字节
\xff
表示按键序列结束(用来得出事件数量) - 时间戳差分序列(1-2个变长字节)
- x坐标差分序列(1-2个变长字节)
- y坐标差分序列(1-2个变长字节)
- 3个字节的预压缩数据总量(
-
presuffix
-
文件结尾的字符串录像信息, 只保留数据信息, 不保留文字说明信息
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
avfcomp-1.4.3.tar.gz
(11.5 kB
view details)
Built Distribution
avfcomp-1.4.3-py3-none-any.whl
(12.4 kB
view details)
File details
Details for the file avfcomp-1.4.3.tar.gz
.
File metadata
- Download URL: avfcomp-1.4.3.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d1ef22f01b0c4601a9f104ac3520936ace779a55446d2c4e50991b475e273b6 |
|
MD5 | 110e29bd0010e93ce2ea53a80c545ff0 |
|
BLAKE2b-256 | 20078c616e93d7fe8a98afb5034fcc806e7a2e00155f059d8c6b860198a1792d |
File details
Details for the file avfcomp-1.4.3-py3-none-any.whl
.
File metadata
- Download URL: avfcomp-1.4.3-py3-none-any.whl
- Upload date:
- Size: 12.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18904e5a5150ba5905ac6252c8bf80a73ec447ec2f441aaa6001b3ff2a858fcc |
|
MD5 | d5af5daf2f98e3e3bf80ff092de984a1 |
|
BLAKE2b-256 | 98c62deb9931d914ecccd32cbaf1ba9748b82eede5952724732e3823a6810577 |