ELAN batch audio clipping using script


I’ve followed the Clipping media using a script for Windows (and Linux) guide (https://www.mpi.nl/tools/elan/docs/Clip_media_Windows.pdf) to export audio clippings. I have several comments and questions

  1. Can I batch clip one full tier? If yes, how?
  2. When I untick the “prompt for clip filename”, ELAN doesn’t seem to do anything when I have selected a section for export
  3. When I have preset a folder, it doesn’t seem to export it in that folder.

Thank you!



Concerning your point:

  1. yes, but this is currently only available as a “multiple file operation”, accessible via File-> Multiple File Processing->Create Multiple Media Clips… The item is maybe not so easy to find in the manual, apologies for that, at the moment it is section “ Create multiple media clips” in this chapter.

  2. and 3. I wonder if this might be the same problem. The default media location one can set is not used as an output folder for media clips (it is a folder ELAN looks in for media files if it can’t find the media files when opening an .eaf file). I understand this is confusing. If you untick the “prompt for clip file name” option, the clip will be created in the folder containing the input media file. Did you (or can you) check that folder to see if the clips are there?


Hi Han,

You are right for point 2 and 3. The files are created in the folder containing the input media file. Thank you!

Re point 1, I’m having some obstacles in the last step of exporting multiple media clips. The process report mentions the following:
V:\Transcription\ELAN\my_audio.wav: No such file or directory
However, I have directed ELAN to my C:\Users\personal_account\Desktop\ELAN folder on a virtual machine.
In my file explorer, I don’t even have the V drive. Would this be because of the virtual machine?

Starting multiple file clipping...

Script file: C:\Users\personal_account\.elan_data\clip-media.txt
Executable: C:\Users\personal_account\Desktop\ffmpeg-20200729-cbb6ba2-win64-static\ffmpeg-20200729-cbb6ba2-win64-static\bin\ffmpeg.exe
Parameter part: -i $in_file -vcodec copy -acodec copy -ss $begin(sec.ms) -t $duration(sec.ms) $out_file
Input file: C:\Users\personal_account\Desktop\ELAN\ELAN_transcriptions\tab_file.txt
Output folder is: C:\Users\personal_account\Desktop\ELAN\ELAN_transcriptions
Encountered file C:\Users\personal_account\Desktop\ELAN\ELAN_transcriptions\my_audio.eaf. Linked media files will be clipped.
Clipping 6 segments from V:\Transcription\ELAN\my_audio.wav
ffmpeg version git-2020-07-29-cbb6ba2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.1 (GCC) 20200726
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf

V:\Transcription\ELAN\my_audio.wav: No such file or directory

Hi, I don’t know if this can be because of the virtual machine. What kind of virtual machine is this, the Hyper-V type of virtual machine? And can it be it once has been mounted as the V; drive?

What happens if you open the file “C:\Users\personal_account\Desktop\ELAN\ELAN_transcriptions\my_audio.eaf” in ELAN? Is the wave file there or do you see some “locate the media” file browser? In the former case, maybe the file is found through a relative path while the clipping function just takes the absolute file path. If you open the mentioned .eaf file in a text or XML editor, do you see the “V:\Transcription\ELAN\my_audio.wav” path in a media descriptor element?

1 Like

Yes, indeed, when I open the .eaf file it mentions
<MEDIA_DESCRIPTOR MEDIA_URL="file:///V:/Transcription/ELAN/my_audio.wav" MIME_TYPE="audio/x-wav" RELATIVE_MEDIA_URL="../my_audio"/>

I changed the MEDIA_DESCRIPTOR MEDIA_URL to my C drive and it worked! Thank you.

I assume this weird linking will be in all my .eaf files, is there a better way to do this except doing it by had in every single .eaf file?

ELAN doesn’t provide a way to change (part of) the media URL in many files at the same time. Maybe your text editor provides a search and replace in many files? (This will only be useful if always the same part of the URL has to be replaced by the same replacement text.)

1 Like