<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Derek</id>
	<title>VideoLAN Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Derek"/>
	<link rel="alternate" type="text/html" href="https://wiki.videolan.org/Special:Contributions/Derek/"/>
	<updated>2026-11-04T14:49:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17171</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17171"/>
		<updated>2010-10-06T11:14:33Z</updated>

		<summary type="html">&lt;p&gt;Derek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;OVERVIEW:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well.&amp;amp;nbsp; This script was written for linux, but might have some useful information for anyone trying to do this on other platforms.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;PREREQUISITES:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
First, you need to have [http://www.videolan.org/vlc/ VLC] (obviously), [http://www.python.org/ python] 2 OR 3, [http://hoopajoo.net/projects/xautomation.html xautomation] OR a version of [http://www.semicomplete.com/projects/xdotool/ xdotool] (newer than august 2010), and you need the openbsd implementation of [http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/ netcat]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. Unfortunately, the GNU implementation of netcat, which is the default in most distributions, does not seem to support UNIX&amp;amp;nbsp;sockets (the -U switch for nc.openbsd). If you run slackware and can&#039;t find it, check [http://www.slackbuilds.org slackbuilds].&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;SETUP:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
This setup is window manager agnostic. It shouldn&#039;t make much difference which environment you run it in, the only practical difference will be in how you set up your control keys. I won&#039;t go over how to set up window environment here, but I will try to give you a few pointers below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Next, you need to set up your control keys for your window environment. Remember to check to make sure that whichever control keys you wish to use are not already used by your window manager. Redefine these control keys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC but, personally, I like having these commands in the script. You may have better results with some experimentation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; I set my control keys up like this: &lt;br /&gt;
&lt;br /&gt;
F1 = ~/vlccontrol.py jogbackward &lt;br /&gt;
&lt;br /&gt;
F2 = ~/vlccontrol.py pause &lt;br /&gt;
&lt;br /&gt;
F3 = ~/vlccontrol.py pause (no need for two, just habit) &lt;br /&gt;
&lt;br /&gt;
F4 = ~/vlccontrol.py jogforward &lt;br /&gt;
&lt;br /&gt;
F5 = ~/vlccontrol.py timestamp &lt;br /&gt;
&lt;br /&gt;
Shift+F1 = ~/vlccontrol.py slower &lt;br /&gt;
&lt;br /&gt;
Shift+F3 = ~/vlccontrol.py normal &lt;br /&gt;
&lt;br /&gt;
Shift+F4 = ~/vlccontrol.py faster &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; If you use gnome+metacity, you can edit your keybindings in gconf-editor. Go to apps-&amp;amp;gt;metacity-&amp;amp;gt;global_keybindings and assign a command number to control key you want. Then go to app-&amp;amp;gt;metacity-&amp;amp;gt;keybinding_commands and assign the appropriate commands to the command numbers. So, for my keybindings, in &#039;global_keybindings&#039; you would set run_command_1 to F1. Then go to &#039;keybinding_commands&#039; and set command_1 to /home/YOURNAME/vlccontrol.py jogbackward. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; If you use kde4, open system settings, click on &#039;Shortcuts and Gestures&#039;, then choose &#039;Custom Shortcuts&#039;. In the second pane, under name, choose an appropriate group to put your new bindings (it might be a good idea to create a new group for these under &#039;Preset Actions&#039;, choose &#039;New Group&#039; from the &#039;Edit&#039; menu below the second pane.) Click on &#039;Edit&#039;, go to New-&amp;amp;gt;Global Shortcut-&amp;amp;gt;Command/URL, and name the action. While the new action is selected, click the &#039;Trigger&#039; tab in the right hand pane, click shortcut box and hit the key you wish to bind to the action (F1). Then go to action and enter in the command for that action (/home/YOURNAME/vlccontrol.py jogbackward.) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; In any window manager which utilizes an rc.xml file for it&#039;s keybindings, like OpenBox, edit the rc.xml in a text editor and go down to the &#039;keybindings&#039; section. Just follow along with the other keybind examples in the file, it&#039;s fairly straightfoward, but your first entry should look something like this, although you will need to put in appropriate symbols around the keywords: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;pre&amp;gt;    keybind key=&amp;quot;F1&amp;quot;&lt;br /&gt;
      action name=&amp;quot;execute&amp;quot;&lt;br /&gt;
        execute /home/delwin/vlccontrol.py jogbackward /execute&lt;br /&gt;
      /action&lt;br /&gt;
    /keybind&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VLCCONTROL.PY:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Finally, here is the vlccontrol.py script. Copy the script below and paste it into a file named &#039;vlccontrol.py&#039;. Save it to your home directory and make it executable with the command &#039;chmod 700 vlccontrol.py&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;pre&amp;gt;#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek at skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo of an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #don&#039;t change this. if you need an offset, take care of it below&lt;br /&gt;
    offset = 0&lt;br /&gt;
&lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    &lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it (not the beginning). Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec&amp;amp;nbsp;% 3600)/60&lt;br /&gt;
    ts = sec&amp;amp;nbsp;% 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot;&amp;amp;nbsp;% (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;OTHER THINGS YOU MIGHT CARE TO KNOW IF YOU&#039;VE MADE IT THIS FAR:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There are a couple of things in the script which you ought to know about if you do transcription regularly enough to care about these sorts of things. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Within the script, you&#039;ll find settings for &#039;tempo&#039; and &#039;offset&#039;. Most people aren&#039;t going to need to worry about either of these and can just leave them as they sit. However, if you do alot of transcription, it&#039;s likely you&#039;ll find these to be of some value. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The tempo setting does not refer to VLC&#039;s speed adjustment, rather it&#039;s is used if you have edited an audio file in an external editor, like audacity, and changed the tempo of the audio and created a new audio file based on that. The &#039;tempo&#039; variable is a percentage of the original audio, so at full speed, you&#039;ll want &#039;tempo = 100&#039;. If you slow it down 20%, you&#039;ll want &#039;tempo = 80&#039;, or &#039;tempo = 175&#039; if you&#039;ve sped it up 75%. By using this, you can get a timestamp for the spot in the full speed audio file, and won&#039;t need to go back through it later and correct your timestamps (it&#039;s always a good idea to do a couple of spot checks, just in case.) You DO NOT need to change this tempo variable if you are only adjusting the speed within VLC, it takes care of itself. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The &#039;offset&#039; section is useful if you are editing a video file which has an OSD timecode which you need to timestamp, rather than the playtime of the file. Again, this is not something you should need to mess with unless you have a specific use for it. If you do have a use for it, keep in mind that occasionally there will be edits that have been made to the video which will throw off your offest, so to speak. Unfortunately there&#039;s no real easy way to deal with this problem that I&#039;m aware of, you simply have to keep an eye on the difference and adjust it as needed. Again, spot checks are always a good idea. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; In order to set the script up to properly offset your video, pick a spot somewhere in the video which is not at the beginning, and then enter in the appropriate values. For instance, if we have a video file which at 01:23:45 play time on the file has an OSD timecode of 12:34:56, you&#039;ll enter the values like this: &lt;br /&gt;
&lt;br /&gt;
    offsetneeded = True&lt;br /&gt;
   vtch = 12 &amp;amp;lt;--hours on the video timecode&lt;br /&gt;
   vtcm = 34 &amp;amp;lt;--minutes on the video timecode&lt;br /&gt;
   vtcs = 56 &amp;amp;lt;--seconds on the video timecode&lt;br /&gt;
&lt;br /&gt;
        atch = 1  &amp;amp;lt;---don&#039;t use a leading 0, or the script will puke&lt;br /&gt;
   atcm = 23 &amp;amp;lt;--minutes on the playback time&lt;br /&gt;
   atcs = 45 &amp;amp;lt;--seconds on the playback time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; You can use offset with the tempo settings. Don&#039;t use the video timecode at 00:00:00 on the playback time, or the calculation will be off. Check the difference between the video timecode and the playback time at the beginning and end of your file to see if it&#039;s consistent, as that will tell you if there have been any edits made. If there are edits, just change the offset numbers when you get to those points. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Finally, variable bit rates are a pain for transcription. You&#039;ll get files which simply won&#039;t behave in a useful manner when you try and jog backward, et cetera. You can try converting those files to ogg format, and that generally solves the problem. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; If you have any questions about this, I can be reached at derek at skyehaven.net. &lt;br /&gt;
&lt;br /&gt;
[[Category:How_To]]&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo&amp;diff=17170</id>
		<title>VLC HowTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo&amp;diff=17170"/>
		<updated>2010-10-06T11:04:17Z</updated>

		<summary type="html">&lt;p&gt;Derek: /* Remote Control for VLC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Below are some handy guides for using {{VLC}}&lt;br /&gt;
&lt;br /&gt;
===Playing Video and Audio===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[What can vlc do#How to enable/use subtitles|Use Subtitles]]&lt;br /&gt;
*: Playing movies with subtitles&lt;br /&gt;
* [[How to Use a Capture Card|Use a Capture Card]]&lt;br /&gt;
*: This explains how to watch TV or get video from your capture card.&lt;br /&gt;
* [[What can vlc do#Play DVD/SVCD/VCD iso&#039;s / Images|Play DVDs and Disks from the image file]]&lt;br /&gt;
*: This explains how to use movies encoded onto an ISO file.&lt;br /&gt;
&lt;br /&gt;
===Adjusting Settings===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[What can vlc do#How to adjust picture brightness/colors/contrast..|Adjust Picture Brightness and Contrast]]&lt;br /&gt;
* [[What can vlc do#How to control the aspect ratio of the video|Edit the Aspect Ratio of a video]]&lt;br /&gt;
* [[Crop|Crop video]]&lt;br /&gt;
* [[How_to_disable_acceleration_in_Win32|Disable video acceleration in Win32]]&lt;br /&gt;
* [[How_to_save_bookmarks | Save bookmarks]]&lt;br /&gt;
* [[How_to_play_multiple_instances_of_VLC | How to play multiple instances]]&lt;br /&gt;
&lt;br /&gt;
===Remote Control for VLC===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[Control VLC via a browser]]&lt;br /&gt;
*: This explains how to use the HTTP [[interface]]&lt;br /&gt;
* [[Control VLC via a widget]] on the Mac desktop&lt;br /&gt;
* [[Control VLC from an iPhone]]&lt;br /&gt;
* [[Control VLC from an Android Phone]]&lt;br /&gt;
* [[Control VLC from a Palm Web OS Phone]]&lt;br /&gt;
* [[How to Use Creative Remote]]&lt;br /&gt;
*: Explains how to control {{VLC}} with Creative brand remote controls&lt;br /&gt;
&lt;br /&gt;
===Transcoding and Streaming===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[iPod Video Conversion Guide|Play videos on your iPod]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your iPod.&lt;br /&gt;
* [[Play_on_Yan Micro|Play videos on your Play-Yan Micro]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your Play-Yan Micro.&lt;br /&gt;
* [[Play_on_Xbox|Play videos on your XBox and XBox 360 ]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your XBox.&lt;br /&gt;
* [[Play_on_Zune| Play video on your Zune]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your Zune.&lt;br /&gt;
* [[Fixing .flv to .avi with Ffmpeg]]&lt;br /&gt;
*: This explains how to use ffmpeg to a convert broken .flv files to a perfectly good .avi file &#039;&#039;&#039;DEPRECATED&#039;&#039;&#039;&lt;br /&gt;
* [[Transcode_WM_to_Mov_or_MP4|Convert Windows Media audio/video files to MOV or .MP4]]&lt;br /&gt;
*: This explains how to convert Windows Media-encoded files to Quicktime or MPEG-4 files&lt;br /&gt;
* [[Streaming_to_ActiveX_for_Windows_Media_Player | Streaming from a webcam to an ActiveX embedded object page]]&lt;br /&gt;
* [[How_to_add_logo | Add a logo on your videos]]&lt;br /&gt;
* [[Mosaic| Create a Mosaic]]&lt;br /&gt;
*: This explains how to set up a mosaic from a few streams like a TV portal.&lt;br /&gt;
* [[How to DBox|Set up Video on Demand on a Dreambox]]&lt;br /&gt;
* [[How to Batch Encode]]&lt;br /&gt;
*: This explains how to set up a batch transcode with all files in a directory of a certain file extension being transcoded to a specified format.&lt;br /&gt;
* [[How to merge and transcode multiple videos]]&lt;br /&gt;
*: This explains how to take several source videos and merge then transcode resulting in a single file output.&lt;br /&gt;
&lt;br /&gt;
===Using VLC in other Applications===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[ActiveX]]&lt;br /&gt;
*: Specification for ActiveX control&lt;br /&gt;
* [[LibVLC|Use VLC&#039;s External API]]&lt;br /&gt;
*: Information for using libvlc&lt;br /&gt;
* [[Use in Media Center]]&lt;br /&gt;
* [[Useful Firefox Extensions]]&lt;br /&gt;
*: Information about extensions to view embedded videos in web pages using VLC&lt;br /&gt;
* [[GWT]]&lt;br /&gt;
*: Google WebToolkit&lt;br /&gt;
&lt;br /&gt;
===Other Stuff===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[How to Create a DVD|Create a DVD]]&lt;br /&gt;
*: This explains how to make a DVD from your home videos&lt;br /&gt;
* [[ActiveX/Delphi|Use the ActiveX control with Borland&#039;s Delphi]]&lt;br /&gt;
*: Using the VLC ActiveX plug-in in your programs&lt;br /&gt;
* [[ActiveX/HTML|Use the ActiveX control within a webpage.]]&lt;br /&gt;
* [[HowTo_Integrate_VLC_plugin_in_your_webpage|Integrate ActiveX/Mozilla on your webpage]]&lt;br /&gt;
* [[Change the brightness or contrast of a video|Change a video]]&lt;br /&gt;
*: This explains how to edit a video and save the changes&lt;br /&gt;
* [[How to create thumbnails]]&lt;br /&gt;
* [[How to Use Lirc]]&lt;br /&gt;
* [[How to shut down computer]] when VLC playback is over...&lt;br /&gt;
* [[How to make VLC the default player]]&lt;br /&gt;
* [[How to use VLC for transcription in linux]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* &#039;&#039;&#039;See also [[:Category:How To]]&#039;&#039;&#039;&lt;br /&gt;
[[Category:How To]]&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo&amp;diff=17169</id>
		<title>VLC HowTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo&amp;diff=17169"/>
		<updated>2010-10-06T11:03:25Z</updated>

		<summary type="html">&lt;p&gt;Derek: /* Remote Control for VLC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Below are some handy guides for using {{VLC}}&lt;br /&gt;
&lt;br /&gt;
===Playing Video and Audio===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[What can vlc do#How to enable/use subtitles|Use Subtitles]]&lt;br /&gt;
*: Playing movies with subtitles&lt;br /&gt;
* [[How to Use a Capture Card|Use a Capture Card]]&lt;br /&gt;
*: This explains how to watch TV or get video from your capture card.&lt;br /&gt;
* [[What can vlc do#Play DVD/SVCD/VCD iso&#039;s / Images|Play DVDs and Disks from the image file]]&lt;br /&gt;
*: This explains how to use movies encoded onto an ISO file.&lt;br /&gt;
&lt;br /&gt;
===Adjusting Settings===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[What can vlc do#How to adjust picture brightness/colors/contrast..|Adjust Picture Brightness and Contrast]]&lt;br /&gt;
* [[What can vlc do#How to control the aspect ratio of the video|Edit the Aspect Ratio of a video]]&lt;br /&gt;
* [[Crop|Crop video]]&lt;br /&gt;
* [[How_to_disable_acceleration_in_Win32|Disable video acceleration in Win32]]&lt;br /&gt;
* [[How_to_save_bookmarks | Save bookmarks]]&lt;br /&gt;
* [[How_to_play_multiple_instances_of_VLC | How to play multiple instances]]&lt;br /&gt;
&lt;br /&gt;
===Remote Control for VLC===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[Control VLC via a browser]]&lt;br /&gt;
*: This explains how to use the HTTP [[interface]]&lt;br /&gt;
* [[Control VLC via a widget]] on the Mac desktop&lt;br /&gt;
* [[Control VLC from an iPhone]]&lt;br /&gt;
* [[Control VLC from an Android Phone]]&lt;br /&gt;
* [[Control VLC from a Palm Web OS Phone]]&lt;br /&gt;
* [[How to Use Creative Remote]]&lt;br /&gt;
*: Explains how to control {{VLC}} with Creative brand remote controls&lt;br /&gt;
* [[How to use VLC for transcription in linux]]&lt;br /&gt;
*: Explains how to set up control keys without focusing on VLC plus timestamping&lt;br /&gt;
&lt;br /&gt;
===Transcoding and Streaming===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[iPod Video Conversion Guide|Play videos on your iPod]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your iPod.&lt;br /&gt;
* [[Play_on_Yan Micro|Play videos on your Play-Yan Micro]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your Play-Yan Micro.&lt;br /&gt;
* [[Play_on_Xbox|Play videos on your XBox and XBox 360 ]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your XBox.&lt;br /&gt;
* [[Play_on_Zune| Play video on your Zune]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your Zune.&lt;br /&gt;
* [[Fixing .flv to .avi with Ffmpeg]]&lt;br /&gt;
*: This explains how to use ffmpeg to a convert broken .flv files to a perfectly good .avi file &#039;&#039;&#039;DEPRECATED&#039;&#039;&#039;&lt;br /&gt;
* [[Transcode_WM_to_Mov_or_MP4|Convert Windows Media audio/video files to MOV or .MP4]]&lt;br /&gt;
*: This explains how to convert Windows Media-encoded files to Quicktime or MPEG-4 files&lt;br /&gt;
* [[Streaming_to_ActiveX_for_Windows_Media_Player | Streaming from a webcam to an ActiveX embedded object page]]&lt;br /&gt;
* [[How_to_add_logo | Add a logo on your videos]]&lt;br /&gt;
* [[Mosaic| Create a Mosaic]]&lt;br /&gt;
*: This explains how to set up a mosaic from a few streams like a TV portal.&lt;br /&gt;
* [[How to DBox|Set up Video on Demand on a Dreambox]]&lt;br /&gt;
* [[How to Batch Encode]]&lt;br /&gt;
*: This explains how to set up a batch transcode with all files in a directory of a certain file extension being transcoded to a specified format.&lt;br /&gt;
* [[How to merge and transcode multiple videos]]&lt;br /&gt;
*: This explains how to take several source videos and merge then transcode resulting in a single file output.&lt;br /&gt;
&lt;br /&gt;
===Using VLC in other Applications===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[ActiveX]]&lt;br /&gt;
*: Specification for ActiveX control&lt;br /&gt;
* [[LibVLC|Use VLC&#039;s External API]]&lt;br /&gt;
*: Information for using libvlc&lt;br /&gt;
* [[Use in Media Center]]&lt;br /&gt;
* [[Useful Firefox Extensions]]&lt;br /&gt;
*: Information about extensions to view embedded videos in web pages using VLC&lt;br /&gt;
* [[GWT]]&lt;br /&gt;
*: Google WebToolkit&lt;br /&gt;
&lt;br /&gt;
===Other Stuff===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[How to Create a DVD|Create a DVD]]&lt;br /&gt;
*: This explains how to make a DVD from your home videos&lt;br /&gt;
* [[ActiveX/Delphi|Use the ActiveX control with Borland&#039;s Delphi]]&lt;br /&gt;
*: Using the VLC ActiveX plug-in in your programs&lt;br /&gt;
* [[ActiveX/HTML|Use the ActiveX control within a webpage.]]&lt;br /&gt;
* [[HowTo_Integrate_VLC_plugin_in_your_webpage|Integrate ActiveX/Mozilla on your webpage]]&lt;br /&gt;
* [[Change the brightness or contrast of a video|Change a video]]&lt;br /&gt;
*: This explains how to edit a video and save the changes&lt;br /&gt;
* [[How to create thumbnails]]&lt;br /&gt;
* [[How to Use Lirc]]&lt;br /&gt;
* [[How to shut down computer]] when VLC playback is over...&lt;br /&gt;
* [[How to make VLC the default player]]&lt;br /&gt;
* [[How to use VLC for transcription in linux]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* &#039;&#039;&#039;See also [[:Category:How To]]&#039;&#039;&#039;&lt;br /&gt;
[[Category:How To]]&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Linux&amp;diff=17168</id>
		<title>Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Linux&amp;diff=17168"/>
		<updated>2010-10-06T10:59:22Z</updated>

		<summary type="html">&lt;p&gt;Derek: /* Other info */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Graphical User Interfaces under Linux ==&lt;br /&gt;
&lt;br /&gt;
* The [[Skins|Skinnable Interface]]&lt;br /&gt;
* The [[Qt4 Interface]]&lt;br /&gt;
* The [[WxWidgets Interface]], &#039;&#039;deprecated&#039;&#039;&lt;br /&gt;
* The [[Gnome Interface]], &#039;&#039;deprecated&#039;&#039;&lt;br /&gt;
* The [[Kde Interface]], &#039;&#039;deprecated&#039;&#039;&lt;br /&gt;
* Other [[interfaces]]&lt;br /&gt;
&lt;br /&gt;
== Other info ==&lt;br /&gt;
* [[Linux keyboard shortcuts]]&lt;br /&gt;
* [[Linux VLC FAQ]]&lt;br /&gt;
* [[Alsa | Using ALSA]]&lt;br /&gt;
* [[How to use VLC for transcription in linux]]&lt;br /&gt;
&lt;br /&gt;
==Command line==&lt;br /&gt;
&lt;br /&gt;
* [[ZSH Autocompletion]] &lt;br /&gt;
&lt;br /&gt;
==Distribution-specific stuff==&lt;br /&gt;
&lt;br /&gt;
* [[GNU/Linux Debian]]&lt;br /&gt;
* [[Ubuntu|GNU/Linux Ubuntu]] and Ubuntu-based (Kubuntu, Edubuntu, Xubuntu, ...)&lt;br /&gt;
* [[RedHat|GNU/Linux RedHat]]&lt;br /&gt;
* [[Mandriva|GNU/Linux Mandriva (formerly Mandrake)]]&lt;br /&gt;
* [[Gentoo|GNU/Linux Gentoo]]&lt;br /&gt;
* [[SuSE|GNU/Linux SuSE]]&lt;br /&gt;
* [[Slackware|GNU/Linux Slackware]]&lt;br /&gt;
* Other [[distros |GNU/Linux distros]]&lt;br /&gt;
&lt;br /&gt;
==General Linux Advice==&lt;br /&gt;
* [http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-8.html Getting out of freezes]&lt;br /&gt;
&lt;br /&gt;
[[Category:Operating systems]]&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17167</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17167"/>
		<updated>2010-10-06T10:52:47Z</updated>

		<summary type="html">&lt;p&gt;Derek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;OVERVIEW:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well.&amp;amp;nbsp; This script was written for linux, but might have some useful information for anyone trying to do this on other platforms.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;PREREQUISITES:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
First, you need to have [http://www.videolan.org/vlc/ VLC] (obviously), [http://www.python.org/ python] 2 OR 3, [http://hoopajoo.net/projects/xautomation.html xautomation] OR a version of [http://www.semicomplete.com/projects/xdotool/ xdotool] (newer than august 2010), and you need the openbsd implementation of [http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/ netcat]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. Unfortunately, the GNU implementation of netcat, which is the default in most distributions, does not seem to support UNIX&amp;amp;nbsp;sockets (the -U switch for nc.openbsd).&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;SETUP:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
This setup is window manager agnostic. It shouldn&#039;t make much difference which environment you run it in, the only practical difference will be in how you set up your control keys. I won&#039;t go over how to set up window environment here, but I will try to give you a few pointers below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Next, you need to set up your control keys for your window environment. Remember to check to make sure that whichever control keys you wish to use are not already used by your window manager. Redefine these control keys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC but, personally, I like having these commands in the script. You may have better results with some experimentation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; I set my control keys up like this: &lt;br /&gt;
&lt;br /&gt;
F1 = ~/vlccontrol.py jogbackward &lt;br /&gt;
&lt;br /&gt;
F2 = ~/vlccontrol.py pause &lt;br /&gt;
&lt;br /&gt;
F3 = ~/vlccontrol.py pause (no need for two, just habit) &lt;br /&gt;
&lt;br /&gt;
F4 = ~/vlccontrol.py jogforward &lt;br /&gt;
&lt;br /&gt;
F5 = ~/vlccontrol.py timestamp &lt;br /&gt;
&lt;br /&gt;
Shift+F1 = ~/vlccontrol.py slower &lt;br /&gt;
&lt;br /&gt;
Shift+F3 = ~/vlccontrol.py normal &lt;br /&gt;
&lt;br /&gt;
Shift+F4 = ~/vlccontrol.py faster &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; If you use gnome+metacity, you can edit your keybindings in gconf-editor. Go to apps-&amp;amp;gt;metacity-&amp;amp;gt;global_keybindings and assign a command number to control key you want. Then go to app-&amp;amp;gt;metacity-&amp;amp;gt;keybinding_commands and assign the appropriate commands to the command numbers. So, for my keybindings, in &#039;global_keybindings&#039; you would set run_command_1 to F1. Then go to &#039;keybinding_commands&#039; and set command_1 to /home/YOURNAME/vlccontrol.py jogbackward. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; If you use kde4, open system settings, click on &#039;Shortcuts and Gestures&#039;, then choose &#039;Custom Shortcuts&#039;. In the second pane, under name, choose an appropriate group to put your new bindings (it might be a good idea to create a new group for these under &#039;Preset Actions&#039;, choose &#039;New Group&#039; from the &#039;Edit&#039; menu below the second pane.) Click on &#039;Edit&#039;, go to New-&amp;amp;gt;Global Shortcut-&amp;amp;gt;Command/URL, and name the action. While the new action is selected, click the &#039;Trigger&#039; tab in the right hand pane, click shortcut box and hit the key you wish to bind to the action (F1). Then go to action and enter in the command for that action (/home/YOURNAME/vlccontrol.py jogbackward.) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; In any window manager which utilizes an rc.xml file for it&#039;s keybindings, like OpenBox, edit the rc.xml in a text editor and go down to the &#039;keybindings&#039; section. Just follow along with the other keybind examples in the file, it&#039;s fairly straightfoward, but your first entry should look something like this, although you will need to put in appropriate symbols around the keywords: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;pre&amp;gt;    keybind key=&amp;quot;F1&amp;quot;&lt;br /&gt;
      action name=&amp;quot;execute&amp;quot;&lt;br /&gt;
        execute /home/delwin/vlccontrol.py jogbackward /execute&lt;br /&gt;
      /action&lt;br /&gt;
    /keybind&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VLCCONTROL.PY:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Finally, here is the vlccontrol.py script. Copy the script below and paste it into a file named &#039;vlccontrol.py&#039;. Save it to your home directory and make it executable with the command &#039;chmod 700 vlccontrol.py&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;pre&amp;gt;#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek at skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo of an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #don&#039;t change this. if you need an offset, take care of it below&lt;br /&gt;
    offset = 0&lt;br /&gt;
&lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    &lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it (not the beginning). Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec&amp;amp;nbsp;% 3600)/60&lt;br /&gt;
    ts = sec&amp;amp;nbsp;% 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot;&amp;amp;nbsp;% (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;OTHER THINGS YOU MIGHT CARE TO KNOW IF YOU&#039;VE MADE IT THIS FAR:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There are a couple of things in the script which you ought to know about if you do transcription regularly enough to care about these sorts of things. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Within the script, you&#039;ll find settings for &#039;tempo&#039; and &#039;offset&#039;. Most people aren&#039;t going to need to worry about either of these and can just leave them as they sit. However, if you do alot of transcription, it&#039;s likely you&#039;ll find these to be of some value. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The tempo setting does not refer to VLC&#039;s speed adjustment, rather it&#039;s is used if you have edited an audio file in an external editor, like audacity, and changed the tempo of the audio and created a new audio file based on that. The &#039;tempo&#039; variable is a percentage of the original audio, so at full speed, you&#039;ll want &#039;tempo = 100&#039;. If you slow it down 20%, you&#039;ll want &#039;tempo = 80&#039;, or &#039;tempo = 175&#039; if you&#039;ve sped it up 75%. By using this, you can get a timestamp for the spot in the full speed audio file, and won&#039;t need to go back through it later and correct your timestamps (it&#039;s always a good idea to do a couple of spot checks, just in case.) You DO NOT need to change this tempo variable if you are only adjusting the speed within VLC, it takes care of itself. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The &#039;offset&#039; section is useful if you are editing a video file which has an OSD timecode which you need to timestamp, rather than the playtime of the file. Again, this is not something you should need to mess with unless you have a specific use for it. If you do have a use for it, keep in mind that occasionally there will be edits that have been made to the video which will throw off your offest, so to speak. Unfortunately there&#039;s no real easy way to deal with this problem that I&#039;m aware of, you simply have to keep an eye on the difference and adjust it as needed. Again, spot checks are always a good idea. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; In order to set the script up to properly offset your video, pick a spot somewhere in the video which is not at the beginning, and then enter in the appropriate values. For instance, if we have a video file which at 01:23:45 play time on the file has an OSD timecode of 12:34:56, you&#039;ll enter the values like this: &lt;br /&gt;
&lt;br /&gt;
    offsetneeded = True&lt;br /&gt;
     vtch = 12 &amp;amp;lt;--hours on the video timecode&lt;br /&gt;
     vtcm = 34 &amp;amp;lt;--minutes on the video timecode&lt;br /&gt;
     vtcs = 56 &amp;amp;lt;--seconds on the video timecode&lt;br /&gt;
&lt;br /&gt;
        atch = 1  &amp;amp;lt;---don&#039;t use a leading 0, or the script will puke&lt;br /&gt;
     atcm = 23 &amp;amp;lt;--minutes on the playback time&lt;br /&gt;
     atcs = 45 &amp;amp;lt;--seconds on the playback time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; You can use offset with the tempo settings. Don&#039;t use the video timecode at 00:00:00 on the playback time, or the calculation will be off. Check the difference between the video timecode and the playback time at the beginning and end of your file to see if it&#039;s consistent, as that will tell you if there have been any edits made. If there are edits, just change the offset numbers when you get to those points. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Finally, variable bit rates are a pain for transcription. You&#039;ll get files which simply won&#039;t behave in a useful manner when you try and jog backward, et cetera. You can try converting those files to ogg format, and that generally solves the problem. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; If you have any questions about this, I can be reached at derek at skyehaven.net. &lt;br /&gt;
&lt;br /&gt;
[[Category:How_To]]&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17166</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17166"/>
		<updated>2010-10-06T10:51:19Z</updated>

		<summary type="html">&lt;p&gt;Derek: links added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;OVERVIEW:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well.&amp;amp;nbsp; This script was written for linux, but might have some useful information for anyone trying to do this on other platforms.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;PREREQUISITES:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
First, you need to have [http://www.videolan.org/vlc/ VLC] (obviously), [http://www.python.org/ python] 2 OR 3, [http://hoopajoo.net/projects/xautomation.html xautomation] OR a version of [http://www.semicomplete.com/projects/xdotool/ xdotool] (newer than august 2010), and you need the openbsd implementation of [http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/ netcat]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. Unfortunately, the GNU implementation of netcat, which is the default in most distributions, does not seem to support UNIX&amp;amp;nbsp;sockets (the -U switch for nc.openbsd).&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;SETUP:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
This setup is window manager agnostic. It shouldn&#039;t make much difference which environment you run it in, the only practical difference will be in how you set up your control keys. I won&#039;t go over how to set up window environment here, but I will try to give you a few pointers below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Next, you need to set up your control keys for your window environment. Remember to check to make sure that whichever control keys you wish to use are not already used by your window manager. Redefine these control keys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC but, personally, I like having these commands in the script. You may have better results with some experimentation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; I set my control keys up like this: &lt;br /&gt;
&lt;br /&gt;
F1 = ~/vlccontrol.py jogbackward &lt;br /&gt;
&lt;br /&gt;
F2 = ~/vlccontrol.py pause &lt;br /&gt;
&lt;br /&gt;
F3 = ~/vlccontrol.py pause (no need for two, just habit) &lt;br /&gt;
&lt;br /&gt;
F4 = ~/vlccontrol.py jogforward &lt;br /&gt;
&lt;br /&gt;
F5 = ~/vlccontrol.py timestamp &lt;br /&gt;
&lt;br /&gt;
Shift+F1 = ~/vlccontrol.py slower &lt;br /&gt;
&lt;br /&gt;
Shift+F3 = ~/vlccontrol.py normal &lt;br /&gt;
&lt;br /&gt;
Shift+F4 = ~/vlccontrol.py faster &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; If you use gnome+metacity, you can edit your keybindings in gconf-editor. Go to apps-&amp;amp;gt;metacity-&amp;amp;gt;global_keybindings and assign a command number to control key you want. Then go to app-&amp;amp;gt;metacity-&amp;amp;gt;keybinding_commands and assign the appropriate commands to the command numbers. So, for my keybindings, in &#039;global_keybindings&#039; you would set run_command_1 to F1. Then go to &#039;keybinding_commands&#039; and set command_1 to /home/YOURNAME/vlccontrol.py jogbackward. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; If you use kde4, open system settings, click on &#039;Shortcuts and Gestures&#039;, then choose &#039;Custom Shortcuts&#039;. In the second pane, under name, choose an appropriate group to put your new bindings (it might be a good idea to create a new group for these under &#039;Preset Actions&#039;, choose &#039;New Group&#039; from the &#039;Edit&#039; menu below the second pane.) Click on &#039;Edit&#039;, go to New-&amp;amp;gt;Global Shortcut-&amp;amp;gt;Command/URL, and name the action. While the new action is selected, click the &#039;Trigger&#039; tab in the right hand pane, click shortcut box and hit the key you wish to bind to the action (F1). Then go to action and enter in the command for that action (/home/YOURNAME/vlccontrol.py jogbackward.) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; In any window manager which utilizes an rc.xml file for it&#039;s keybindings, like OpenBox, edit the rc.xml in a text editor and go down to the &#039;keybindings&#039; section. Just follow along with the other keybind examples in the file, it&#039;s fairly straightfoward, but your first entry should look something like this, although you will need to put in appropriate symbols around the keywords: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;pre&amp;gt;    keybind key=&amp;quot;F1&amp;quot;&lt;br /&gt;
      action name=&amp;quot;execute&amp;quot;&lt;br /&gt;
        execute /home/delwin/vlccontrol.py jogbackward /execute&lt;br /&gt;
      /action&lt;br /&gt;
    /keybind&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VLCCONTROL.PY:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Finally, here is the vlccontrol.py script. Copy the script below and paste it into a file named &#039;vlccontrol.py&#039;. Save it to your home directory and make it executable with the command &#039;chmod 700 vlccontrol.py&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;pre&amp;gt;#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek at skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #don&#039;t change this. if you need an offset, take care of it below&lt;br /&gt;
    offset = 0&lt;br /&gt;
&lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    &lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it (not the beginning). Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec&amp;amp;nbsp;% 3600)/60&lt;br /&gt;
    ts = sec&amp;amp;nbsp;% 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot;&amp;amp;nbsp;% (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt; &#039;&#039;&#039;OTHER THINGS YOU MIGHT CARE TO KNOW IF YOU&#039;VE MADE IT THIS FAR:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
There are a couple of things in the script which you ought to know about if you do transcription regularly enough to care about these sorts of things. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Within the script, you&#039;ll find settings for &#039;tempo&#039; and &#039;offset&#039;. Most people aren&#039;t going to need to worry about either of these and can just leave them as they sit. However, if you do alot of transcription, it&#039;s likely you&#039;ll find these to be of some value. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The tempo setting does not refer to VLC&#039;s speed adjustment, rather it&#039;s is used if you have edited an audio file in an external editor, like audacity, and changed the tempo of the audio and created a new audio file based on that. The &#039;tempo&#039; variable is a percentage of the original audio, so at full speed, you&#039;ll want &#039;tempo = 100&#039;. If you slow it down 20%, you&#039;ll want &#039;tempo = 80&#039;, or &#039;tempo = 175&#039; if you&#039;ve sped it up 75%. By using this, you can get a timestamp for the spot in the full speed audio file, and won&#039;t need to go back through it later and correct your timestamps (it&#039;s always a good idea to do a couple of spot checks, just in case.) You DO NOT need to change this tempo variable if you are only adjusting the speed within VLC, it takes care of itself. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; The &#039;offset&#039; section is useful if you are editing a video file which has an OSD timecode which you need to timestamp, rather than the playtime of the file. Again, this is not something you should need to mess with unless you have a specific use for it. If you do have a use for it, keep in mind that occasionally there will be edits that have been made to the video which will throw off your offest, so to speak. Unfortunately there&#039;s no real easy way to deal with this problem that I&#039;m aware of, you simply have to keep an eye on the difference and adjust it as needed. Again, spot checks are always a good idea. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; In order to set the script up to properly offset your video, pick a spot somewhere in the video which is not at the beginning, and then enter in the appropriate values. For instance, if we have a video file which at 01:23:45 play time on the file has an OSD timecode of 12:34:56, you&#039;ll enter the values like this: &lt;br /&gt;
&lt;br /&gt;
    offsetneeded = True&lt;br /&gt;
      vtch = 12 &amp;amp;lt;--hours on the video timecode&lt;br /&gt;
      vtcm = 34 &amp;amp;lt;--minutes on the video timecode&lt;br /&gt;
      vtcs = 56 &amp;amp;lt;--seconds on the video timecode&lt;br /&gt;
&lt;br /&gt;
        atch = 1  &amp;amp;lt;---don&#039;t use a leading 0, or the script will puke&lt;br /&gt;
      atcm = 23 &amp;amp;lt;--minutes on the playback time&lt;br /&gt;
      atcs = 45 &amp;amp;lt;--seconds on the playback time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; You can use offset with the tempo settings. Don&#039;t use the video timecode at 00:00:00 on the playback time, or the calculation will be off. Check the difference between the video timecode and the playback time at the beginning and end of your file to see if it&#039;s consistent, as that will tell you if there have been any edits made. If there are edits, just change the offset numbers when you get to those points. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; Finally, variable bit rates are a pain for transcription. You&#039;ll get files which simply won&#039;t behave in a useful manner when you try and jog backward, et cetera. You can try converting those files to ogg format, and that generally solves the problem. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; If you have any questions about this, I can be reached at derek at skyehaven.net. &lt;br /&gt;
&lt;br /&gt;
[[Category:How_To]]&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17165</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17165"/>
		<updated>2010-10-06T10:23:43Z</updated>

		<summary type="html">&lt;p&gt;Derek: added category tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;OVERVIEW:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PREREQUISITES:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), python 2 OR 3, xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SETUP:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
This setup is window manager agnostic. It shouldn&#039;t make much difference which environment you run it in, the only practical difference will be in how you set up your control keys. I won&#039;t go over how to set up window environment here, but I will try to give you a few pointers below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your control keys for your window environment. Remember to check to make sure that whichever control keys you wish to use are not already used by your window manager. Redefine these control keys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC but, personally, I like having these commands in the script. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I set my control keys up like this:&lt;br /&gt;
&lt;br /&gt;
F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
&lt;br /&gt;
F2 = ~/vlccontrol.py pause&lt;br /&gt;
&lt;br /&gt;
F3 = ~/vlccontrol.py pause (no need for two, just habit)&lt;br /&gt;
&lt;br /&gt;
F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
&lt;br /&gt;
F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
&lt;br /&gt;
Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
&lt;br /&gt;
Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
&lt;br /&gt;
Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use gnome+metacity, you can edit your keybindings in gconf-editor. Go to apps-&amp;gt;metacity-&amp;gt;global_keybindings and assign a command number to control key you want. Then go to app-&amp;gt;metacity-&amp;gt;keybinding_commands and assign the appropriate commands to the command numbers. So, for my keybindings, in &#039;global_keybindings&#039; you would set run_command_1 to F1. Then go to &#039;keybinding_commands&#039;  and set command_1 to /home/YOURNAME/vlccontrol.py jogbackward.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use kde4, open system settings, click on &#039;Shortcuts and Gestures&#039;, then choose &#039;Custom Shortcuts&#039;. In the second pane, under name, choose an appropriate group to put your new bindings (it might be a good idea to create a new group for these under &#039;Preset Actions&#039;, choose &#039;New Group&#039; from the &#039;Edit&#039; menu below the second pane.) Click on &#039;Edit&#039;, go to New-&amp;gt;Global Shortcut-&amp;gt;Command/URL, and name the action. While the new action is selected, click the &#039;Trigger&#039; tab in the right hand pane, click shortcut box and hit the key you wish to bind to the action (F1). Then go to action and enter in the command for that action (/home/YOURNAME/vlccontrol.py jogbackward.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In any window manager which utilizes an rc.xml file for it&#039;s keybindings, like OpenBox, edit the rc.xml in a text editor and go down to the &#039;keybindings&#039; section. Just follow along with the other keybind examples in the file, it&#039;s fairly straightfoward, but your first entry should look something like this, although you will need to put in appropriate symbols around the keywords:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
    keybind key=&amp;quot;F1&amp;quot;&lt;br /&gt;
      action name=&amp;quot;execute&amp;quot;&lt;br /&gt;
        execute /home/delwin/vlccontrol.py jogbackward /execute&lt;br /&gt;
      /action&lt;br /&gt;
    /keybind&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VLCCONTROL.PY:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, here is the vlccontrol.py script. Copy the script below and paste it into a file named &#039;vlccontrol.py&#039;. Save it to your home directory and make it executable with the command &#039;chmod 700 vlccontrol.py&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek at skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #don&#039;t change this. if you need an offset, take care of it below&lt;br /&gt;
    offset = 0&lt;br /&gt;
&lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    &lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it (not the beginning). Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OTHER THINGS YOU MIGHT CARE TO KNOW IF YOU&#039;VE MADE IT THIS FAR:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There are a couple of things in the script which you ought to know about if you do transcription regularly enough to care about these sorts of things. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the script, you&#039;ll find settings for &#039;tempo&#039; and &#039;offset&#039;.  Most people aren&#039;t going to need to worry about either of these and can just leave them as they sit. However, if you do alot of transcription, it&#039;s likely you&#039;ll find these to be of some value. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The tempo setting does not refer to VLC&#039;s speed adjustment, rather it&#039;s is used if you have edited an audio file in an external editor, like audacity, and changed the tempo of the audio and created a new audio file based on that.  The &#039;tempo&#039; variable is a percentage of the original audio, so at full speed, you&#039;ll want &#039;tempo = 100&#039;. If you slow it down 20%, you&#039;ll want &#039;tempo = 80&#039;, or &#039;tempo = 175&#039; if you&#039;ve sped it up 75%. By using this, you can get a timestamp for the spot in the full speed audio file, and won&#039;t need to go back through it later and correct your timestamps (it&#039;s always a good idea to do a couple of spot checks, just in case.) You DO NOT need to change this tempo variable if you are only adjusting the speed within VLC, it takes care of itself. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;offset&#039; section is useful if you are editing a video file which has an OSD timecode which you need to timestamp, rather than the playtime of the file. Again, this is not something you should need to mess with unless you have a specific use for it. If you do have a use for it, keep in mind that occasionally there will be edits that have been made to the video which will throw off your offest, so to speak. Unfortunately there&#039;s no real easy way to deal with this problem that I&#039;m aware of, you simply have to keep an eye on the difference and adjust it as needed. Again, spot checks are always a good idea.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to set the script up to properly offset your video, pick a spot somewhere in the video which is not at the beginning, and then enter in the appropriate values. For instance, if we have a video file which at 01:23:45 play time on the file has an OSD timecode of 12:34:56, you&#039;ll enter the values like this:&lt;br /&gt;
&lt;br /&gt;
    offsetneeded = True&lt;br /&gt;
        vtch = 12 &amp;lt;--hours on the video timecode&lt;br /&gt;
        vtcm = 34 &amp;lt;--minutes on the video timecode&lt;br /&gt;
        vtcs = 56 &amp;lt;--seconds on the video timecode&lt;br /&gt;
&lt;br /&gt;
        atch = 1  &amp;lt;---don&#039;t use a leading 0, or the script will puke&lt;br /&gt;
        atcm = 23 &amp;lt;--minutes on the playback time&lt;br /&gt;
        atcs = 45 &amp;lt;--seconds on the playback time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can use offset with the tempo settings. Don&#039;t use the video timecode at 00:00:00 on the playback time, or the calculation will be off. Check the difference between the video timecode and the playback time at the beginning and end of your file to see if it&#039;s consistent, as that will tell you if there have been any edits made. If there are edits, just change the offset numbers when you get to those points. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, variable bit rates are a pain for transcription.  You&#039;ll get files which simply won&#039;t behave in a useful manner when you try and jog backward, et cetera.  You can try converting those files to ogg format, and that generally solves the problem. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have any questions about this, I can be reached at derek at skyehaven.net.&lt;br /&gt;
&lt;br /&gt;
[[Category:How_To]]&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17164</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17164"/>
		<updated>2010-10-06T09:38:54Z</updated>

		<summary type="html">&lt;p&gt;Derek: added mention of python in prerequisites&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;OVERVIEW:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PREREQUISITES:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), python 2 OR 3, xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SETUP:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
This setup is window manager agnostic. It shouldn&#039;t make much difference which environment you run it in, the only practical difference will be in how you set up your control keys. I won&#039;t go over how to set up window environment here, but I will try to give you a few pointers below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your control keys for your window environment. Remember to check to make sure that whichever control keys you wish to use are not already used by your window manager. Redefine these control keys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC but, personally, I like having these commands in the script. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I set my control keys up like this:&lt;br /&gt;
&lt;br /&gt;
F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
&lt;br /&gt;
F2 = ~/vlccontrol.py pause&lt;br /&gt;
&lt;br /&gt;
F3 = ~/vlccontrol.py pause (no need for two, just habit)&lt;br /&gt;
&lt;br /&gt;
F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
&lt;br /&gt;
F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
&lt;br /&gt;
Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
&lt;br /&gt;
Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
&lt;br /&gt;
Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use gnome+metacity, you can edit your keybindings in gconf-editor. Go to apps-&amp;gt;metacity-&amp;gt;global_keybindings and assign a command number to control key you want. Then go to app-&amp;gt;metacity-&amp;gt;keybinding_commands and assign the appropriate commands to the command numbers. So, for my keybindings, in &#039;global_keybindings&#039; you would set run_command_1 to F1. Then go to &#039;keybinding_commands&#039;  and set command_1 to /home/YOURNAME/vlccontrol.py jogbackward.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use kde4, open system settings, click on &#039;Shortcuts and Gestures&#039;, then choose &#039;Custom Shortcuts&#039;. In the second pane, under name, choose an appropriate group to put your new bindings (it might be a good idea to create a new group for these under &#039;Preset Actions&#039;, choose &#039;New Group&#039; from the &#039;Edit&#039; menu below the second pane.) Click on &#039;Edit&#039;, go to New-&amp;gt;Global Shortcut-&amp;gt;Command/URL, and name the action. While the new action is selected, click the &#039;Trigger&#039; tab in the right hand pane, click shortcut box and hit the key you wish to bind to the action (F1). Then go to action and enter in the command for that action (/home/YOURNAME/vlccontrol.py jogbackward.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In any window manager which utilizes an rc.xml file for it&#039;s keybindings, like OpenBox, edit the rc.xml in a text editor and go down to the &#039;keybindings&#039; section. Just follow along with the other keybind examples in the file, it&#039;s fairly straightfoward, but your first entry should look something like this, although you will need to put in appropriate symbols around the keywords:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
    keybind key=&amp;quot;F1&amp;quot;&lt;br /&gt;
      action name=&amp;quot;execute&amp;quot;&lt;br /&gt;
        execute /home/delwin/vlccontrol.py jogbackward /execute&lt;br /&gt;
      /action&lt;br /&gt;
    /keybind&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VLCCONTROL.PY:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, here is the vlccontrol.py script. Copy the script below and paste it into a file named &#039;vlccontrol.py&#039;. Save it to your home directory and make it executable with the command &#039;chmod 700 vlccontrol.py&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek at skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #don&#039;t change this. if you need an offset, take care of it below&lt;br /&gt;
    offset = 0&lt;br /&gt;
&lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    &lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it (not the beginning). Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OTHER THINGS YOU MIGHT CARE TO KNOW IF YOU&#039;VE MADE IT THIS FAR:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There are a couple of things in the script which you ought to know about if you do transcription regularly enough to care about these sorts of things. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the script, you&#039;ll find settings for &#039;tempo&#039; and &#039;offset&#039;.  Most people aren&#039;t going to need to worry about either of these and can just leave them as they sit. However, if you do alot of transcription, it&#039;s likely you&#039;ll find these to be of some value. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The tempo setting does not refer to VLC&#039;s speed adjustment, rather it&#039;s is used if you have edited an audio file in an external editor, like audacity, and changed the tempo of the audio and created a new audio file based on that.  The &#039;tempo&#039; variable is a percentage of the original audio, so at full speed, you&#039;ll want &#039;tempo = 100&#039;. If you slow it down 20%, you&#039;ll want &#039;tempo = 80&#039;, or &#039;tempo = 175&#039; if you&#039;ve sped it up 75%. By using this, you can get a timestamp for the spot in the full speed audio file, and won&#039;t need to go back through it later and correct your timestamps (it&#039;s always a good idea to do a couple of spot checks, just in case.) You DO NOT need to change this tempo variable if you are only adjusting the speed within VLC, it takes care of itself. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;offset&#039; section is useful if you are editing a video file which has an OSD timecode which you need to timestamp, rather than the playtime of the file. Again, this is not something you should need to mess with unless you have a specific use for it. If you do have a use for it, keep in mind that occasionally there will be edits that have been made to the video which will throw off your offest, so to speak. Unfortunately there&#039;s no real easy way to deal with this problem that I&#039;m aware of, you simply have to keep an eye on the difference and adjust it as needed. Again, spot checks are always a good idea.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to set the script up to properly offset your video, pick a spot somewhere in the video which is not at the beginning, and then enter in the appropriate values. For instance, if we have a video file which at 01:23:45 play time on the file has an OSD timecode of 12:34:56, you&#039;ll enter the values like this:&lt;br /&gt;
&lt;br /&gt;
    offsetneeded = True&lt;br /&gt;
        vtch = 12 &amp;lt;--hours on the video timecode&lt;br /&gt;
        vtcm = 34 &amp;lt;--minutes on the video timecode&lt;br /&gt;
        vtcs = 56 &amp;lt;--seconds on the video timecode&lt;br /&gt;
&lt;br /&gt;
        atch = 1  &amp;lt;---don&#039;t use a leading 0, or the script will puke&lt;br /&gt;
        atcm = 23 &amp;lt;--minutes on the playback time&lt;br /&gt;
        atcs = 45 &amp;lt;--seconds on the playback time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can use offset with the tempo settings. Don&#039;t use the video timecode at 00:00:00 on the playback time, or the calculation will be off. Check the difference between the video timecode and the playback time at the beginning and end of your file to see if it&#039;s consistent, as that will tell you if there have been any edits made. If there are edits, just change the offset numbers when you get to those points. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, variable bit rates are a pain for transcription.  You&#039;ll get files which simply won&#039;t behave in a useful manner when you try and jog backward, et cetera.  You can try converting those files to ogg format, and that generally solves the problem. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have any questions about this, I can be reached at derek at skyehaven.net.&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17163</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17163"/>
		<updated>2010-10-06T09:15:31Z</updated>

		<summary type="html">&lt;p&gt;Derek: minor formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;OVERVIEW:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PREREQUISITES:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SETUP:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
This setup is window manager agnostic. It shouldn&#039;t make much difference which environment you run it in, the only practical difference will be in how you set up your control keys. I won&#039;t go over how to set up window environment here, but I will try to give you a few pointers below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your control keys for your window environment. Remember to check to make sure that whichever control keys you wish to use are not already used by your window manager. Redefine these control keys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC but, personally, I like having these commands in the script. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I set my control keys up like this:&lt;br /&gt;
&lt;br /&gt;
F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
&lt;br /&gt;
F2 = ~/vlccontrol.py pause&lt;br /&gt;
&lt;br /&gt;
F3 = ~/vlccontrol.py pause (no need for two, just habit)&lt;br /&gt;
&lt;br /&gt;
F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
&lt;br /&gt;
F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
&lt;br /&gt;
Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
&lt;br /&gt;
Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
&lt;br /&gt;
Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use gnome+metacity, you can edit your keybindings in gconf-editor. Go to apps-&amp;gt;metacity-&amp;gt;global_keybindings and assign a command number to control key you want. Then go to app-&amp;gt;metacity-&amp;gt;keybinding_commands and assign the appropriate commands to the command numbers. So, for my keybindings, in &#039;global_keybindings&#039; you would set run_command_1 to F1. Then go to &#039;keybinding_commands&#039;  and set command_1 to /home/YOURNAME/vlccontrol.py jogbackward.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use kde4, open system settings, click on &#039;Shortcuts and Gestures&#039;, then choose &#039;Custom Shortcuts&#039;. In the second pane, under name, choose an appropriate group to put your new bindings (it might be a good idea to create a new group for these under &#039;Preset Actions&#039;, choose &#039;New Group&#039; from the &#039;Edit&#039; menu below the second pane.) Click on &#039;Edit&#039;, go to New-&amp;gt;Global Shortcut-&amp;gt;Command/URL, and name the action. While the new action is selected, click the &#039;Trigger&#039; tab in the right hand pane, click shortcut box and hit the key you wish to bind to the action (F1). Then go to action and enter in the command for that action (/home/YOURNAME/vlccontrol.py jogbackward.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In any window manager which utilizes an rc.xml file for it&#039;s keybindings, like OpenBox, edit the rc.xml in a text editor and go down to the &#039;keybindings&#039; section. Just follow along with the other keybind examples in the file, it&#039;s fairly straightfoward, but your first entry should look something like this, although you will need to put in appropriate symbols around the keywords:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
    keybind key=&amp;quot;F1&amp;quot;&lt;br /&gt;
      action name=&amp;quot;execute&amp;quot;&lt;br /&gt;
        execute /home/delwin/vlccontrol.py jogbackward /execute&lt;br /&gt;
      /action&lt;br /&gt;
    /keybind&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VLCCONTROL.PY:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, here is the vlccontrol.py script. Copy the script below and paste it into a file named &#039;vlccontrol.py&#039;. Save it to your home directory and make it executable with the command &#039;chmod 700 vlccontrol.py&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek at skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #don&#039;t change this. if you need an offset, take care of it below&lt;br /&gt;
    offset = 0&lt;br /&gt;
&lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    &lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it (not the beginning). Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OTHER THINGS YOU MIGHT CARE TO KNOW IF YOU&#039;VE MADE IT THIS FAR:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There are a couple of things in the script which you ought to know about if you do transcription regularly enough to care about these sorts of things. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Within the script, you&#039;ll find settings for &#039;tempo&#039; and &#039;offset&#039;.  Most people aren&#039;t going to need to worry about either of these and can just leave them as they sit. However, if you do alot of transcription, it&#039;s likely you&#039;ll find these to be of some value. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The tempo setting does not refer to VLC&#039;s speed adjustment, rather it&#039;s is used if you have edited an audio file in an external editor, like audacity, and changed the tempo of the audio and created a new audio file based on that.  The &#039;tempo&#039; variable is a percentage of the original audio, so at full speed, you&#039;ll want &#039;tempo = 100&#039;. If you slow it down 20%, you&#039;ll want &#039;tempo = 80&#039;, or &#039;tempo = 175&#039; if you&#039;ve sped it up 75%. By using this, you can get a timestamp for the spot in the full speed audio file, and won&#039;t need to go back through it later and correct your timestamps (it&#039;s always a good idea to do a couple of spot checks, just in case.) You DO NOT need to change this tempo variable if you are only adjusting the speed within VLC, it takes care of itself. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;offset&#039; section is useful if you are editing a video file which has an OSD timecode which you need to timestamp, rather than the playtime of the file. Again, this is not something you should need to mess with unless you have a specific use for it. If you do have a use for it, keep in mind that occasionally there will be edits that have been made to the video which will throw off your offest, so to speak. Unfortunately there&#039;s no real easy way to deal with this problem that I&#039;m aware of, you simply have to keep an eye on the difference and adjust it as needed. Again, spot checks are always a good idea.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to set the script up to properly offset your video, pick a spot somewhere in the video which is not at the beginning, and then enter in the appropriate values. For instance, if we have a video file which at 01:23:45 play time on the file has an OSD timecode of 12:34:56, you&#039;ll enter the values like this:&lt;br /&gt;
&lt;br /&gt;
    offsetneeded = True&lt;br /&gt;
        vtch = 12 &amp;lt;--hours on the video timecode&lt;br /&gt;
        vtcm = 34 &amp;lt;--minutes on the video timecode&lt;br /&gt;
        vtcs = 56 &amp;lt;--seconds on the video timecode&lt;br /&gt;
&lt;br /&gt;
        atch = 1  &amp;lt;---don&#039;t use a leading 0, or the script will puke&lt;br /&gt;
        atcm = 23 &amp;lt;--minutes on the playback time&lt;br /&gt;
        atcs = 45 &amp;lt;--seconds on the playback time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can use offset with the tempo settings. Don&#039;t use the video timecode at 00:00:00 on the playback time, or the calculation will be off. Check the difference between the video timecode and the playback time at the beginning and end of your file to see if it&#039;s consistent, as that will tell you if there have been any edits made. If there are edits, just change the offset numbers when you get to those points. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, variable bit rates are a pain for transcription.  You&#039;ll get files which simply won&#039;t behave in a useful manner when you try and jog backward, et cetera.  You can try converting those files to ogg format, and that generally solves the problem. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have any questions about this, I can be reached at derek at skyehaven.net.&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17162</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17162"/>
		<updated>2010-10-06T09:11:26Z</updated>

		<summary type="html">&lt;p&gt;Derek: added notes about tempo and offset settings in the script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;OVERVIEW:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PREREQUISITES:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SETUP:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
This setup is window manager agnostic. It shouldn&#039;t make much difference which environment you run it in, the only practical difference will be in how you set up your control keys. I won&#039;t go over how to set up window environment here, but I will try to give you a few pointers below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your control keys for your window environment. Remember to check to make sure that whichever control keys you wish to use are not already used by your window manager. Redefine these control keys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC but, personally, I like having these commands in the script. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I set my control keys up like this:&lt;br /&gt;
&lt;br /&gt;
F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
&lt;br /&gt;
F2 = ~/vlccontrol.py pause&lt;br /&gt;
&lt;br /&gt;
F3 = ~/vlccontrol.py pause (no need for two, just habit)&lt;br /&gt;
&lt;br /&gt;
F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
&lt;br /&gt;
F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
&lt;br /&gt;
Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
&lt;br /&gt;
Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
&lt;br /&gt;
Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use gnome+metacity, you can edit your keybindings in gconf-editor. Go to apps-&amp;gt;metacity-&amp;gt;global_keybindings and assign a command number to control key you want. Then go to app-&amp;gt;metacity-&amp;gt;keybinding_commands and assign the appropriate commands to the command numbers. So, for my keybindings, in &#039;global_keybindings&#039; you would set run_command_1 to F1. Then go to &#039;keybinding_commands&#039;  and set command_1 to /home/YOURNAME/vlccontrol.py jogbackward.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use kde4, open system settings, click on &#039;Shortcuts and Gestures&#039;, then choose &#039;Custom Shortcuts&#039;. In the second pane, under name, choose an appropriate group to put your new bindings (it might be a good idea to create a new group for these under &#039;Preset Actions&#039;, choose &#039;New Group&#039; from the &#039;Edit&#039; menu below the second pane.) Click on &#039;Edit&#039;, go to New-&amp;gt;Global Shortcut-&amp;gt;Command/URL, and name the action. While the new action is selected, click the &#039;Trigger&#039; tab in the right hand pane, click shortcut box and hit the key you wish to bind to the action (F1). Then go to action and enter in the command for that action (/home/YOURNAME/vlccontrol.py jogbackward.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In any window manager which utilizes an rc.xml file for it&#039;s keybindings, like OpenBox, edit the rc.xml in a text editor and go down to the &#039;keybindings&#039; section. Just follow along with the other keybind examples in the file, it&#039;s fairly straightfoward, but your first entry should look something like this, although you will need to put in appropriate symbols around the keywords:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
    keybind key=&amp;quot;F1&amp;quot;&lt;br /&gt;
      action name=&amp;quot;execute&amp;quot;&lt;br /&gt;
        execute /home/delwin/vlccontrol.py jogbackward /execute&lt;br /&gt;
      /action&lt;br /&gt;
    /keybind&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VLCCONTROL.PY:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, here is the vlccontrol.py script. Copy the script below and paste it into a file named &#039;vlccontrol.py&#039;. Save it to your home directory and make it executable with the command &#039;chmod 700 vlccontrol.py&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek at skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #don&#039;t change this. if you need an offset, take care of it below&lt;br /&gt;
    offset = 0&lt;br /&gt;
&lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    &lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it (not the beginning). Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OTHER THINGS YOU MIGHT CARE TO KNOW IF YOU&#039;VE MADE IT THIS FAR:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There are a couple of things in the script which you ought to know about if you do transcription regularly enough to care about these sorts of things. &lt;br /&gt;
&lt;br /&gt;
Within the script, you&#039;ll find settings for &#039;tempo&#039; and &#039;offset&#039;.  Most people aren&#039;t going to need to worry about either of these and can just leave them as they sit. However, if you do alot of transcription, it&#039;s likely you&#039;ll find these to be of some value. &lt;br /&gt;
&lt;br /&gt;
The tempo setting does not refer to VLC&#039;s speed adjustment, rather it&#039;s is used if you have edited an audio file in an external editor, like audacity, and changed the tempo of the audio and created a new audio file based on that.  The &#039;tempo&#039; variable is a percentage of the original audio, so at full speed, you&#039;ll want &#039;tempo = 100&#039;. If you slow it down 20%, you&#039;ll want &#039;tempo = 80&#039;, or &#039;tempo = 175&#039; if you&#039;ve sped it up 75%. By using this, you can get a timestamp for the spot in the full speed audio file, and won&#039;t need to go back through it later and correct your timestamps (it&#039;s always a good idea to do a couple of spot checks, just in case.) You DO NOT need to change this tempo variable if you are only adjusting the speed within VLC, it takes care of itself. &lt;br /&gt;
&lt;br /&gt;
The &#039;offset&#039; section is useful if you are editing a video file which has an OSD timecode which you need to timestamp, rather than the playtime of the file. Again, this is not something you should need to mess with unless you have a specific use for it. If you do have a use for it, keep in mind that occasionally there will be edits that have been made to the video which will throw off your offest, so to speak. Unfortunately there&#039;s no real easy way to deal with this problem that I&#039;m aware of, you simply have to keep an eye on the difference and adjust it as needed. Again, spot checks are always a good idea.&lt;br /&gt;
&lt;br /&gt;
In order to set the script up to properly offset your video, pick a spot somewhere in the video which is not at the beginning, and then enter in the appropriate values. For instance, if we have a video file which at 01:23:45 play time on the file has an OSD timecode of 12:34:56, you&#039;ll enter the values like this:&lt;br /&gt;
&lt;br /&gt;
    offsetneeded = True&lt;br /&gt;
        vtch = 12 &amp;lt;--hours on the video timecode&lt;br /&gt;
        vtcm = 34 &amp;lt;--minutes on the video timecode&lt;br /&gt;
        vtcs = 56 &amp;lt;--seconds on the video timecode&lt;br /&gt;
&lt;br /&gt;
        atch = 1  &amp;lt;---don&#039;t use a leading 0, or the script will puke&lt;br /&gt;
        atcm = 23 &amp;lt;--minutes on the playback time&lt;br /&gt;
        atcs = 45 &amp;lt;--seconds on the playback time&lt;br /&gt;
&lt;br /&gt;
You can use offset with the tempo settings. Don&#039;t use the video timecode at 00:00:00 on the playback time, or the calculation will be off. Check the difference between the video timecode and the playback time at the beginning and end of your file to see if it&#039;s consistent, as that will tell you if there have been any edits made. If there are edits, just change the offset numbers when you get to those points. &lt;br /&gt;
&lt;br /&gt;
Finally, variable bit rates are a pain for transcription.  You&#039;ll get files which simply won&#039;t behave in a useful manner when you try and jog backward, et cetera.  You can try converting those files to ogg format, and that generally solves the problem. &lt;br /&gt;
&lt;br /&gt;
If you have any questions about this, I can be reached at derek at skyehaven.net.&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17160</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17160"/>
		<updated>2010-10-06T08:35:59Z</updated>

		<summary type="html">&lt;p&gt;Derek: minor clarifications&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;OVERVIEW:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PREREQUISITES:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SETUP:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
This setup is window manager agnostic. It shouldn&#039;t make much difference which environment you run it in, the only practical difference will be in how you set up your control keys. I won&#039;t go over how to set up window environment here, but I will try to give you a few pointers below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your control keys for your window environment. Remember to check to make sure that whichever control keys you wish to use are not already used by your window manager. Redefine these control keys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC but, personally, I like having these commands in the script. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I set my control keys up like this:&lt;br /&gt;
&lt;br /&gt;
F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
&lt;br /&gt;
F2 = ~/vlccontrol.py pause&lt;br /&gt;
&lt;br /&gt;
F3 = ~/vlccontrol.py pause (no need for two, just habit)&lt;br /&gt;
&lt;br /&gt;
F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
&lt;br /&gt;
F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
&lt;br /&gt;
Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
&lt;br /&gt;
Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
&lt;br /&gt;
Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use gnome+metacity, you can edit your keybindings in gconf-editor. Go to apps-&amp;gt;metacity-&amp;gt;global_keybindings and assign a command number to control key you want. Then go to app-&amp;gt;metacity-&amp;gt;keybinding_commands and assign the appropriate commands to the command numbers. So, for my keybindings, in &#039;global_keybindings&#039; you would set run_command_1 to F1. Then go to &#039;keybinding_commands&#039;  and set command_1 to /home/YOURNAME/vlccontrol.py jogbackward.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use kde4, open system settings, click on &#039;Shortcuts and Gestures&#039;, then choose &#039;Custom Shortcuts&#039;. In the second pane, under name, choose an appropriate group to put your new bindings (it might be a good idea to create a new group for these under &#039;Preset Actions&#039;, choose &#039;New Group&#039; from the &#039;Edit&#039; menu below the second pane.) Click on &#039;Edit&#039;, go to New-&amp;gt;Global Shortcut-&amp;gt;Command/URL, and name the action. While the new action is selected, click the &#039;Trigger&#039; tab in the right hand pane, click shortcut box and hit the key you wish to bind to the action (F1). Then go to action and enter in the command for that action (/home/YOURNAME/vlccontrol.py jogbackward.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In any window manager which utilizes an rc.xml file for it&#039;s keybindings, like OpenBox, edit the rc.xml in a text editor and go down to the &#039;keybindings&#039; section. Just follow along with the other keybind examples in the file, it&#039;s fairly straightfoward, but your first entry should look something like this, although you will need to put in appropriate symbols around the keywords:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
    keybind key=&amp;quot;F1&amp;quot;&lt;br /&gt;
      action name=&amp;quot;execute&amp;quot;&lt;br /&gt;
        execute /home/delwin/vlccontrol.py jogbackward /execute&lt;br /&gt;
      /action&lt;br /&gt;
    /keybind&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VLCCONTROL.PY:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, here is the vlccontrol.py script. Copy the script below and paste it into a file named &#039;vlccontrol.py&#039;. Save it to your home directory and make it executable with the command &#039;chmod 700 vlccontrol.py&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek@skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offset = 0&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it. Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17159</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17159"/>
		<updated>2010-10-06T08:32:48Z</updated>

		<summary type="html">&lt;p&gt;Derek: minor formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;OVERVIEW:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;PREREQUISITES:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SETUP:&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
This setup is window manager agnostic. It shouldn&#039;t make much difference which environment you run it in, the only practical difference will be in how you set up your control keys. I won&#039;t go over how to set up window environment here, but I will try to give you a few pointers below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your control keys for your window environment. Remember to check to make sure that whichever control keys you wish to use are not already used by your window manager. Redefine these control keys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC but, personally, I like having these commands in the script. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I set my control keys up like this:&lt;br /&gt;
&lt;br /&gt;
F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
&lt;br /&gt;
F2 = ~/vlccontrol.py pause&lt;br /&gt;
&lt;br /&gt;
F3 = ~/vlccontrol.py pause (no need for two, just habit)&lt;br /&gt;
&lt;br /&gt;
F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
&lt;br /&gt;
F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
&lt;br /&gt;
Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
&lt;br /&gt;
Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
&lt;br /&gt;
Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use gnome+metacity, you can edit your keybindings in gconf-editor. Go to apps-&amp;gt;metacity-&amp;gt;global_keybindings and assign a command number to control key you want. Then go to app-&amp;gt;metacity-&amp;gt;keybinding_commands and assign the appropriate commands to the command numbers. So, for my keybindings, in &#039;global_keybindings&#039; you would set run_command_1 to F1. Then go to &#039;keybinding_commands&#039;  and set command_1 to /home/YOURNAME/vlccontrol.py jogbackward.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you use kde4, open system settings, click on &#039;Shortcuts and Gestures&#039;, then choose &#039;Custom Shortcuts&#039;. In the second pane, under name, choose an appropriate group to put your new bindings (it might be a good idea to create a new group for these under &#039;Preset Actions&#039;, choose &#039;New Group&#039; from the &#039;Edit&#039; menu below the second pane.) Click on &#039;Edit&#039;, go to New-&amp;gt;Global Shortcut-&amp;gt;Command/URL, and name the action. While the new action is selected, click the &#039;Trigger&#039; tab in the right hand pane, click shortcut box and hit the key you wish to bind to the action (F1). Then go to action and enter in the command for that action (/home/YOURNAME/vlccontrol.py jogbackward.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In any window manager which utilizes an rc.xml file for it&#039;s keybindings, like OpenBox, edit the rc.xml in a text editor and go down to the &#039;keybindings&#039; section. Just follow along with the other keybind examples in the file, it&#039;s fairly straightfoward, but your first entry should look something like this, although you will need to put in appropriate symbols around the keywords:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
    keybind key=&amp;quot;F1&amp;quot;&lt;br /&gt;
      action name=&amp;quot;execute&amp;quot;&lt;br /&gt;
        execute /home/delwin/vlccontrol.py jogbackward /execute&lt;br /&gt;
      /action&lt;br /&gt;
    /keybind&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VLCCONTROL.PY:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Finally, here is the vlccontrol.py script. Save it to your home directory and make it executable with &#039;chmod 700 vlccontrol.py&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek@skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offset = 0&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it. Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17158</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17158"/>
		<updated>2010-10-06T08:24:24Z</updated>

		<summary type="html">&lt;p&gt;Derek: added information about configuring various window managers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OVERVIEW: &lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PREREQUISITES: &lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SETUP: &lt;br /&gt;
&lt;br /&gt;
This setup is window manager agnostic. It shouldn&#039;t make much difference which environment you run it in, the only practical difference will be in how you set up your control keys. I won&#039;t go over how to set up window environment here, but I will try to give you a few pointers below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your control keys for your window environment. Remember to check to make sure that whichever control keys you wish to use are not already used by your window manager. Redefine these control keys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC but, personally, I like having these commands in the script. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
I set my control up like this:&lt;br /&gt;
F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
F2 = ~/vlccontrol.py pause&lt;br /&gt;
F3 = ~/vlccontrol.py pause (no need for two, just habit)&lt;br /&gt;
F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
&lt;br /&gt;
If you use gnome+metacity, you can edit your keybindings in gconf-editor. Go to apps-&amp;gt;metacity-&amp;gt;global_keybindings and assign a command number to control key you want. Then go to app-&amp;gt;metacity-&amp;gt;keybinding_commands and assign the appropriate commands to the command numbers. So, for my keybindings, in &#039;global_keybindings&#039; you would set run_command_1 to F1. Then go to &#039;keybinding_commands&#039;  and set command_1 to /home/YOURNAME/vlccontrol.py jogbackward.&lt;br /&gt;
&lt;br /&gt;
If you use kde4, open system settings, click on &#039;Shortcuts and Gestures&#039;, then choose &#039;Custom Shortcuts&#039;. In the second pane, under name, choose an appropriate group to put your new bindings (it might be a good idea to create a new group for these under &#039;Preset Actions&#039;, choose &#039;New Group&#039; from the &#039;Edit&#039; menu below the second pane.) Click on &#039;Edit&#039;, go to New-&amp;gt;Global Shortcut-&amp;gt;Command/URL, and name the action. While the new action is selected, click the &#039;Trigger&#039; tab in the right hand pane, click shortcut box and hit the key you wish to bind to the action (F1). Then go to action and enter in the command for that action (/home/YOURNAME/vlccontrol.py jogbackward.)&lt;br /&gt;
&lt;br /&gt;
In any window manager which utilizes an rc.xml file for it&#039;s keybindings, like OpenBox, edit the rc.xml in a text editor and go down to the &#039;keybindings&#039; section. Just follow along with the other keybind examples in the file, it&#039;s fairly straightfoward, but your first entry should look something like this, although you will need to put in appropriate symbols around the keywords:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
    keybind key=&amp;quot;F1&amp;quot;&lt;br /&gt;
      action name=&amp;quot;execute&amp;quot;&lt;br /&gt;
        execute /home/delwin/vlccontrol.py jogbackward /execute&lt;br /&gt;
      /action&lt;br /&gt;
    /keybind&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, here is the vlccontrol.py script. Save it to your home directory and make it executable with &#039;chmod 700 vlccontrol.py&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek@skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offset = 0&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it. Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17157</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17157"/>
		<updated>2010-10-06T07:48:53Z</updated>

		<summary type="html">&lt;p&gt;Derek: more formatting issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OVERVIEW: &lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PREREQUISITES: &lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SETUP: &lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your hotkeys for your window environment. This should work equally well in any window manger, so pick whichever you like. Remember to check to make sure that whichever hotkeys you wish to use are not already used by your windowmanager. Redefine these hotkeys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC, but I personally like having these commands in the script, anyway. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek@skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    #have vlc post the time ~/vlc.out&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    &lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    &lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    &lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offset = 0&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    &lt;br /&gt;
    #If an offset is needed:&lt;br /&gt;
    #Pick a spot on the video and pause it. Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    &lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    &lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
        &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17156</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17156"/>
		<updated>2010-10-06T07:42:05Z</updated>

		<summary type="html">&lt;p&gt;Derek: still trying to format this code properly&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Howto}} &lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting. &lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
