edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! MPEG program streams -- `.mpg`, `.mpeg`, `.vob`, `.m2p`, a camcorder's `.mod`/`.tod` |
| 2 | //! -- and the raw MPEG-1/2 video streams `.m1v`, `.m2v`, `.mpv`, over the family's own |
| 3 | //! [`ec_mpegts::PsDemuxer`]. |
| 4 | //! |
| 5 | //! A program stream is read by the very readers a transport stream is ([`super::ts`]): |
| 6 | //! [`ts::TsDemuxer`](super::ts::TsDemuxer) for the picture, [`ts::TsAudio`](super::ts::TsAudio) |
| 7 | //! for each sound track, the same time model (source time 0 is the first picture's earliest |
| 8 | //! presentation time), the same refusal wording. What differs lives here: how a file is |
| 9 | //! recognised, how its container is named, and what is said about a track that is refused. |
| 10 | //! |
| 11 | //! Picture: MPEG-1 and MPEG-2 video (the `ec-mpeg2` software seat, deinterlace honoured), |
| 12 | //! H.264 and HEVC. Sound: MPEG audio layers I-III, AC-3 (also a DVD's), DVD LPCM at 16, 20 |
| 13 | //! and 24 bits. Refused by name, with the ffmpeg line: DTS, DVD subtitles (VobSub) and any |
| 14 | //! other private-stream substream. |
| 15 | //! |
| 16 | //! **Known limits.** A raw `.m2v` has no index, so `ec-mpegts` reads the whole file once at |
| 17 | //! open: the picture is opened on the thread that asks, so a UI that opens a clip should |
| 18 | //! do it off its render thread (every open in the engine already is). 20 and 24 bit DVD LPCM |
| 19 | //! may seek to the middle of a two-frame group (a click, not drift). A `.mod` is only taken for |
| 20 | //! a program stream if its bytes are one: the tracker-module spelling is never claimed. |
| 21 | |
| 22 | use *; |
| 23 | |
| 24 | /// The extensions that name a program stream or a raw MPEG video stream outright. |
| 25 | const OWN_EXTENSIONS: & = &; |
| 26 | |
| 27 | /// `.mpg` and `.mpeg` are also the names of bare MPEG audio, and `.mod` of a tracker module: |
| 28 | /// only the content decides these. |
| 29 | const SHARED_EXTENSIONS: & = &; |
| 30 | |
| 31 | pub |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | /// Whether `path` is an MPEG program stream or a raw MPEG video stream: its extension |
| 51 | /// where that is unambiguous, its bytes otherwise (any name at all, `.mpg`/`.mpeg`/`.mod` |
| 52 | /// included). A container whose magic is Matroska's or an mp4's, or a transport stream, is |
| 53 | /// never one. |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | /// Whether `path` is a transport stream, a program stream, an AVI or a raw DV file: the files [`ts`] reads. |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | /// Whether an `.mpg`/`.mpeg` file carries a *picture*, so that it belongs on a video lane and |
| 80 | /// not with the MPEG audio streams those spellings also name. Looks at the first 64 KiB for a |
| 81 | /// program stream with a video PES (or a raw video stream); a file that does not exist, or is |
| 82 | /// anything else, is not one. |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | /// ffprobe's name for the container: `mpeg` for a program stream, `mpegvideo` for a raw |
| 95 | /// video stream; the camcorder's and the disc's own spellings are kept. |
| 96 | pub |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 |