Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hoehermann/mpv-mpegts-truncate
User Script for mpv: Truncates MPEG-TS file at current position.
https://github.com/hoehermann/mpv-mpegts-truncate
Last synced: 21 days ago
JSON representation
User Script for mpv: Truncates MPEG-TS file at current position.
- Host: GitHub
- URL: https://github.com/hoehermann/mpv-mpegts-truncate
- Owner: hoehermann
- License: gpl-3.0
- Created: 2018-04-21T16:28:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-09T07:24:46.000Z (over 6 years ago)
- Last Synced: 2024-10-12T10:13:54.242Z (about 1 month ago)
- Language: Lua
- Size: 16.6 KB
- Stars: 5
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mpv - mpegts-truncate - Removes beginning of MPEG TS file up to current position without re-writing the whole file. (Other)
README
# mpv mpegts truncate
Allows truncating a currently playing mpegts file.
File is NOT completely rewritten/copied/muxed/encoded.
File is edited directly on disk.Relies on fallocate as supplied with your system.
Uses fallocate with FALLOC_FL_COLLAPSE_RANGE, which is
only available on Linux 3.15 (or later) on XFS or ext4 (extent-based files).
See http://man7.org/linux/man-pages/man2/fallocate.2.html.Please note: The point at which the file is truncated is aligned to the
nearest file system block size. The cut mpegts frame will be damaged virtually
always. The rest of the stream should be fine.I use this myself on files of recorded TV shows to remove advertisements
from the beginning of the recording.## Installation
Copy `mpegts_truncate.lua` and `mpegts_truncate.sh` to your mpv script directory (usually `~/.mpv/scripts`).
In case you prefer having `mpegts_truncate.sh` in your path, you can adjust `mpegts_truncate.lua` accordingly.
## Usage
Use the shortcut `Alt+Shift+f` to truncate the currently playing MPEG-TS file up to the current position.
Use the shortcut `Alt+Shift+b` to truncate the currently playing MPEG-TS file at the current position.