edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBa3e9dc2Tahinli3 months ago134 commits
| 1 | #!/usr/bin/env bash |
| 2 | # Regenerates the gitignored test fixtures under assets/. |
| 3 | # Needs the ffmpeg CLI (dev tool only — the app itself never uses ffmpeg). |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | # A/V fixture: video + stereo AAC. Left channel 440 Hz, right 880 Hz, so |
| 12 | # channel mapping mistakes are audible; 1 Hz volume pulse makes drift visible. |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | # Second A/V fixture for multi-file import: same properties as test_av.mp4 |
| 20 | # (1280x720@30 baseline, AAC-LC 44.1k stereo) but plainly different content — |
| 21 | # testsrc pattern, 4 s, an octave up (660/1320 Hz) with the same 1 Hz pulse. |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | # Multi-audio fixture: one video and three audio streams, so stream selection |
| 29 | # has something to select. Stream 0 is AAC 44.1k stereo (440 Hz left, 880 Hz |
| 30 | # right), stream 1 is AAC 22.05k mono 220 Hz tagged French — different rate, |
| 31 | # layout and content, so a test can tell which stream it was handed — and |
| 32 | # stream 2 is AC-3, the codec we cannot decode and must still list. |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | # Unsupported-audio fixture: an AC-3 track, which we cannot decode at all. The |
| 46 | # file plays as picture with silence, and the point is that it says so. |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | # The shape a BluRay remux has: 48 kHz 5.1 AC-3, which the decoder downmixes to |
| 52 | # stereo for the timeline. The mono fixture above is the other end of the same |
| 53 | # path — no downmix at all — and both have to work. |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | # Multi-language fixture: the shape real media has — one video and two AAC |
| 59 | # streams that *agree* on rate and layout (44.1k stereo) and differ only in |
| 60 | # language and content, 440/880 Hz undefined and 220/330 Hz French. One |
| 61 | # timeline means one set of audio parameters, so this is the file where the |
| 62 | # second stream can actually be put on the timeline; test_multiaudio.mp4 is the |
| 63 | # file where it cannot, and both cases have to be shown. |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | # VP9 fixture: the same A/V shape as test_av.mp4 (1280x720@30, AAC-LC 44.1k |
| 76 | # stereo) with a VP9 picture, so what the tests measure is the codec and |
| 77 | # nothing else. 2 s, because VP9 only ever decodes on the hardware path. |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | # HEVC fixture: the same A/V shape again, so the tests measure the codec and |
| 85 | # nothing else. 8-bit Main profile, because the plugin's NV12 read-back cannot |
| 86 | # carry Main 10. |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | # The same HEVC stream tagged hvc1, which is what Apple and ffmpeg's mov muxer |
| 94 | # write in practice: mp4 0.14 recognises only a hev1 sample entry, so this one |
| 95 | # is found by demux.rs reading the stsd fourcc itself (`tests/hevc_hvc1.rs`). |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | # AV1 fixture, and the only Matroska one: `mp4 0.14` has no `av01` sample entry |
| 103 | # at all, so AV1 is read out of an mkv (`demux::MkvDemuxer`). Same A/V shape as |
| 104 | # the others so the tests measure the codec and nothing else -- but `-g 30` is |
| 105 | # not a preference: it puts a second keyframe at frame 30, which is what the |
| 106 | # sync index and the seek test are checked against. 8-bit Main profile, because |
| 107 | # the plugin's NV12 read-back cannot carry 10-bit. Its AAC track is deliberate |
| 108 | # too: Matroska audio is not wired to the decoder yet, and the notice that says |
| 109 | # so needs a track to name. |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | # Mismatch fixture: different resolution and no audio track at all, so import |
| 117 | # has something concrete to refuse. |
| 118 | |
| 119 | |
| 120 | # Standalone audio fixtures: the same 440/880 Hz tone with the 1 Hz pulse the |
| 121 | # A/V fixture carries, at test_av.mp4's own 44.1k stereo -- so an imported song |
| 122 | # can share a timeline with the video clips and the peaks tests can reuse the |
| 123 | # dip pattern. One per container we claim to read. |
| 124 | tone="[0:a][1:a]join=inputs=2:channel_layout=stereo,volume='0.5+0.5*sin(2*PI*t)':eval=frame[a]" |
| 125 | for; do |
| 126 | case in |
| 127 | mp3) codec=(-c:a libmp3lame -b:a 128k) ;; |
| 128 | wav) codec=(-c:a pcm_s16le) ;; |
| 129 | flac) codec=(-c:a flac) ;; |
| 130 | ogg) codec=(-c:a libvorbis) ;; |
| 131 | # ALAC in mp4, and raw AAC in ADTS -- the two the mp4/AAC packet-copy |
| 132 | # path cannot claim: one is not AAC, the other is not in an mp4. |
| 133 | m4a) codec=(-c:a alac) ;; |
| 134 | aac) codec=(-c:a aac -b:a 128k -f adts) ;; |
| 135 | esac |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | done |
| 141 | # The refusal fixture: same tone at 48k, which one output device cannot mix |
| 142 | # with a 44.1k timeline. |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 |