1
0
Fork 0
mirror of https://github.com/alfg/mp4-rust.git synced 2025-01-05 09:58:40 +00:00
Commit graph

146 commits

Author SHA1 Message Date
Stuart Woodbury
4b88f0459e fix(trex): write trexbox and make it a vec 2023-07-14 16:53:49 -04:00
Stuart Woodbury
aeb75eb9f2 fix(moovbox): write out mvex box. 2023-07-14 16:46:36 -04:00
Stuart Woodbury
52e8a8b654 expose StcoBox 2023-07-14 16:40:42 -04:00
Stuart Woodbury
5d070ebfbf expose more boxes 2023-07-14 15:01:05 -04:00
Stuart Woodbury
90b90301ab expose more boxes 2023-07-14 15:00:24 -04:00
Stuart Woodbury
23b8c86eec fix(traf): box size didn't include tfdt 2023-07-14 12:13:42 -04:00
Stuart Woodbury
8ce513414c fix(moof): size returned by write_box 2023-07-14 11:38:41 -04:00
Stuart Woodbury
cd86f1c4be undo bugs introduced to TrunBox by previous commit(s) 2023-07-14 11:00:16 -04:00
Stuart Woodbury
d5eec0666e fix get_size() for trunbox 2023-07-14 10:50:51 -04:00
Stuart Woodbury
c669d7b080 fix(TrafBox): write out tfdt and trun 2023-07-14 00:54:25 -04:00
Stuart Woodbury
66f177005b expose mfhd box 2023-07-13 16:38:57 -04:00
Stuart Woodbury
9d00214061 expose stsd box 2023-07-13 11:40:45 -04:00
Stuart Woodbury
c84183a942 feat(opus): add opus to StsdBox and implement read/write 2023-07-13 11:04:43 -04:00
Stuart Woodbury
09343a20ee fix(opus): export opus 2023-07-13 10:09:58 -04:00
Stuart Woodbury
b72a26b3f5 feat(opus): add opus box 2023-07-13 10:09:27 -04:00
Stuart Woodbury
2fb21bbbc8 expose more boxes 2023-07-12 13:20:20 -04:00
Stuart Woodbury
1101df41bb expose TrakBox 2023-07-07 10:49:49 -04:00
Linus Unnebäck
55875d72de
Derive Default trait for DataType (#100) 2023-06-18 20:38:41 -07:00
Richard Steinmetz
a3508fe1c9
Fix link to examples in docs (#97) 2023-03-29 00:04:51 -07:00
oftheforest
7cfdffbd71
Fix several overflows in box and track processing (#94)
* Fix several overflows in box and track processing

* Use size_of::<Type>() instead of magic numbers

* Fix a panic in Mp4Track::read_sample() for one-past-the-end

This appears to be a bug unmasked by other changes. read_sample() calls
sample_offset() then sample_size(), and assumes that if the former returns Ok
then the latter does as well. However, if the sample_id is one past the end,
sample_offset() might succeed (it only checks samples _up to_ the given
sample_id but not _including_ it) while sample_size() fails (because the sample
doesn't exist). read_sample() will then panic.

Fix this by duplicating the error propagation (that is currently done for
sample_offset) for sample_size, instead of unwrapping. This is a cautious
change that fixes the bug; alternatively, having sample_offset() call
sample_size() on the given sample_id and propagate any error might also work.

* Account for header size in box processing overflow fixes

* Ensure that boxes aren't bigger than their containers

Together with the entry_count checks, this eliminates several OOMs when reading
incorrect mp4 files.

* Fix order of arithmetic operations

This was due to an incorrect transcription when switching to checked
arithmetic, and fixes a bug that could cause attempted lookups of the wrong
chunk_id.
2023-02-18 11:46:51 -08:00
Alf
024c26ade7 Add benches to Cargo.toml. 2023-02-01 21:32:02 -08:00
Alf
c8cc6f25a8 0.13.0 2023-02-01 21:25:27 -08:00
Alfred Gutierrez
9f10bd335e
clippy: fix warnings from latest stable rust 1.67.0 (#93) 2023-01-30 20:33:32 -08:00
Jessa
2a374c57f2
Parse unknown metadata and write metadata (#91)
* validate meta box handler type, parse meta with unknown handlers

* parse meta in moov and trak position

* write meta and udta

* fix clippy nit
2023-01-30 19:59:57 -08:00
jensenn
9c0f6534bd
Feature/tfdt box (#90)
* Add Tfdt box parsing

* Derive Default for TfdtBox

* Derive Eq for TfdtBox
2023-01-11 20:21:49 -08:00
Jessa
16c1b5d67f
Don't subtract overflow when 64-bit box size is less than 8 (#89)
* don't subtract overflow when 64-bit box size is less than 8

* fix largesize of 8 being conflated with a size of 0
2023-01-09 23:12:14 -08:00
jensenn
df6e0b5ea0
Fix TfhdBox optional fields (#86)
* Fix TfhdBox optional fields

* clippy fixes

* Cargo fmt fix

Co-authored-by: Alfred Gutierrez <alfg@users.noreply.github.com>
2023-01-05 20:13:48 -08:00
Alfred Gutierrez
3095051512
Fix clippy warnings (#88)
* chore: fix clippy warnings

* Update readme with clippy usage.

* fix fmt warnings.
2023-01-05 19:03:02 -08:00
rolleifx
c26bdcab59
fix "mdat size too large" (#80)
* fix "mdat size too large"

* fix clippy

* Fix clippy::derive-partial-eq-without-eq
2023-01-05 18:19:47 -08:00
Alf
0cd2abb60a 0.12.0 2022-07-30 01:24:49 -07:00
Ririsoft
ace2799c75
read metadata from udta (#77)
This introduces the 'Metadata' trait to enable access
to common video metadata such
title, year, cover art and more.

Reading 'title', 'description', 'poster' and 'year'
metadata is implemented here.
2022-07-20 19:05:38 -07:00
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
TamDik
cc9bf192fa
Fix code example (#75) 2022-06-02 22:21:48 -07:00
Alf
21afff228c 0.11.0 2022-06-01 21:26:07 -07:00
Alf
87933a23da 0.10.1 2022-06-01 21:24:42 -07:00
Alfred Gutierrez
80aabdf549
Update README.md 2022-05-31 20:54:29 -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
Data Retriever
7218ada431
Proper handle display matrix (#72) 2022-05-24 17:32:31 -07:00
Data Retriever
084381bde5
Do not fail if media info fails (#70) 2022-04-20 18:43:18 -07:00
Alf
93dbb56464 lint: fix warnings from unused imports. 2022-03-25 21:06:48 -07:00
Alf
02b87d3ce7 0.10.0 2022-03-25 20:28:48 -07:00
Christopher
b48066fec4
expose all box types (#61) 2022-03-25 20:13:02 -07:00
Alf
b749eaa064 chore: remove travis config and badge. 2022-03-25 20:07:05 -07:00
Alex
12ba304023
Support profiles > 31 in DecoderSpecificDescriptor (#69) 2022-03-25 20:02:50 -07:00
Alf
49f9ed0432 0.9.2 2021-12-23 18:55:47 -08:00
Alfred Gutierrez
e7f5f71ae3
bugfix: break reader loop if BoxHeader is size zero to prevent dead-loop. (#65) 2021-12-23 18:49:01 -08:00
Alf
7be2ebe49d 0.9.1 2021-12-21 20:08:56 -08:00
ahkrr
b4e43c21c2
upgrade dependencies (#62)
bytes 0.5 -> 1.1.0
num-rational 0.3 -> 0.4.0

Co-authored-by: ahkrr <alexhk@protonmail.com>
2021-12-21 19:59:48 -08:00