emacs/var/elfeed/db/data/75/757bcad0988795404a38a426cf6312237d55d89c
2022-01-03 12:49:32 -06:00

49 lines
2.1 KiB
Plaintext

<p>
We wanted to trim the Q&amp;A session recordings so that people don't have
to listen to the transition from the main presentation or the long
silence until we got around to stopping the recording.
</p>
<p>
The MPV video player didn't have a waveform view, so I couldn't just
jump to the parts with sound. Audacity could show waveforms, but it
didn't have an easy way to copy the timestamp. I didn't want to bother
with heavyweight video-editing applications on my Lenovo X220. So the
obvious answer is, of course, to make a text editor do the job. Yay
Emacs!
</p>
<div class="figure" id="orgc5aa10c">
<p><img alt="Screenshot_20211204_013446.png" src="https://sachachua.com/blog/2021/12/emacsconf-backstage-picking-timestamps-from-a-waveform/Screenshot_20211204_013446.png" />
</p>
<p><span class="figure-number">Figure 1: </span>Select timestamps using a waveform</p>
</div>
<p>
It's very experimental and I don't know if it'll work for anyone else.
If you want to use it, you will also need <a href="https://github.com/kljohann/mpv.el">mpv.el</a>, the <a href="https://mpv.io/">MPV</a> media
player, and the <a href="https://www.ffmpeg.org/">ffmpeg</a> command-line tool. Here's my workflow:
</p>
<ul class="org-ul">
<li><code>M-x waveform-show</code> to select the file.</li>
<li><code>left-click</code> on the waveform to copy the timestamp and start playing from there</li>
<li><code>right-click</code> to sample from that spot</li>
<li><code>left</code> and <code>right</code> to adjust the position, <code>shift-left</code> and <code>shift-right</code> to take smaller steps</li>
<li><code>SPC</code> to copy the current MPV position</li>
<li><code>j</code> to jump to a timestamp (hh:mm:ss or seconds)</li>
<li><code>&gt;</code> to speed up, <code>&lt;</code> to slow down</li>
</ul>
<p>
I finally figured out how to use SVG to embed the waveform generated
by FFMPEG and animate the current MPV playback position. Whee! There's
lots of room for improvement, but it's a pretty fun start.
</p>
<p>
If you're curious, you can find the code at
<a href="https://github.com/sachac/waveform-el">https://github.com/sachac/waveform-el</a> . Let me know if it actually
works for you!
</p>