Parse emby bif files
git clone https://github.com/zerorooot/BIFParser.git
cd BIFParser
java BIFParser.java "you_bif_file" "image width" "image high"
For example
java BIFParser.java demo-320-10.bif 320 180
The output results are saved in the "demo-320-10" folder
The following specification describes the implementation of the BIF (Base Index Frames) file archive. The BIF archive is used to encapsulate a set of still images for supporting video trick modes (e.g. FF/REW) on the Roku Streaming Player. This format has been optimized for the usage pattern inherent in this model and is well-suited and capable of facilitating those patterns in an efficient manner.
It is important that the file format have the following features:
- It must be easy to find and interpret the archive metadata.
- It must be network-access friendly.
- It must minimize levels of indirection.
- It must be compact.
- It must easily accommodate the entire range of possible data.
The format should also be capable of providing future extensions should they be needed.
This specification assumes that all values are stored little-endian.
All multibyte integers are stored in little-endian format. That is, the first byte is the least significant byte and the last byte is the most significant.
This is a file identifier. It contains enough information to identify the file type uniquely.
byte | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|---|
value | `0x89` | `0x42` | `0x49` | `0x46` | `0x0d` | `0x0a` | `0x1a` | `0x0a` |
This space is reserved for a revision number. The current specification is file format version 0. The value should be incremented for non-backward-compatible revisions of this document.
byte | 8 9 10 11 |
---|---|
value | Version |
This is an unsigned 32-bit value (N) that represents the number of BIF images in the file. The number of entries in the index will be N+1, including the end-of-data entry.
byte | 12 13 14 15 |
---|---|
value | Number of BIF images (N) |
This specifies the denomination of the frame timestamp values. In order to obtain the "real" timestamp (in milliseconds) of a frame, this value is multiplied by the timestamp entry in the BIF index. If this value is 0, the timestamp multiplier shall be 1000 milliseconds.
byte | 16 17 18 19 |
---|---|
value | Timestamp Multiplier (in milliseconds) |
These bytes are reserved for future expansion. They shall be 0.
byte | 20 ... 63 |
---|---|
value | 0x00 / / 0x00 |
This space is used for the BIF index entries. There are N+1 entries. Each entry contains two unsigned 32-bit values.
byte | 64 65 66 67 | 68 69 70 71 |
---|---|---|
index 0 | Frame 0 timestamp | absolute offset of frame |
index 1 | Frame 1 timestamp | absolute offset of frame |
index 2 | Frame 2 timestamp | absolute offset of frame |
... | ||
index N-1 | Frame N-1 timestamp | absolute offset of frame |
index N | 0xffffffff | last byte of data + 1 |
Because the size of each BIF is determined by subtracting its offset from the offset of the next entry in the index, the BIFs shall appear in the index in the same order as they appear in the data section, and they shall be adjacent.
The absolute timstamps of the BIF captures can be obtained by multiplying the frame timestamp by the timestamp multiplier.