edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | #!/usr/bin/env bash |
| 2 | # seed.sh: fill fuzz/corpus/<target>/ from the repo's mp4 fixtures (root fixtures/). |
| 3 | # |
| 4 | # demux_mp4 gets every mp4/m4a/mov fixture at 1 MiB or less as-is. Larger ones are |
| 5 | # re-muxed with `ffmpeg -t 0.2 -c copy` (a few frames, still a real moov |
| 6 | # with its sample tables), so the picture tracks are seeded too. |
| 7 | # esds_parse gets the payload of the first `esds` box in each seed, after its |
| 8 | # version/flags word, found by a plain byte search for the box type. |
| 9 | # is_mp4 gets the first 64 bytes of each seed. |
| 10 | # |
| 11 | # Corpus lives under fuzz/corpus, which is git-ignored. |
| 12 | |
| 13 | |
| 14 | FUZZ_DIR= |
| 15 | FIXTURES=/fixtures |
| 16 | [ || { ; ; } |
| 17 | || { ; ; } |
| 18 | |
| 19 | MP4_DIR="/corpus/demux_mp4" |
| 20 | ESDS_DIR="/corpus/esds_parse" |
| 21 | HEAD_DIR="/corpus/is_mp4" |
| 22 | TMP= |
| 23 | |
| 24 | |
| 25 | |
| 26 | LIMIT= |
| 27 | for |
| 28 | ; do |
| 29 | [ || continue |
| 30 | stem=; stem= |
| 31 | if [; then |
| 32 | |
| 33 | else |
| 34 | # Shorten until it fits: a 4K intra frame alone can be most of a megabyte. |
| 35 | cut="" |
| 36 | for; do |
| 37 | |
| 38 | || { ; ; } |
| 39 | if [; then cut=1; break; fi |
| 40 | done |
| 41 | [ || { ; ; } |
| 42 | |
| 43 | fi |
| 44 | done |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 |