edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! The video profile a probe states (`VideoFacts::profile`), checked against |
| 2 | //! ffprobe's `stream=profile` for every video in `assets/` whose codec is H.264, |
| 3 | //! HEVC, AV1, VP9 or VP8, and for a set of small streams this test encodes itself |
| 4 | //! with ffmpeg: each one in Matroska and, where ffmpeg can remux it, in mp4. |
| 5 | //! |
| 6 | //! A file the engine refuses to open has no `VideoFacts` and is skipped. The |
| 7 | //! generated files live under `CARGO_TARGET_TMPDIR`, never in the source tree. |
| 8 | //! |
| 9 | //! ```text |
| 10 | //! cargo test --release -p engine --test video_profile |
| 11 | //! ``` |
| 12 | |
| 13 | use fs; |
| 14 | use ; |
| 15 | use Command; |
| 16 | |
| 17 | use probe_media; |
| 18 | |
| 19 | /// The codecs whose profile this checks. |
| 20 | const CODECS: = ; |
| 21 | |
| 22 | /// `(name, ffmpeg encoder, extra arguments)`: one half-second stream per case. |
| 23 | const ENCODED: & = & |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 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 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | ; |
| 91 | |
| 92 | /// One ffprobe `stream=<field>` of the first video stream. `None` where ffprobe |
| 93 | /// cannot read the file; an empty string where the stream states no such field. |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | /// Runs ffmpeg quietly and says whether it succeeded. |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | /// Checks `path`: the profile the probe states is the one ffprobe states, with |
| 118 | /// an empty ffprobe answer meaning `None`. |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | /// Every video in `assets/` of one of [`CODECS`] that the engine opens. |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | /// Each generated stream, in Matroska and in mp4 (remuxed by ffmpeg from the |
| 163 | /// Matroska one, skipped where ffmpeg cannot mux it). |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 |