* Fix all issues reported by remark * Move remark dependencies from the workflow definition into package.json This enables the transitive dependencies to be pinned, just like for all other packages. * Add additional remark plugins These are needed to correctly parse certain constructs in Markdown files (such as tables and YAML frontmatter), and without them, remark produces invalid warnings on some files. * Update the remark-lint preset versions The previous versions reference the old version of the `remark-lint-table-cell-padding` plugin, which doesn't work correctly with the current version of `remark-parse` (and thus produces spurious warnings). * GitHub Actions: run remark on all Markdown files, not just changed ones This way, if a PR updates the remark configuration and that causes new errors to appear, those errors will show up in that PR, instead of the (unrelated) PR that next updates the affected files. There is no runtime cost to this, because remark takes approximately 1 second to check all files. |
5 years ago | |
|---|---|---|
| .. | ||
| Decoder.js | 6 years ago | |
| Decoder.worker.js | 6 years ago | |
| README.md | 5 years ago | |
| avc.wasm | 6 years ago | |
| mp4.js | 6 years ago | |
README.md
3rdparty components
These files are from the Broadway.js repository:
- Decoder.js
- mp4.js
- avc.wasm
Why do we store them here?
Authors don't provide an npm package, so we need to store these components in our repository. We use this dependency to decode video chunks from a server and split them to frames on client side.
We need to run this package in node environent (for example for debug, or for running unit tests).
But there aren't any ways to do that (even with syntetic environment, provided for example by the package browser-env).
For example there are issues with canvas using (webpack doesn't work with binary canvas package for node-js) and others.
So, we have solved to write patch file for this library.
It modifies source code a little to support our scenario of using.
How to build awc.wasm and Decoder.js
-
Clone Emscripten SDK, install and activate the latest fastcomp SDK:
git clone https://github.com/emscripten-core/emsdk.git && cd emsdk./emsdk install latest-fastcomp./emsdk activate latest-fastcomp -
Clone Broadway.js
git clone https://github.com/mbebenita/Broadway.git && cd Broadway/Decoder -
Edit
make.py:- Remove or comment the following options:
'-s', 'NO_BROWSER=1',
'-s', 'PRECISE_I64_MATH=0', - Remove
"HEAP8", "HEAP16", "HEAP32"from theEXPORTED_FUNCTIONSlist. - Increase total memory to make possible decode 4k videos
(or try to enable
ALLOW_MEMORY_GROWTH, but this option has not been tested):
'-s', 'TOTAL_MEMORY=' + str(100*1024*1024), - Add the following options:
'-s', "ENVIRONMENT='worker'",
'-s', 'WASM=1',
- Remove or comment the following options:
-
Activate emsdk environment and build Broadway.js:
. /tmp/emsdk/emsdk_env.shpython2 make.py -
Copy the following files to cvat-data 3rdparty source folder:
cd ..cp Player/avc.wasm Player/Decoder.js Player/mp4.js <CVAT_FOLDER>/cvat-data/src/js/3rdparty
How work with a patch file
# from cvat-data/src/js
cp -r 3rdparty 3rdparty_edited
# change 3rdparty edited as we need
diff -u 3rdparty 3rdparty_edited/ > 3rdparty_patch.diff
patch -p0 < 3rdparty_patch.diff # apply patch from cvat-data/src/js
Also these files have been added to ignore for git in all future revisions:
# from cvat-data dir
git update-index --skip-worktree src/js/3rdparty/*.js
This behaviour can be reset with:
# from cvat-data dir
git update-index --no-skip-worktree src/js/3rdparty/*.js