edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! A PGS (bitmap) subtitle that goes through ffmpeg into Matroska, read back |
| 2 | //! through edith's own subtitle call site ([`subtitle::of_matroska`]). |
| 3 | //! |
| 4 | //! The source is a `.sup` written here byte for byte, with the `PG` header a |
| 5 | //! Blu-ray `.sup` carries on every segment: one display set that paints a 2x2 |
| 6 | //! white square on an 8x4 canvas at 500 ms, and the erase that ends it at 2 s. |
| 7 | //! ffmpeg reads it with its PGS demuxer and muxes it with `-c:s copy` into an |
| 8 | //! `.mkv`, which is what a rip looks like when it reaches edith. |
| 9 | //! |
| 10 | //! The cue the test expects is the one the display sets state: the start and |
| 11 | //! end in microseconds, and the picture decoded to its pixels. Skipped loudly |
| 12 | //! when ffmpeg is not on the box. |
| 13 | //! |
| 14 | //! ```text |
| 15 | //! cargo test -p engine --release --test pgs_sup_ffmpeg -- --nocapture |
| 16 | //! ``` |
| 17 | |
| 18 | use Path; |
| 19 | use Command; |
| 20 | |
| 21 | use Scratch; |
| 22 | use subtitle; |
| 23 | |
| 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 | /// One `.sup` segment: `PG`, the presentation and decoding times on the 90 kHz |
| 49 | /// clock, the segment type, a big-endian size, then the body. |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | /// The display set that paints a 2x2 white square at (1, 1) of an 8x4 canvas, |
| 62 | /// at `pts_ms`: composition, palette, the object and the end of the set. |
| 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 | /// The display set that composes nothing: the disc clearing the screen. |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 |