When I’m watching a video, I will sometimes want to bookmark sections so that I can return to later. I like to use VLC to watch videos mostly because of its variable speed playback feature, particularly useful for speeding through instructional videos. It turns out that VLC understands M3U playlists that you can fill with your own bookmarks. Here’s how to use Applescript to save your bookmarks while watching a video in VLC to an .m3u playlist file.
It’s often the case that I don’t need to upload an entire video (or audio) file to get it transcribed. In particular, the ideal audio/video player for my purposes would make it easy to change playback speed and set bookmarks. This makes it easy to go back and recording the output of the desirable sections (using either SoundTap or Audio Hijack). Using VLC gives you custom bookmarks, but you have to physically push a button in a floating palette (no VLC hotkeys for freeform bookmarks). You can create a custom playlist for a file using VLC to jump to specific parts by writing specific start and stop commands to an m3u file:
To do this, you will need to copy the current timestamp of VLC into your .m3u file. This can be achieved in Windows using an Autohotkey script. On the Mac, not only can you get the timestamp, you can construct the entire necessary playlist structure with your desired punch-in and punch-out points in the correct format using Applescript:
set elapsed to ""
tell application "VLC"
set elapsed to current time
set clipName to (get path of current item) # (get name of current item) for just filename
set bookmarkFile to "$HOME/Desktop/playlist.m3u"
set punchIn to "#EXTVLCOPT:start-time " & elapsed
set punchOut to "#EXTVLCOPT:stop-time " & elapsed & "
" & clipName
set lineCompare to do shell script "tail -n1 -q " & bookmarkFile
if lineCompare contains "#EXTVLCOPT:start-time" then
do shell script "echo " & quoted form of punchOut & " >> " & bookmarkFile
do shell script "echo " & quoted form of punchIn & " >> " & bookmarkFile
The script looks at the last timing in the .m3u playlist file. If it starts with #EXTVLCOPT:start-time, then it knows the next timing will be an #EXTVLCOPT:stop-time together with the filename on the next line. The script saves the playlist to a set file on the desktop. I use the script with Griffin’s Powermate controller, which means I get the punch-in / punch-out bookmark set correctly every time I push down on the Powermate controller without having to think about it. If you want to have it save the playlist file to your current directory, you can either use Applescript or Keyboard Maestro to get the parent folder of the current playing file:
Troubles With VLC
VLC is built by a group of programmers each with their own ideas on what the priorities of the project should be. One area that isn’t consistently updated is the bookmarking feature. So I guess it’s not a big surprise to learn that one day, the above script stopped working after a VLC update. I even tried to manually create bookmarks using VLC’s clunky bookmark feature, and they were not even usable by VLC after I exported them to an m3u file. That’s how wonky VLC’s bookmark feature is, unfortunately.
Going forward, I will have to look outside of VLC for bookmarking video files. I did test out Quickfire, which has support for variable-speed playback and bookmarks. But its in-depth editing features and general design aren’t oriented to quickly scrubbing through a list of video files to bookmark. Another media player with both speed control and support for bookmarking is MPlayer, though it might be abandoned. Although I’d rather digitally bookmark video files as they’re playing, I see two ways forward after somewhat fruitlessly searching for a way to digitally bookmark videos:
1. Keep a pad of paper next to your computer. Write down the video name and your bookmark timings. Low-tech, and actually quite effective. But if you aren’t a disciplined person, forget about it. Your timings are going to be separated from the files, so it’s important that you edit the video files immediately according to your bookmark timings.
2. Use a hotkey combination to record audio as it happens. For my example, I only need the audio from the video files, but you can adapt this workflow to video recording using an app like Screenflow. The idea is that as soon as you hear something you want to keep, you hit a hotkey to start recording.
will start recording when you hit the F8 button and stop when you hit the Pause button on your keyboard.
You will probably need to rewind a bit once you find something you want to record. Powermate has us covered here, as you just set the “rotate left” action while VLC is active to the rewind key combination.