PREREQUISITES: &lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. &lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
SETUP: &lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your hotkeys for your window environment. This should work equally well in any window manger, so pick whichever you like. Remember to check to make sure that whichever hotkeys you wish to use are not already used by your windowmanager. Redefine these hotkeys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC, but I personally like having these commands in the script, anyway. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek@skyehaven.net&lt;br /&gt;
&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
&lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
&lt;br /&gt;
#conditions are met:&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
&lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offset = 0&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    #Pick a spot on the video and pause it. Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
    #xdotool requires a version later created than august 2010&lt;br /&gt;
    #    &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17155</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17155"/>
		<updated>2010-10-06T07:40:03Z</updated>

		<summary type="html">&lt;p&gt;Derek: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Howto}} &lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting. &lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
PREREQUISITES: &lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need. &lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories. &lt;br /&gt;
&lt;br /&gt;
SETUP: &lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;amp;gt;preferences and click on &amp;quot;show settings-&amp;amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;amp;gt;Main Interfaces-&amp;amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field. &lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds. &lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again. &lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your hotkeys for your window environment. This should work equally well in any window manger, so pick whichever you like. Remember to check to make sure that whichever hotkeys you wish to use are not already used by your windowmanager. Redefine these hotkeys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC, but I personally like having these commands in the script, anyway. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek@skyehaven.net&lt;br /&gt;
&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
&lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
&lt;br /&gt;
#conditions are met:&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
&lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offset = 0&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    #Pick a spot on the video and pause it. Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
    #xdotool requires a version later created than august 2010&lt;br /&gt;
    #    &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17154</id>
		<title>VLC HowTo/Use for transcription (Linux)</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo/Use_for_transcription_(Linux)&amp;diff=17154"/>
		<updated>2010-10-06T06:49:04Z</updated>

		<summary type="html">&lt;p&gt;Derek: Instructions and a script useful for doing transcription in linux&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Howto}}&lt;br /&gt;
