| Both sides previous revision Previous revision Next revision | Previous revision |
| c3tracker:cutting [2026/04/11 10:04] – [Notes on Using mpv] Major refactor, document cutter script nicoo | c3tracker:cutting [2026/04/11 16:59] (current) – [mpv/Tips]: fix wiki syntax nicoo |
|---|
| === Notes on Using mpv | === Notes on Using mpv |
| |
| ''mpv'' is a command line media player, which can also be used in our cutting workflow. [[user:nicoo]] wrote [[https://gist.github.com/nicoonoclaste/59c9f8d5ac352202c4d9671442106396|an mpv script]] which automates our cutting workflow. | ''mpv'' is a command line media player, which can also be used in our cutting workflow. [[user:nicoo]] wrote [[https://forgejo.c3voc.de/voc/mpv-scripts|an mpv script]] which automates our cutting workflow. |
| |
| See [[https://mpv.io/manual/master/#keyboard-control|the ''mpv'' manual]] for the default keybinds. | See [[https://mpv.io/manual/master/#keyboard-control|the ''mpv'' manual]] for the default keybinds. |
| The script does not add keybindings by default, and those must be configured in ''~/.config/mpv/input.conf'' like so: | The script does not add keybindings by default, and those must be configured in ''~/.config/mpv/input.conf'' like so: |
| <code> | <code> |
| - script-binding c3voc-cutter-set-in | % script-binding c3voc-cutter-jump-in |
| = script-binding c3voc-cutter-set-out | ^ script-binding c3voc-cutter-jump-out |
| Ctrl+- script-binding c3voc-cutter-jump-in | Ctrl+5 script-binding c3voc-cutter-set-in |
| Ctrl+= script-binding c3voc-cutter-jump-out | Ctrl+6 script-binding c3voc-cutter-set-out |
| </code> | </code> |
| |
| </code> | </code> |
| |
| If using nix / home-manager, the following configuration snippet can be used: | If using nix / home-manager, the script repository is a flake providing the necessary configuration as NixOS and HM modules; just add the following to your (NixOS) imports, replacing ''nicoo'' with your local username: |
| <code> | <code> |
| programs.mpv = { | { |
| config = { | imports = [ c3voc-scripts.nixosModules.default ]; |
| osd-level = 3; | home-manager.users.nicoo.imports = [ c3voc-scripts.homeModules.default ]; |
| osd-status-msg = "''${playback-time/full} / ''${duration} (''${percent-pos}%)\nframe: ''${estimated-frame-number} / ''${estimated-frame-count}"; | c3voc.user = "nicoo"; |
| }; | } |
| scripts = [ | |
| (pkgs.mpvScripts.buildLua { | |
| pname = "mpv-c3voc-cutter"; | |
| version = "unstable"; | |
| dontUnpack = true; | |
| scriptName = "c3voc-cutter.lua"; | |
| scriptPath = "${path/to/c3voc-cutter.lua}"; | |
| }) | |
| ]; | |
| # Set a non-default CIFS mountpoint | |
| #scriptOpts.c3voc.prefix = "/foo"; | |
| bindings = { | |
| "-" = "script-binding c3voc-cutter-set-in"; | |
| "=" = "script-binding c3voc-cutter-set-out"; | |
| "Ctrl+-" = "script-binding c3voc-cutter-jump-in"; | |
| "Ctrl+=" = "script-binding c3voc-cutter-jump-out"; | |
| }; | |
| }; | |
| </code> | </code> |
| |
| ==== Usage (with script) | ==== Usage (with script) |
| |
| * Open ''uncut.ts'' in mpv to start cutting | * Open ''uncut.ts'' in mpv to start cutting |
| * Skim through the video to find the start | * Skim through the video to find the start |
| * mark it by hitting ''-'' (or whichever keybind you set) | * mark it by hitting ''Ctrl+5'' (or whichever keybind you set) |
| * jump back to it with ''Ctrl+-'' | * jump back to it with ''Shift+5'' |
| * you can hit ''-'' again at any point to set a new startpoint | * you can hit ''Ctrl+5'' again at any point to set a new startpoint |
| * Same for the end | * Same for the end |
| * ''mpv'' will write the ''inframe'' and ''outframe'' file when exiting or switching to a new file. | * ''mpv'' will write the ''inframe'' and ''outframe'' file when exiting or switching to a new file. |
| |
| Using ''echo'' works best since some text editors like to create temporary lock files which isn't allowed on the FUSE file system. | Using ''echo'' works best since some text editors like to create temporary lock files which isn't allowed on the FUSE file system. |
| | |
| | ==== Tips |
| | |
| | * [[https://github.com/po5/thumbfast|thumbfast]] can generate thumbnails live, for instance when hovering over a seek bar, which can help find the start and end of a talk faster. (Note: it needs to be used with a UI script, and supports most MPV UIs) |
| | * [[https://github.com/po5/evafast|evafast]] gives fast-forward and seeking on the same key, which is rather convenient. |
| | * [[https://github.com/CounterPillow/mpv-quack|quack]] reduces the volume when seeking, to avoid torturing one's ears during cutting |
| | |
| | |
| | For nix users: those are all packaged, and can be added with |
| | |
| | <code> |
| | programs.mpv.scripts = with pkgs.mpvScripts; [ |
| | evafast |
| | quack |
| | thumbfast # NOTE: useless on its own, combine with its builtin osc.lua, or with alt. OSCs like uosc |
| | ]; |
| | </code> |
| |
| == Known Issues and Solutions | == Known Issues and Solutions |