Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/118 iso box parsing #124

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- ISO BMFF parser and utilities [#118](https://github.com/streaming-video-technology-alliance/common-media-library/issues/118)


## [0.7.4] - 2024-11-05

Expand Down
38 changes: 38 additions & 0 deletions dev/isobmff.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<html>

<head></head>

<body>
<video width="480" height="270" controls></video>
<script type="module">
import { findBoxByType, filterBoxesByType, parseBoxes, ftyp, mvhd, sidx, styp } from '../lib/src/isobmff.ts';

// const url = 'https://vod-gcs-cedexis-dev.cbsaavideo.com/CBS_Production_Entertainment_VMS/2024/05/03/2334117955659/15104_cmaf/PARAMOUNT_Spongebob_Movie_The_Sponge_On_The_Run_36369_FTR_R_15102_110.mp4';
const url = '../lib/test/isobmff/fixtures/test_frag.mp4';
const response = await fetch(url, {
// headers: {
// Range: 'bytes=0-11908',
// },
});
const arrayBuffer = await response.arrayBuffer();
const config = { parsers: { ftyp, styp, mvhd, sidx }, recursive: true };

console.time('parseBoxes');
const parsed = parseBoxes(arrayBuffer, config);
console.timeEnd('parseBoxes');
console.log(parsed);

console.time('findBox');
const box = findBoxByType('stsd', arrayBuffer, config)
console.timeEnd('findBox');
console.log(box);

console.time('filterBoxes');
const boxes = filterBoxesByType('mfhd', arrayBuffer, config);
console.timeEnd('filterBoxes');
console.log(boxes.length);
</script>

</body>

</html>
21 changes: 0 additions & 21 deletions dev/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"exclude": [
"**/node_modules",
"**/dist",
"**/samples"
"**/samples"
],
"include": [
"**/*.js"
Expand Down
28 changes: 28 additions & 0 deletions lib/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,31 @@ The src/608.ts implementation in this project is derived from the dash.js librar
**THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.**

-----

The src/isobmff implementation in this project is derived from the codem-isoboxer library
(https://github.com/Dash-Industry-Forum/codem-isoboxer)

Copyright (c) 2015 Hiro, Sjoerd Tieleman

http://madebyhiro.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-----
Loading
Loading