1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2024-05-08 03:22:59 +00:00
Commit graph

139 commits

Author SHA1 Message Date
Ian Jun b5367032a7
Update examples (#16)
* Add ReadBox trait

* Add boxtype macro

* Remove offset in BoxHeader

* Fix parsing error when box has largesize

* Remove duplicated codes reading version and flags

* Update examples

* Fix test failure

Co-authored-by: Byungwan Jun <unipro.kr@gmail.com>
2020-08-05 23:00:53 -07:00
Ian Jun 3104a2d95b
Feature/mp4copy (#14)
* Add ReadBox trait

* Add boxtype macro

* Remove offset in BoxHeader

* Fix parsing error when box has largesize

* Remove duplicated codes reading version and flags

* Add avc1 box

* Add mp4a box

* Add mp4a box

* Add DecoderSpecificDescriptor in esds box

* Add necessary sub-boxes to stbl box

* Improve ReadBox::read_box()

* Add smhd box

* Refactor BoxHeader

* Refactor BMFF

* Refactor

* Add some functions to get offset and size of sample

* Add Mp4Reader::read_sample() that read media samples

* Move Mp4Reader to reader.rs

* Add mandatory check when reading boxes

Add some methods to Mp4Reader, TrackReader
Format codes

* Update mp4info

* Refactor common types

* Add FixedPointX types

* Add media configuration, profile, ...

* Add initial Mp4Writer

* Run cargo fmt

* Add Mp4Writer and examples/mp4copy

* Add test codes for Avc1Box and Mp4aBox

* Remove prefix "get_" from method names

* Rename atoms to mp4box

* Fix some bugs

Co-authored-by: Byungwan Jun <unipro.kr@gmail.com>
2020-08-04 16:56:59 -07:00
Alfred Gutierrez ba69f3812b
Update example in README.md. 2020-07-31 10:18:06 -07:00
Ian Jun 0df82aec5f
Feature/mp4reader (#13)
* Add ReadBox trait

* Add boxtype macro

* Remove offset in BoxHeader

* Fix parsing error when box has largesize

* Remove duplicated codes reading version and flags

* Add avc1 box

* Add mp4a box

* Add mp4a box

* Add DecoderSpecificDescriptor in esds box

* Add necessary sub-boxes to stbl box

* Improve ReadBox::read_box()

* Add smhd box

* Refactor BoxHeader

* Refactor BMFF

* Refactor

* Add some functions to get offset and size of sample

* Add Mp4Reader::read_sample() that read media samples

Co-authored-by: Byungwan Jun <unipro.kr@gmail.com>
2020-07-31 10:12:26 -07:00
Alf b755db3fa0 Remove Cargo.lock and add to .gitignore. 2020-07-28 22:13:15 -07:00
Ian Jun 4df9fa1bd4
Feature/test write box (#12)
* Add ReadBox trait

* Add boxtype macro

* Remove offset in BoxHeader

* Fix parsing error when box has largesize

* Remove duplicated codes reading version and flags

* Add test code for all leaves in box tree

* Remove entry_count that is duplacated with entries.len()

* Change volume type to Ratio<u16>

Co-authored-by: Byungwan Jun <unipro.kr@gmail.com>
2020-07-28 21:29:04 -07:00
Ian Jun 8f56200dd0
Feature/writebox trait (#11)
* Add ReadBox trait

* Add boxtype macro

* Remove offset in BoxHeader

* Fix parsing error when box has largesize

* Remove duplicated codes reading version and flags

* Simplify all box size types as largesize

* Add WriteBox trait and improve compatibility with large box

* Split large atoms file into smaller ones

* Refator Error

Co-authored-by: Byungwan Jun <unipro.kr@gmail.com>
2020-07-28 09:36:17 -07:00
Alf 95fc64b811 0.4.3 2020-07-26 15:01:15 -07:00
Ian Jun 1e86e4edab
Remove deprecated codes (#9)
* Add ReadBox trait

* Add boxtype macro

* Remove offset in BoxHeader

* Fix parsing error when box has largesize

* Remove duplicated codes reading version and flags

Co-authored-by: Byungwan Jun <unipro.kr@gmail.com>
2020-07-25 20:11:47 -07:00
Alfred Gutierrez a4fd45b3e8
Add basic integration test (#10)
* Add basic integration test and update README and example. Add sample minimal.mp4 file for tests.

* Add .travis.yml file.

* Update readme.
2020-07-25 20:07:39 -07:00
Alf 8dfe751516 0.4.2 2020-07-24 20:02:32 -07:00
Alfred Gutierrez b1b0d597d9
Create rust.yml 2020-07-24 20:00:09 -07:00
Ian Jun 85a65ea596
Add ReadBox trait (#7) 2020-07-24 19:57:46 -07:00
Alf e637fb761e 0.4.1 2020-06-04 23:12:49 -07:00
Nathan Fiedler 958304a9b2
Make the example tolerant of videos missing parts (#5)
* Make the example tolerant of videos missing parts

Some videos are missing certain parts that the example was assuming would be
present. This change makes all such access conditional on the parts being
present. Also added the display of the box version and the creation time in
a human-readable format. This serves to demonstrate the logic for converting
the MP4 epoch (1904-01-01) to Unix epoch (1970-01-01).

* Show creation time as Unix time only
2020-06-04 23:10:33 -07:00
Nathan Fiedler e875c7da44
Skip over unknown boxes (#4)
* Skip over unknown boxes

If the box size is non-zero, skip over it and continue reading. Otherwise if
the box size is zero, exit the loop.

* Add comment clarifying the box skipping
2020-05-27 18:29:41 -07:00
Alf f04ebb4b61 Add skip fn for skipping remaining bytes in a box. 2020-02-05 20:22:08 -08:00
Alf 67303df65e 0.3.0 2020-02-03 21:56:55 -08:00
Alfred Gutierrez ec53b03673
Cleanup and some minor restructuring. (#2)
* Cleanup and some minor restructuring.

* Update readme.
2020-02-03 21:52:23 -08:00
Alf c4fa510f3a 0.2.0 2020-01-28 21:49:38 -08:00
Alf 4a8c4f57b4 cleanup. 2020-01-27 21:58:19 -08:00
Alfred Gutierrez e9936e5f78
Sample boxes and mp4info example updates (#1)
* more sample boxes

* stts and sample box parsing. Update mp4info example with more details.
2020-01-27 21:32:53 -08:00
Alf b345450e19 cleanup on lib and add more mp4info example output. 2020-01-21 21:41:51 -08:00
Alf 56e49bea57 mdia/mdhd/hdlr box parsing. 2020-01-19 23:17:03 -08:00
Alf b50097b784 edts/elst box parsing 2020-01-19 20:34:22 -08:00
Alf b400b02aee TKHD box parsing. 2020-01-16 22:43:41 -08:00
Alf 4acb2cd93f add trak/tkhd box. 2020-01-15 22:53:42 -08:00
Alf c4123f721a Add moov box builder and skip remaining bytes. 2020-01-13 21:10:25 -08:00
Alf 2065b74afd Update package name to 'mp4'. 2020-01-12 19:51:25 -08:00
Alf 0ecbbd6385 Update package name. Forgot to update it in cargo.toml. 2020-01-12 19:48:03 -08:00
Alf 0e12e60f5c Update Cargo.toml. 2020-01-12 19:43:16 -08:00
Alf efd7ac8981 Change main.rs to lib.rs and create example mp4info project. Update readme and license. 2020-01-12 19:33:26 -08:00
Alf d4f69d82ee parse moov and mvhd box. 2020-01-12 01:19:31 -08:00
Alf 06f388f20e update box parsing logic. 2020-01-12 00:00:30 -08:00
Alf fc92c60298 Fix top level box parsing logic. 2020-01-11 19:34:29 -08:00
Alf 7c239e72a0 parse ftyp box 2020-01-09 22:26:08 -08:00
Alfred Gutierrez b9cdabc9d7
Create README.md 2020-01-07 22:53:15 -08:00
Alf 9994a0a6a7 Update main.rs. 2020-01-07 22:51:21 -08:00
Alf 5d11bf9c78 Basic example of parsing mp4 atom boxes in rust. 2020-01-07 21:34:01 -08:00