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

17 commits

Author SHA1 Message Date
Ririsoft 5d648f1a72
fix clippy & enhance CI/CD (#78)
* fix clippy::unused_io_amount

See related clippy documentation,
but in short some partial reads can occur
in particular with io on the networl.
read_exact/write_all transparently handle such errors.

The fix actually revealed a bug
in 'mp4a' atom parsing, but this is a dangerous change:
Parsing bugs that were transparently ignored
are now failing with error (unattended io eof).

* fix trivial clippy errors

* fix clippy error with always 0 value

* run ci/cd with clippy and latest rust version
2022-07-07 20:02:00 -07:00
nemosupremo 00385bad0b
Writer: Set mvhd/tkhd/mdhd version to 1 if duration is greater than u32::MAX (#76) 2022-06-14 21:44:59 -07:00
Data Retriever 3ecfd0cc9d
Cargo fmt and clippy (#73)
* Run cargo clippy --fix

* Run cargo fmt --all
2022-05-31 20:50:49 -07:00
nemosupremo 33959766d4
Mp4Writer should use co64 by default, then convert to stco is possible for compatibility (#71) 2022-05-24 17:37:25 -07:00
Alf 93dbb56464 lint: fix warnings from unused imports. 2022-03-25 21:06:48 -07:00
Nathan Fiedler 56cc260a5c
fix: minimize assertions in non-test code (#56)
Initial effort to reduce or eliminate the use of assertions in the
production code (i.e. not test code). See issue 43 for an example of how
this can cause an application (thread) to panic when reading an unusual
file. Not all of the changes were as simple as returning an Err, since some
functions did not return a Result. Also, the error type used (InvalidData)
is just a catch-all with a message, and in some cases a more refined error
type may be in order.

cargo test passes
2021-07-12 17:28:39 -07:00
ninthakeey eedccec776
Example/mp4sample supports fragmented mp4 (#46)
* feat: mvex box中的mehd box改为可选,支持fmp4的解析

* feat: example/mp4sample supports fragmented mp4

* feat: utilize function sample_count(), extract duplicated codes as a new function

* feat: field data_offset in TrunBox is optional

* feat: remove an ".expect()"

* feat: remove an ".expect()"

* chore: re-style code
2021-01-28 19:52:35 -08:00
ninthakeey 00b50636b6
example/copy supports vp9-in-mp4 and example/dump supports fmp4 (#41)
* feat: mvex box中的mehd box改为可选,支持fmp4的解析

* feat: support to copy mp4 with vp9 codec, but not support to copy fmp4 with vp9 codec

* Update types.rs

undo unnecessary changes.

* Update types.rs

undo reduce unnecessary changes.

* Update types.rs

* Update mp4copy.rs

Add vp9 code after h265

* Update stsd.rs

Add vp09 after the Hevc

* Update types.rs

Add after the HevcConfig.

* fix: Track.rs add vp9 support

* feat: mp4 writer set vp09 box into stsd box
2021-01-26 19:31:32 -08:00
Alfred Gutierrez 9c43838793
bugfix: fix update_sync_samples in Mp4TrackWriter where sync is not properly set in stss box #38 (#39) 2020-12-24 17:35:13 -08:00
Alfred Gutierrez 6ec013b7b9
Fragmented tracks (#31)
* Add trun box.

* Adding Movie Extends Box and subboxes (mvex, mehd, trex).

* Adding more support for parsing fragmented tracks. Add mp4sample example.

* cleanup

* Set default_sample_duration from moov.mvex.trex for getting fragmented samples.

* fix trex box parsing/writing.
2020-09-14 18:05:34 -07:00
Alf e879500c1a update mp4info example and track. 2020-09-05 13:15:31 -07:00
Alf 421d9e7606 More tx3g box parsing/writing and update tests. 2020-09-05 00:57:15 -07:00
Alf 05e20124e0 Add support for parsing subtitle tracks (tx3g box). 2020-09-04 23:09:33 -07:00
Alf 8def228352 Add support for reading/writing fragmented mp4 (fMP4) boxes. 2020-09-03 21:33:45 -07:00
Alf b4b4dbd49f add support for hev1 box 2020-09-01 20:41:34 -07:00
Alfred Gutierrez c4ff8627b0
Set optional EsdsBox in Mp4aBox. (#23)
* Make EsdsBox in Mp4aBox optional, instead of error when parsing. Also update mp4info example with some missing info that was removed.

* Update Mp4aBox test to check for optional EsdsBox.
2020-08-23 13:38:25 -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