&lt;br /&gt;
VLC makes a good option for people trying to do transcription of audio or video in linux. The script below might be usable in other operating systems, but will likely take some adjusting.&lt;br /&gt;
&lt;br /&gt;
The purpose of this howto is to show you how to configure vlc and use the script below to enable you to control vlc with scripted commands and, most importantly, take a timestamp from vlc and automatically type it into whatever document you are working on, without ever needing to shift focus away from the document. &lt;br /&gt;
&lt;br /&gt;
There are other ways to achieve what I&#039;ve done with this, many of them likely better than what is here. But this works, and works well. &lt;br /&gt;
&lt;br /&gt;
PREREQUISITES:&lt;br /&gt;
&lt;br /&gt;
First, you need to have VLC (obviously), xautomation OR a version of xdotool (newer than august 2010), and you need the openbsd implementation of netcat. &lt;br /&gt;
&lt;br /&gt;
The openbsd version of netcat is in the repositories of most major linux distirbutions these days. This script is written for use in Archlinux, so it&#039;s likely that you will need to change the command used by netcat in the script. Arch uses nc.openbsd, just replace it with whatever you need.&lt;br /&gt;
&lt;br /&gt;
xautomation will almost certainly be in your repos, and xdotool might be. xautomation seems to be the better choice if you&#039;re only concerned about how quickly it does the job, but xdotool is nice as well if you&#039;re doing fancier things with it. However, if you do choose to try xdotool, you&#039;ll need a build done later than August 2010, as some of the features used in this script are not in the older versions available in most repositories.&lt;br /&gt;
&lt;br /&gt;
SETUP:&lt;br /&gt;
&lt;br /&gt;
To set up vlc to use this script, go to tools-&amp;gt;preferences and click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. From that menu, select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;, check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
&lt;br /&gt;
You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the script if you don&#039;t change this value, as it uses the &#039;very short jump&#039; command rather than jogging a specific number of seconds. If you poke around the vlc docs, you&#039;ll see a seek command, but that is to go to a certain point in a file rather than going forward or backward a certain number of seconds.&lt;br /&gt;
&lt;br /&gt;
Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; in your home directory. This should be created automatically when vlc starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
&lt;br /&gt;
Next, you need to set up your hotkeys for your window environment. This should work equally well in any window manger, so pick whichever you like. Remember to check to make sure that whichever hotkeys you wish to use are not already used by your windowmanager. Redefine these hotkeys or the defaults as necessary. I didn&#039;t have any luck with the global hotkeys settings within VLC, but I personally like having these commands in the script, anyway. You may have better results with some experimentation.&lt;br /&gt;
&lt;br /&gt;
THE vlccontrol.py SCRIPT:&lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#### licensing nonsense - short version: New BSD License&lt;br /&gt;
#Copyright (c) 2010, Derek Barnett, Skyehaven Transcription&lt;br /&gt;
#Contact: derek@skyehaven.net&lt;br /&gt;
#All rights reserved.&lt;br /&gt;
#Redistribution and use in source and binary forms, with or &lt;br /&gt;
#without modification, are permitted provided that the following &lt;br /&gt;
#conditions are met:&lt;br /&gt;
#&lt;br /&gt;
#    * Redistributions of source code must retain the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer.&lt;br /&gt;
#    * Redistributions in binary form must reproduce the above &lt;br /&gt;
#copyright notice, this list of conditions and the following &lt;br /&gt;
#disclaimer in the documentation and/or other materials provided &lt;br /&gt;
#with the distribution.&lt;br /&gt;
#    * Neither the name of the Skyehaven Transcription nor the &lt;br /&gt;
#names of its contributors may be used to endorse or promote &lt;br /&gt;
#products derived from this software without specific prior &lt;br /&gt;
#written permission.&lt;br /&gt;
#&lt;br /&gt;
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND &lt;br /&gt;
#CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, &lt;br /&gt;
#INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF &lt;br /&gt;
#MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE &lt;br /&gt;
#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR &lt;br /&gt;
#CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, &lt;br /&gt;
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT &lt;br /&gt;
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF &lt;br /&gt;
#USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED &lt;br /&gt;
#AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT &lt;br /&gt;
#LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING &lt;br /&gt;
#IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF &lt;br /&gt;
#THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
#####&lt;br /&gt;
##### useful notes&lt;br /&gt;
#vlc control script, compatible with python 2 or 3&lt;br /&gt;
#&lt;br /&gt;
#this script requires the openbsd version of netcat. gnu&#039;s version&lt;br /&gt;
#does not appear to support unix sockets as of this time. it will &lt;br /&gt;
#almost certainly be in the repos of your distribution. you may need&lt;br /&gt;
#to adjust this script to change the name of the binary to whatever&lt;br /&gt;
#format your distribution uses (change &#039;nc.openbsd&#039; below to whatever &lt;br /&gt;
#you need.)&lt;br /&gt;
#&lt;br /&gt;
#it also requires either xautomation (for it&#039;s xte tool) or xdotool&lt;br /&gt;
#xautomation is used by default, as it&#039;s currently a bit faster&lt;br /&gt;
#if you use xdotool, ensure that it&#039;s a version later than aug 2010&lt;br /&gt;
#&lt;br /&gt;
#to set up vlc to use this script, go to tools-&amp;gt;preferences and &lt;br /&gt;
#click on &amp;quot;show settings-&amp;gt;all&amp;quot; at the bottom. from that menu, &lt;br /&gt;
#select &amp;quot;Interface-&amp;gt;Main Interfaces&amp;quot;, and check the &amp;quot;Remote Control &lt;br /&gt;
#Interface&amp;quot; box. Next, select &amp;quot;Interface-&amp;gt;Main Interfaces-&amp;gt;RC&amp;quot;,&lt;br /&gt;
#check the &amp;quot;Fake TTY&#039; box, and enter &#039;home/YOURNAME/vlc.sock&#039;in&lt;br /&gt;
#the &amp;quot;UNIX socket command input&amp;quot; field.  &lt;br /&gt;
#&lt;br /&gt;
#You probably also want to adjust the &amp;quot;Very short jump length&amp;quot; located&lt;br /&gt;
#in &amp;quot;Interface-&amp;gt;Hotkeys settings&amp;quot;. This script assumes that it is set&lt;br /&gt;
#for 5 seconds rather than the default of 3 seconds. It won&#039;t affect the&lt;br /&gt;
#script if you don&#039;t change this value, as it uses the &#039;very short jump&#039;&lt;br /&gt;
#command rather than jogging a specific number of seconds. If you poke &lt;br /&gt;
#around the vlc docs, you&#039;ll see a seek command, but that is to go to a&lt;br /&gt;
#certain point in a file rather than going forward or backward a certain&lt;br /&gt;
#number of seconds.&lt;br /&gt;
#&lt;br /&gt;
#Hit &amp;quot;Save&amp;quot;. Restart VLC, and check to see if it creates &amp;quot;vlc.sock&amp;quot; &lt;br /&gt;
#in your home directory. This should be created automatically when vlc &lt;br /&gt;
#starts. If it doesn&#039;t, check your socket path and try again.&lt;br /&gt;
#&lt;br /&gt;
#Next, you need to set up your hotkeys for your window environment.&lt;br /&gt;
#This should work equally well in any window manger, so pick whichever&lt;br /&gt;
#you like. Remember to check to make sure that whichever hotkeys you wish&lt;br /&gt;
#to use are not already used by your windowmanager. Redefine these&lt;br /&gt;
#hotkeys or the defaults as necessary.&lt;br /&gt;
#&lt;br /&gt;
#note: vlc supposedly support global hotkeys, but I didn&#039;t have any luck &lt;br /&gt;
#with them, which is why i went this route with the control script. Your&lt;br /&gt;
#mileage may vary.&lt;br /&gt;
#&lt;br /&gt;
#I personally set it up like this:&lt;br /&gt;
#F1 = ~/vlccontrol.py jogbackward&lt;br /&gt;
#F2 = ~/vlccontrol.py pause (no need to have this twice, just habit)&lt;br /&gt;
#F3 = ~/vlccontrol.py pause&lt;br /&gt;
#F4 = ~/vlccontrol.py jogforward&lt;br /&gt;
#F5 = ~/vlccontrol.py timestamp&lt;br /&gt;
#Shift+F1 = ~/vlccontrol.py slower&lt;br /&gt;
#Shift+F3 = ~/vlccontrol.py normal&lt;br /&gt;
#Shift+F4 = ~/vlccontrol.py faster&lt;br /&gt;
##### end of rambling, on to business&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
#feed command to vlc socket to get the time played in seconds&lt;br /&gt;
workingdir = os.path.join(os.path.expanduser(&#039;~&#039;))&lt;br /&gt;
vlcin = os.path.join(workingdir,&#039;vlc.sock&#039;)&lt;br /&gt;
vlcout = os.path.join(workingdir,&#039;vlc.out&#039;)&lt;br /&gt;
#accept argument when running script, e.g. &#039;./vlctimestamp.py timestamp&#039;&lt;br /&gt;
args = sys.argv[1:]&lt;br /&gt;
i = &amp;quot;normal&amp;quot;&lt;br /&gt;
if args:&lt;br /&gt;
    i = str.lower(args[0])&lt;br /&gt;
#acceptable arguments: help, --help, pause, jogforward, +5, jogbackward, -5,&lt;br /&gt;
#faster, slower, normal, timestamp. no argument assumes &#039;normal&#039;&lt;br /&gt;
if i == &amp;quot;help&amp;quot; or i == &amp;quot;-help&amp;quot; or i == &amp;quot;--help&amp;quot;:&lt;br /&gt;
    print(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
             &#039;help&#039; or &#039;--help&#039; returns this help&lt;br /&gt;
             &#039;pause&#039; is a play/pause toggle&lt;br /&gt;
             &#039;jogforward&#039; or &#039;+5&#039; jumps forward 5 seconds&lt;br /&gt;
             &#039;jogbackward&#039; or &#039;-5&#039; jumps backward 5 seconds&lt;br /&gt;
             &#039;faster&#039; increases the tempo without increasing pitch&lt;br /&gt;
             &#039;slower&#039; decreases the tempo without decreasing pitch&lt;br /&gt;
              no argument or &#039;normal&#039; returns vlc to normal speed&lt;br /&gt;
              &#039;timestamp&#039; types a hh:mm:ss coded timestamp into &lt;br /&gt;
                          active window. see comments within this&lt;br /&gt;
                          script if you need to change the timestamp&lt;br /&gt;
                          string, offset the timestamp for a video&lt;br /&gt;
                          timecode, or if you&#039;ve made tempo changes&lt;br /&gt;
                          in an audio file outside of vlc&lt;br /&gt;
             &amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogforward&amp;quot; or i == &amp;quot;+5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump+extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;jogbackward&amp;quot; or i == &amp;quot;-5&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-jump-extrashort&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;pause&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;pause&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;faster&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-faster-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;slower&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;key key-rate-slower-fine&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;normal&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;br /&gt;
&lt;br /&gt;
elif i == &amp;quot;timestamp&amp;quot;:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;get_time&amp;quot; | nc.openbsd -U &#039; + vlcin + &#039; &amp;gt; &#039; + vlcout)&lt;br /&gt;
    #read vlc.out and report time played in seconds&lt;br /&gt;
    f = open(vlcout, &#039;r&#039;)&lt;br /&gt;
    f_list = f.read().split(&amp;quot;\n&amp;quot;)&lt;br /&gt;
    if len(f_list) &amp;gt; 2:&lt;br /&gt;
        sec = f_list[1]&lt;br /&gt;
    else:&lt;br /&gt;
        sec = f_list[0]&lt;br /&gt;
    sec = int(sec)&lt;br /&gt;
    #tempo - if you&#039;ve adjusted the tempo and an audio file, in &lt;br /&gt;
    #        audacity for instance, then you can use the tempo&lt;br /&gt;
    #        variable to give output for a timestamp postion in &lt;br /&gt;
    #        original file. tempo is the percent playback speed&lt;br /&gt;
    #        of the modified file. 80 = -20% tempo change, etc.&lt;br /&gt;
    #        default is 100&lt;br /&gt;
    tempo = 100&lt;br /&gt;
    #change offsetneeded to True if, for instance, you need to &lt;br /&gt;
    #use a timecode embedded into a video rather than the playtime&lt;br /&gt;
    #of the file&lt;br /&gt;
    offset = 0&lt;br /&gt;
    offsetneeded = False&lt;br /&gt;
    if offsetneeded == True:&lt;br /&gt;
    #Pick a spot on the video and pause it. Enter the appropriate values below:&lt;br /&gt;
    #vtch = hours on video time code, vtcm = minutes, vtcs = seconds&lt;br /&gt;
        vtch = 0&lt;br /&gt;
        vtcm = 0&lt;br /&gt;
        vtcs = 0&lt;br /&gt;
        vtc = (vtch * 3600) + (vtcm * 60) + vtcs&lt;br /&gt;
    #atch = hours in actual playtime, atcm = minutes, &lt;br /&gt;
    #atcs = seconds            &lt;br /&gt;
        atch = 0&lt;br /&gt;
        atcm = 0&lt;br /&gt;
        atcs = 0&lt;br /&gt;
        atc = ((((atch * 3600) + (atcm * 60) + atcs) * tempo) / 100)&lt;br /&gt;
        offset = vtc - atc&lt;br /&gt;
    #get the values for hh:mm:ss formatting&lt;br /&gt;
    sec = ((sec * tempo) / 100) + offset&lt;br /&gt;
    th = sec/3600&lt;br /&gt;
    tm = (sec % 3600)/60&lt;br /&gt;
    ts = sec % 60&lt;br /&gt;
    #format the timestamp, default looks like &#039;##Inaudible 00:01:10## &#039;&lt;br /&gt;
    #the timestamp in hours:minutes:seconds                    &lt;br /&gt;
    t = &amp;quot;%02d:%02d:%02d&amp;quot; % (th,tm,ts)    &lt;br /&gt;
    #string to append before timestamp&lt;br /&gt;
    #for no prefix, set prefix = &amp;quot;&amp;quot;&lt;br /&gt;
    prefix = &amp;quot;##Inaudible &amp;quot;&lt;br /&gt;
    #string to append after timestamp&lt;br /&gt;
    #for no suffix, set suffix = &amp;quot;&amp;quot;&lt;br /&gt;
    suffix = &amp;quot;## &amp;quot;                           &lt;br /&gt;
    #xdotool requires a version later created than august 2010&lt;br /&gt;
    #    &lt;br /&gt;
    #xdotool command to execute, uncomment next line to use xdotool&lt;br /&gt;
    #dropstamp = str(&amp;quot;xdotool type --delay 0 --clearmodifiers &#039;&amp;quot; + prefix + t + suffix + &amp;quot;&#039;&amp;quot;)&lt;br /&gt;
    #    &lt;br /&gt;
    #drop the timestamp string into active window, uncomment next line to use xdotool&lt;br /&gt;
    #os.system(dropstamp)&lt;br /&gt;
    #        &lt;br /&gt;
    #use xte from the xautomation package if you don&#039;t have a version of &lt;br /&gt;
    #xdotool newer than august 2010&lt;br /&gt;
    os.system(&#039;xte &amp;quot;str &#039; + prefix + t + suffix + &#039;&amp;quot;&#039;)       &lt;br /&gt;
&lt;br /&gt;
#if we don&#039;t feed an argument to the script, normalize the play speed of vlc&lt;br /&gt;
else:&lt;br /&gt;
    os.system(&#039;echo &amp;quot;normal&amp;quot; | nc.openbsd -U &#039; + vlcin)&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=VLC_HowTo&amp;diff=17153</id>
		<title>VLC HowTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=VLC_HowTo&amp;diff=17153"/>
		<updated>2010-10-06T06:23:48Z</updated>

		<summary type="html">&lt;p&gt;Derek: /* Other Stuff */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Below are some handy guides for using {{VLC}}&lt;br /&gt;
&lt;br /&gt;
===Playing Video and Audio===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[What can vlc do#How to enable/use subtitles|Use Subtitles]]&lt;br /&gt;
*: Playing movies with subtitles&lt;br /&gt;
* [[How to Use a Capture Card|Use a Capture Card]]&lt;br /&gt;
*: This explains how to watch TV or get video from your capture card.&lt;br /&gt;
* [[What can vlc do#Play DVD/SVCD/VCD iso&#039;s / Images|Play DVDs and Disks from the image file]]&lt;br /&gt;
*: This explains how to use movies encoded onto an ISO file.&lt;br /&gt;
&lt;br /&gt;
===Adjusting Settings===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[What can vlc do#How to adjust picture brightness/colors/contrast..|Adjust Picture Brightness and Contrast]]&lt;br /&gt;
* [[What can vlc do#How to control the aspect ratio of the video|Edit the Aspect Ratio of a video]]&lt;br /&gt;
* [[Crop|Crop video]]&lt;br /&gt;
* [[How_to_disable_acceleration_in_Win32|Disable video acceleration in Win32]]&lt;br /&gt;
* [[How_to_save_bookmarks | Save bookmarks]]&lt;br /&gt;
* [[How_to_play_multiple_instances_of_VLC | How to play multiple instances]]&lt;br /&gt;
&lt;br /&gt;
===Remote Control for VLC===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[Control VLC via a browser]]&lt;br /&gt;
*: This explains how to use the HTTP [[interface]]&lt;br /&gt;
* [[Control VLC via a widget]] on the Mac desktop&lt;br /&gt;
* [[Control VLC from an iPhone]]&lt;br /&gt;
* [[Control VLC from an Android Phone]]&lt;br /&gt;
* [[Control VLC from a Palm Web OS Phone]]&lt;br /&gt;
* [[How to Use Creative Remote]]&lt;br /&gt;
*: Explains how to control {{VLC}} with Creative brand remote controls&lt;br /&gt;
&lt;br /&gt;
===Transcoding and Streaming===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[iPod Video Conversion Guide|Play videos on your iPod]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your iPod.&lt;br /&gt;
* [[Play_on_Yan Micro|Play videos on your Play-Yan Micro]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your Play-Yan Micro.&lt;br /&gt;
* [[Play_on_Xbox|Play videos on your XBox and XBox 360 ]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your XBox.&lt;br /&gt;
* [[Play_on_Zune| Play video on your Zune]]&lt;br /&gt;
*: This explains how to convert your videos so they play on your Zune.&lt;br /&gt;
* [[Fixing .flv to .avi with Ffmpeg]]&lt;br /&gt;
*: This explains how to use ffmpeg to a convert broken .flv files to a perfectly good .avi file &#039;&#039;&#039;DEPRECATED&#039;&#039;&#039;&lt;br /&gt;
* [[Transcode_WM_to_Mov_or_MP4|Convert Windows Media audio/video files to MOV or .MP4]]&lt;br /&gt;
*: This explains how to convert Windows Media-encoded files to Quicktime or MPEG-4 files&lt;br /&gt;
* [[Streaming_to_ActiveX_for_Windows_Media_Player | Streaming from a webcam to an ActiveX embedded object page]]&lt;br /&gt;
* [[How_to_add_logo | Add a logo on your videos]]&lt;br /&gt;
* [[Mosaic| Create a Mosaic]]&lt;br /&gt;
*: This explains how to set up a mosaic from a few streams like a TV portal.&lt;br /&gt;
* [[How to DBox|Set up Video on Demand on a Dreambox]]&lt;br /&gt;
* [[How to Batch Encode]]&lt;br /&gt;
*: This explains how to set up a batch transcode with all files in a directory of a certain file extension being transcoded to a specified format.&lt;br /&gt;
* [[How to merge and transcode multiple videos]]&lt;br /&gt;
*: This explains how to take several source videos and merge then transcode resulting in a single file output.&lt;br /&gt;
&lt;br /&gt;
===Using VLC in other Applications===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[ActiveX]]&lt;br /&gt;
*: Specification for ActiveX control&lt;br /&gt;
* [[LibVLC|Use VLC&#039;s External API]]&lt;br /&gt;
*: Information for using libvlc&lt;br /&gt;
* [[Use in Media Center]]&lt;br /&gt;
* [[Useful Firefox Extensions]]&lt;br /&gt;
*: Information about extensions to view embedded videos in web pages using VLC&lt;br /&gt;
* [[GWT]]&lt;br /&gt;
*: Google WebToolkit&lt;br /&gt;
&lt;br /&gt;
===Other Stuff===&lt;br /&gt;
;How to...&lt;br /&gt;
* [[How to Create a DVD|Create a DVD]]&lt;br /&gt;
*: This explains how to make a DVD from your home videos&lt;br /&gt;
* [[ActiveX/Delphi|Use the ActiveX control with Borland&#039;s Delphi]]&lt;br /&gt;
*: Using the VLC ActiveX plug-in in your programs&lt;br /&gt;
* [[ActiveX/HTML|Use the ActiveX control within a webpage.]]&lt;br /&gt;
* [[HowTo_Integrate_VLC_plugin_in_your_webpage|Integrate ActiveX/Mozilla on your webpage]]&lt;br /&gt;
* [[Change the brightness or contrast of a video|Change a video]]&lt;br /&gt;
*: This explains how to edit a video and save the changes&lt;br /&gt;
* [[How to create thumbnails]]&lt;br /&gt;
* [[How to Use Lirc]]&lt;br /&gt;
* [[How to shut down computer]] when VLC playback is over...&lt;br /&gt;
* [[How to make VLC the default player]]&lt;br /&gt;
* [[How to use VLC for transcription in linux]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* &#039;&#039;&#039;See also [[:Category:How To]]&#039;&#039;&#039;&lt;br /&gt;
[[Category:How To]]&lt;/div&gt;</summary>
		<author><name>Derek</name></author>
	</entry>
</feed>