mpv+org - для расшифровки аудио
Средство управления плеером mpv из emacs. Именно удобное для расшифровки. Гонять по многу раз с одного места, возвращаться на короткие промежутки, ставить отметки времени в файле…
- https://github.com/bpanthi977/org-mpv-notes/ - кажется, попытка накрутить поверх mpv.el ещё полезностей. Вроде, сохраняет скриншоты, распознаёт текст с экрана тессерактом. Ну, для меня пока перебор, и тессеракт мне, когда я пробовала, не зашёл.
Расшифровка
- https://ladycat.wordpress.com/2017/01/10/emacs-org-mode-mpv-%D0%B4%D0%BB%D1%8F-%D1%80%D0%B0%D1%81%D1%88%D0%B8%D1%84%D1%80%D0%BE%D0%B2%D0%BA%D0%B8-%D0%B0%D1%83%D0%B4%D0%B8%D0%BE/ - исходная версия текста. В принципе, добавлений - опыт работы не только с аудио, но и с видео есть, последний от 2021-08-23.
Есть печаль — работает как-то слишком «волшебно», в смысле, один и тот же файл может раз пять не открыть с ошибкой «Failed connect to mpv», потом внезапно открывает. Куда тут копать — непонятно, так что пока смиряюсь.
Установить mpv.el можно из MELPA.
- https://github.com/kljohann/mpv.el/wiki
- https://github.com/mpv-player/mpv/wiki - а это вики самого mpv.
- https://github.com/jonniek/mpv-playlistmanager - как работать с плейлистами в mpv
Helper functions to control a mpv process via its IPC interface.
Единственное, что хочется - точность, большую, чем секунды.
Кнопочки:
(global-set-key "\M-ps" 'mpv-play) ; _s_tart (global-set-key "\M-pk" 'mpv-kill) (global-set-key "\M-pp" 'mpv-pause) (global-set-key "\M-pi" 'mpv-insert-playback-position) (global-set-key "\M-pb" 'mpv-seek-backward) (global-set-key "\M-pf" 'mpv-seek-forward) (global-set-key "\M-pt" 'mpv-seek-to-position-at-point);_t_his (global-set-key "\M-pl" 'mpv-speed-decrease); _l_ess (global-set-key "\M-pm" 'mpv-speed-increase); _m_ore (global-set-key "\M-pu" 'mpv-speed-set); _u_se speed - не использую.
Если вставить опцию force-window=yes
в конфиг (~/.config/mpv/mpv.conf
или разрешить конфиги к файлам и в соотв. файл), то окно тоже показывает. Так что с видео работать можно.
Орг-мод в сочетании с mpv.el позволяет делать специальные ссылки — как file:, но открываются при помощи mpv-play. Чтоб не лезть отдельно открывать, что там расшифровываешь, а прямо из файла с расшифровкой запускать.
(org-add-link-type "mpv" #'mpv-play) (defun org-mpv-complete-link (&optional arg) (replace-regexp-in-string "file:" "mpv:" (org-file-complete-link arg) t t))
В текст расшифровки можно вставлять отметки времени для быстрого перехода к ним — сделано из org-timer-item, выглядит примерно так:
- 0:01:15 :: А теперь поговорим о…
Нижеследующее позволяет вставлять такие отметки с позицией в файле по M-RET, если не запущен org-timer, и если это продолжение уже начатого списка (первую можно и вручную вписать, произвольно, потом поставить пару реальных, первую и удалить…):
(defun org-timer-item--mpv-insert-playback-position (fun &rest args) "When no org timer is running but mpv is alive, insert playback position." (if (and (not org-timer-start-time) (mpv-live-p)) (mpv-insert-playback-position t) (apply fun args))) (advice-add 'org-timer-item :around #'org-timer-item--mpv-insert-playback-position)
Чтобы по Enter переходить на указанную позицию в файле:
(add-hook 'org-open-at-point-functions #'mpv-seek-to-position-at-point)
По-моему, всё необходимое.
Собственно mpv
https://github.com/mpv-player/mpv/issues/13662 – ошибка, которая меня зацепила, кажется. https://www.linux.org.ru/forum/multimedia/17577795 – аналогичная моей ситуация. Ждем-с.
Из мана то, что хотелось держать под рукой.
- mpv [options] [file|URL|PLAYLIST|-]
- mpv [options] files
Кнопочки
(The following listings are not necessarily complete. See etc/input.conf for a list of default bindings. User input.conf files and Lua scripts can define additional key bindings.)
Keyboard Control
Самые мне нужные
Скриншоты (выбрать кадр и сохранить его):
- .
- Step forward. Pressing once will pause, every consecutive press will play one frame and then go into pause mode again.
- ,
- Step backward. Pressing once will pause, every consecutive press will play one frame in reverse and then go into pause mode again.
- s
- Take a screenshot.
- S
- Take a screenshot, without subtitles. (Whether this works depends on VO driver support.)
- Ctrl s
- Take a screenshot, as the window shows it (with subtitles, OSD, and scaled video).
Остановиться и выйти:
- p / SPACE
- Pause (pressing again unpauses).
- q
- Stop playing and quit.
- Q
- Like q, but store the current playback position. Playing the same file later will resume at the old playback position if possible.
Регулировать скорость:
- [ and ]
- Decrease/increase current playback speed by 10%.
- { and }
- Halve/double current playback speed.
- BACKSPACE
- Reset playback speed to normal.
Приглушить или усилить звук
- / and *
- Decrease/increase volume.
- 9 and 0
- Decrease/increase volume.
- m
- Mute sound.
Выбрать дорожки
- _
- Cycle through the available video tracks.
- #
- Cycle through the available audio tracks.
Остальные
- LEFT and RIGHT
- Seek backward/forward 5 seconds. Shift+arrow does a 1 second exact seek (see –hr-seek).
- UP and DOWN
- Seek forward/backward 1 minute. Shift+arrow does a 5 second exact seek (see –hr-seek).
- Ctrl+LEFT and Ctrl+RIGHT
- Seek to the previous/next subtitle. Subject to some restrictions and might not always work; see sub-seek command.
- Ctrl+Shift+Left and Ctrl+Shift+Right
- Adjust subtitle delay so that the next or previous subtitle is displayed now. This is especially useful to sync subtitles to audio.
- Shift+BACKSPACE
- Undo the last seek. This works only if the playlist entry was not changed. Hitting it a second time will go back to the original position. See revert-seek command for details.
- Shift+Ctrl+BACKSPACE
- Mark the current position. This will then be used by Shift+BACKSPACE as revert position (once you seek back, the marker will be reset). You can use this to seek around in the file and then return to the exact position where you left off.
- < and >
- Go backward/forward in the playlist.
- ENTER
- Go forward in the playlist.
- f
- Toggle fullscreen (see also –fs).
- ESC
- Exit fullscreen mode.
- T
- Toggle stay-on-top (see also –ontop).
- w and W
- Decrease/increase pan-and-scan range. The e key does the same as W currently, but use is discouraged.
- o (also P)
- Show progression bar, elapsed time and total duration on the OSD.
- O
- Toggle OSD states between normal and playback time/duration.
- v
- Toggle subtitle visibility.
- j and J
- Cycle through the available subtitles.
- z and Z
- Adjust subtitle delay by +/- 0.1 seconds. The x key does the same as Z currently, but use is discouraged.
- l
- Set/clear A-B loop points. See ab-loop command for details.
- L
- Toggle infinite looping.
- Ctrl + and Ctrl -
- Adjust audio delay (A/V sync) by +/- 0.1 seconds.
- Shift+g and Shift+f
- Adjust subtitle font size by +/- 10%.
- u
- Switch between applying no style overrides to SSA/ASS subtitles, and overriding them almost completely with the normal subtitle style. See –sub-ass-override for more info.
- V
- Toggle subtitle VSFilter aspect compatibility mode. See –sub-ass-vsfilter-aspect-compat for more info.
- r and R
- Move subtitles up/down. The t key does the same as R currently, but use is discouraged.
- PGUP and PGDWN
- Seek to the beginning of the previous/next chapter. In most cases, "previous" will actually go to the beginning of the current chapter; see –chapter-seek-threshold.
- Shift+PGUP and Shift+PGDWN
- Seek backward or forward by 10 minutes. (This used to be mapped to PGUP/PGDWN without Shift.)
- d
- Activate/deactivate deinterlacer.
- A
- Cycle aspect ratio override.
- Ctrl h
- Toggle hardware video decoding on/off.
- Alt+LEFT, Alt+RIGHT, Alt+UP, Alt+DOWN
- Move the video rectangle (panning).
- Alt + and Alt -
- Combining Alt with the + or - keys changes video zoom.
- Alt+BACKSPACE
- Reset the pan/zoom settings.
- F8
- Show the playlist and the current position in it (useful only if a UI window is used, broken on the terminal).
- F9
- Show the list of audio and subtitle streams (useful only if a UI window is used, broken on the terminal).
- i and I
- Show/toggle an overlay displaying statistics about the currently playing file such as codec, framerate, number of dropped frames and so on. See STATS for more information.
- del
- Cycles visibility between never / auto (mouse-move) / always
- `
- Show the console. (ESC closes it again. See CONSOLE.)
(The following keys are valid only when using a video output that supports the corresponding adjustment.)
- 1 and 2
- Adjust contrast.
- 3 and 4
- Adjust brightness.
- 5 and 6
- Adjust gamma.
- 7 and 8
- Adjust saturation.
- Alt+0 (and command+0 on OSX)
- Resize video window to half its original size.
- Alt+1 (and command+1 on OSX)
- Resize video window to its original size.
- Alt+2 (and command+2 on OSX)
- Resize video window to double its original size.
- command + f (OSX only)
- Toggle fullscreen (see also –fs).
(The following keys are valid if you have a keyboard with multimedia keys.)
- PAUSE
- Pause.
- STOP
- Stop playing and quit.
- PREVIOUS and NEXT
- Seek backward/forward 1 minute.
If you miss some older key bindings, look at etc/restore-old-bindings.conf in the mpv git repository.
Mouse Control
- Left double click
- Toggle fullscreen on/off.
- Right click
- Toggle pause on/off.
- Forward/Back button
- Skip to next/previous entry in playlist.
- Wheel up/down
- Seek forward/backward 10 seconds.
- Wheel left/right
- Decrease/increase volume.