Home Forums Software ELAN multiple issues with 'create multiple media clips'

multiple issues with 'create multiple media clips'

This topic contains 7 replies, has 2 voices, and was last updated by  elsb 1 week, 2 days ago.

Viewing 8 posts - 1 through 8 (of 8 total)
Author Posts
Author Posts
May 3, 2019 at 23:38 #12935

elsb

Hello,

I am having an issue with the “create multiple media clips” function. I have a .txt file set up as follows: column 1: begin time (ss.msec). column 2: end time (ss.msec); column 3: filepath (which was generated by the ‘multiple search’ in ELAN, so I know it’s right). This is what it looks like:

418.55 448.55 30 /Users/emilyr/Documents/William/010427.c2elan.eaf

I open an ELAN file (in this case, the first file listed on the .txt file), go to create multiple media clips, and select the .txt file and the output location when prompted. The first thing ELAN does is display the message: “Processing clips based on eaf file 010829.eaf”. This file happens to be the third of six listed in the .txt file I called. I’m not sure what this message means though.

The next thing that happens is Quicktime gives the error that no such file exists. (But the files do exist, and are in the right place!) I click ok, and the video is not clipped. I’ve noticed if I open all the .mp4s before running “create multiple media clips”, the error still appears but the video *is* clipped.

However, the next problem is that it seems to be the wrong video that’s clipped; it seems to be cutting the correct time (I think) but from the wrong .eaf (maybe even an .eaf not listed in the .txt file although I haven’t figured this out yet). In the output report, I notice the following error: Clipping 1 segments from ///010829.mp4
/Users/emilyr/Library/Preferences/ELAN/qtp_clip_10_10_export.scpt: execution error: QuickTime Player got an error: End time must be less than or equal to duration (6)

Errors like the following are also present in ELAN’s log, but the start times in the .txt file are definitely before the end times, so I’m not sure what is causing this. Error: end time before start time. Tier: MOT Start time: 00:14:39.236 End time: 00:00:00.199

So, there seem to be multiple issues here, but I wonder if there is some simple thing I’m doing wrong that could explain it all?

Thank you!

-Emily

May 6, 2019 at 10:54 #12940

Han

Although I’m not sure if this function has (recently) been tested on macOS in combination with clipping with QuickTime Player, I guess it should work.
There are a few things to take into account:
– this function calls the “clip media with script” function which depends on the file “clip-media .txt”, so e.g. the time formats should be “in sync”. In the report there should be lines starting with “Executable: ” and “Parameter part: “, maybe you can post those here too.
– apart from the paths to the .eaf files that need to be correct, the paths to the media file in the eaf should also be correct (not requiring user intervention)
– I cannot explain why the processing starts with the third eaf file in the csv file, if there aren’t any warning messages in the report why the first files were skipped
– are the errors that you mention at the end of your post from the general ELAN log or are they in the clipping report? In the first case, it might be good to check those files and maybe correct the mentioned annotations on the “MOT” tier. But this is probably independent of the clipping problems.

-Han

May 6, 2019 at 20:07 #12949

elsb

Hi Han,

Thanks for your reply. I made a few changes and now there is no warning message (“processing files based on .eaf file 010829.eaf”). Processing seems to start with the first file in the .txt file too, so I *think* that is solved. The changes were: removed spaces from the file path, and removed any files NOT listed in the .txt file from the folder. The other problems remain.

Re: your first point, I’ve checked the time formats for clip.media.txt. It is sec. ms format (pasted below), and the .txt file I’m trying to call is the same (also below). Note, I’ve fiddled a bit with the decimal places, and have settled on one decimal place as recommend by you in a previous thread. (I needed to make this a non-0 decimal or the decimal deletes in the text file and the videos end up x microseconds long instead of x seconds…)

osascript ../Resources/qtp_clip_10_10_export.scpt $in_file $out_file $begin(sec.ms) $end(sec.ms)

418.6 448.6 30 /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010427.c2elan.eaf
2857.1 2887.1 30 /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010605.c2elan.eaf
990.1 1020.1 30 /Users/emilyr/DocumentsCHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010829.c2elan.eaf
172.1 202.1 30 /Users/emilyr/DocumentsCHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010912.c2elan.eaf
1673.7 1703.7 30 /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010912.c2elan.eaf
1724.2 1754.2 30 /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010912.c2elan.eaf

A few things: 1) Quicktime error remains the same as above (and still seems to be solved if mp4s are opened prior to running the function). 2) The wrong videos are still being clipped. I don’t know which ones, but the .mp4 files are in the same folder as the .eafs in the text file, so I can’t think what the problem would be here. 3) The .txt file currently contains 6 files. However, only 4 files ever get clipped. In case it matters, I’ve noticed the two files that aren’t being clipped are the ones that start latest (2851 seconds and 1724 seconds), so maybe whatever video it’s trying to clip (see problem 2) just isn’t that long.

Here is the processing report:

Process report:

Starting multiple file clipping…
Script file: /Users/emilyr/Library/Preferences/ELAN/clip-media.txt
Executable: osascript
Parameter part: /Users/emilyr/Library/Preferences/ELAN/qtp_clip_10_10_export.scpt $in_file $out_file $begin(sec.ms) $end(sec.ms)
Input file: /Users/emilyr/Documents/CHILDES_summary_evidential_data/Providence_video_subset_actually_tokens_William_May2fw2.txt
Output folder is: /Users/emilyr/Documents/844 clips original en-coding/William/1 decimal place no 0s
Encountered file /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010427.c2elan.eaf. Linked media files will be clipped.
Encountered file /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010605.c2elan.eaf. Linked media files will be clipped.
Encountered file /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010829.c2elan.eaf. Linked media files will be clipped.
Encountered file /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010912.c2elan.eaf. Linked media files will be clipped.
Clipping 1 segments from ///010829.mp4
Processing of /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010829.c2elan.eaf done. (But the actual clipping might still continue.)
Clipping 1 segments from ///010427.mp4
Processing of /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010427.c2elan.eaf done. (But the actual clipping might still continue.)
Clipping 3 segments from ///010912.mp4
/Users/emilyr/Library/Preferences/ELAN/qtp_clip_10_10_export.scpt: execution error: QuickTime Player got an error: End time must be less than or equal to duration (6)
Processing of /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010912.c2elan.eaf done. (But the actual clipping might still continue.)
Clipping 1 segments from ///010605.mp4
/Users/emilyr/Library/Preferences/ELAN/qtp_clip_10_10_export.scpt: execution error: QuickTime Player got an error: End time must be less than or equal to duration (6)
Processing of /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010605.c2elan.eaf done. (But the actual clipping might still continue.)

Here is ELAN’s log:

May 6, 2019 10:22:10 AM mpi.eudico.client.annotator.ELAN main
INFO:

@ELAN Launched

May 6, 2019 10:22:10 AM mpi.eudico.client.annotator.ELAN main
INFO: ELAN 5.4
Java home: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Java version: 1.6.0_65
Runtime: 1.6.0_65-b14-468
OS name: Mac OS X
OS version: 10.11.6
OS arch.: x86_64
User language: en
User home: /Users/emilyr
User dir: /Applications/ELAN_5.4.app/Contents/Resources
Classpath: /Applications/ELAN_5.4.app/Contents/Java/elan-5.4.jar:/Applications/ELAN_5.4.app/Contents/Java/sunjce_provider.jar:/Applications/ELAN_5.4.app/Contents/Java/help.zip:/Applications/ELAN_5.4.app/Contents/Java/jhall-2.0.0.5.jar:/Applications/ELAN_5.4.app/Contents/Java/nl.mpi.lookup__V1.0.jar
Library path: /Applications/ELAN_5.4.app/Contents/Java:extensions
Display info:
Screen 1 – isDefault:true, w:1280, h:800, bitDepth:32
Main screen resolution:72 (w:1280, h:800)

May 6, 2019 10:22:10 AM mpi.eudico.client.annotator.prefs.PreferencesReader parse
INFO: Reading preferences: /Users/emilyr/Library/Preferences/ELAN/elan.pfsx
External updater thread started
Loading new Apple integration 2
May 6, 2019 10:22:11 AM mpi.eudico.client.annotator.prefs.PreferencesReader parse
WARNING: Preferences file does not exist: /Users/emilyr/Library/Preferences/ELAN/shortcuts.pfsx
May 6, 2019 10:22:11 AM mpi.eudico.client.annotator.commands.ShortcutsUtil readCurrentShortcuts
INFO: Could not load the keyboard shortcut preferences file. The file does not exist or is not valid.
[Error] 010427.c2elan.eaf:2:230: cvc-complex-type.3.2.2: Attribute ‘xsi:noNamespaceSchemaLocation’ is not allowed to appear in element ‘ANNOTATION_DOCUMENT’.
May 6, 2019 10:22:13 AM mpi.eudico.client.annotator.prefs.PreferencesReader parse
INFO: Reading preferences: /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010427.c2elan.pfsx
Consistency problems have been detected in the transcription:
Error: end time before start time. Tier: MOT Start time: 00:00:02.976 End time: 00:00:00.004
Error: end time before start time. Tier: MOT Start time: 00:14:39.236 End time: 00:00:00.199
May 6, 2019 10:22:13 AM mpi.eudico.client.annotator.ElanFrame2 checkMedia
INFO: Updated file location from: “///010427.mp4” to: “/Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010427.mp4”, in same directory as transcription file
Using Cocoa QT Media Player for file:///Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010427.mp4
mediaURL = file:///Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010427.mp4
May 6, 2019 10:22:14 AM mpi.eudico.client.annotator.commands.ExportMediaCA <init>
INFO: No version of M2-edit-cl or M2-xcode-cl found
May 6, 2019 10:22:14 AM mpi.eudico.client.annotator.commands.ClipMediaCA <init>
INFO: Found clipping script: clip-media.txt
May 6, 2019 10:22:15 AM mpi.eudico.client.annotator.tiersets.TierSetUtil readTierSetsFromFile
INFO: Could not load the tier set file. The file does not exist or is not valid.
May 6, 2019 10:22:15 AM mpi.eudico.client.annotator.util.AvailabilityDetector detectFromJar
WARNING: No plug-in cmdi metadata file found in analyzer-gloss-0.4.jar
May 6, 2019 10:22:15 AM mpi.eudico.client.annotator.util.AvailabilityDetector detectFromJar
WARNING: No plug-in cmdi metadata file found in annotyzer-lexicon-0.4-compound.jar
May 6, 2019 10:22:15 AM mpi.eudico.client.annotator.util.AvailabilityDetector detectFromJar
WARNING: No plug-in cmdi metadata file found in annotyzer-whitespace-split-0.7.jar
May 6, 2019 10:22:16 AM mpi.eudico.client.annotator.prefs.PreferencesWriter encodeAndSave
INFO: Writing preferences: /Users/emilyr/Library/Preferences/ELAN/elan.pfsx
May 6, 2019 10:22:17 AM mpi.eudico.client.annotator.update.ElanUpdateDialog checkForUpdates
INFO: URL Connection not available: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
May 6, 2019 10:22:29 AM mpi.eudico.client.annotator.prefs.PreferencesWriter encodeAndSave
INFO: Writing preferences: /Users/emilyr/Library/Preferences/ELAN/elan.pfsx
May 6, 2019 10:22:34 AM mpi.eudico.client.annotator.prefs.PreferencesWriter encodeAndSave
INFO: Writing preferences: /Users/emilyr/Library/Preferences/ELAN/elan.pfsx
[Error] 010829.c2elan.eaf:2:230: cvc-complex-type.3.2.2: Attribute ‘xsi:noNamespaceSchemaLocation’ is not allowed to appear in element ‘ANNOTATION_DOCUMENT’.
May 6, 2019 10:22:35 AM mpi.eudico.client.annotator.prefs.PreferencesReader parse
INFO: Reading preferences: /Users/emilyr/Documents/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010829.c2elan.pfsx
Consistency problems have been detected in the transcription:
Error: end time before start time. Tier: OPE Start time: 00:00:17.903 End time: 00:00:00.079
[Error] 010427.c2elan.eaf:2:230: cvc-complex-type.3.2.2: Attribute ‘xsi:noNamespaceSchemaLocation’ is not allowed to appear in element ‘ANNOTATION_DOCUMENT’.
May 6, 2019 10:22:42 AM mpi.eudico.client.annotator.prefs.PreferencesReader parse
INFO: Reading preferences: /Users/emilyrDocuments/CHILDES_corpora_and_ELAN_templates/Providence/Providence/William/010427.c2elan.pfsx
Consistency problems have been detected in the transcription:
Error: end time before start time. Tier: MOT Start time: 00:00:02.976 End time: 00:00:00.004
Error: end time before start time. Tier: MOT Start time: 00:14:39.236 End time: 00:00:00.199
[Error] 010912.c2elan.eaf:2:230: cvc-complex-type.3.2.2: Attribute ‘xsi:noNamespaceSchemaLocation’ is not allowed to appear in element ‘ANNOTATION_DOCUMENT’.
Consistency problems have been detected in the transcription:
Error: end time before start time. Tier: MOT Start time: 00:57:50.248 End time: 00:00:00.199
Error: end time before start time. Tier: GRA Start time: 00:00:05.886 End time: 00:00:00.079
Error: end time before start time. Tier: GRA Start time: 00:08:04.543 End time: 00:00:00.079
Error: end time before start time. Tier: GRA Start time: 00:41:47.555 End time: 00:00:00.199
Error: end time before start time. Tier: GRA Start time: 00:41:53.095 End time: 00:00:00.199
Error: end time before start time. Tier: OPE Start time: 00:00:14.181 End time: 00:00:00.199
May 6, 2019 10:22:55 AM mpi.eudico.client.annotator.commands.ClipMediaCommand$ReaderThread run
INFO: /Users/emilyr/Library/Preferences/ELAN/qtp_clip_10_10_export.scpt: execution error: QuickTime Player got an error: End time must be less than or equal to duration (6)
[Error] 010605.c2elan.eaf:2:230: cvc-complex-type.3.2.2: Attribute ‘xsi:noNamespaceSchemaLocation’ is not allowed to appear in element ‘ANNOTATION_DOCUMENT’.
Consistency problems have been detected in the transcription:
Error: end time before start time. Tier: MOT Start time: 00:06:15.255 End time: 00:00:00.199
Error: end time before start time. Tier: MOT Start time: 00:08:57.845 End time: 00:00:00.079
Error: end time before start time. Tier: MOT Start time: 00:46:58.906 End time: 00:00:00.199
Error: end time before start time. Tier: MOT Start time: 00:48:58.610 End time: 00:00:00.199
Error: end time before start time. Tier: MOT Start time: 00:49:42.016 End time: 00:00:00.199
Error: end time before start time. Tier: MOT Start time: 00:52:23.440 End time: 00:00:00.199
Error: end time before start time. Tier: MOT Start time: 00:54:18.821 End time: 00:00:00.199
Error: end time before start time. Tier: OPE Start time: 00:59:09.356 End time: 00:00:00.199
May 6, 2019 10:23:00 AM mpi.eudico.client.annotator.commands.ClipMediaCommand$ReaderThread run
INFO: /Users/emilyr/Library/Preferences/ELAN/qtp_clip_10_10_export.scpt: execution error: QuickTime Player got an error: End time must be less than or equal to duration (6)

As you suggest, I will look into the timing issues on problematic tiers in the ELAN log (although I don’t understand how an annotation can start after it ends!). But currently I am most concerned about the wrong videos, and too few videos, being clipped.

Thank you!

Emily

May 7, 2019 at 15:05 #12950

Han

Hi Emily,

I just tried on my High Sierra Mac (10.13.6) and I can’t get the clipping to run at all (messages like “cannot execute binary file”). So, I don’t know, it seems like the script has to be changed for every OS version.
In the comments of the script I read that the message “End time must be less than or equal to duration (6)” is generated when the number of decimals is exactly 3 (but the script tries to correct that when that is detected). But it could well be that it is generated in other situations as well, I don’t know.
Can you (reliably) clip a single segment, so directly from an open ELAN document via the File-Export As menu?

You could try to use ffmpeg for the multiple segments clipping?
I have no solution, I’m sorry.

May 7, 2019 at 23:27 #12953

Han

On my Mojave 10.14.4 system clipping works more or less as expected.
The current Create Multiple Media Clips function doesn’t deal with the (double) quotes around the file paths in the tab-delimited text file, so at the moment these have to be removed from a file exported from multiple file search. The same for the column headers in such file, but then it seems to work and QuickTime clips the video segments.

May 9, 2019 at 00:42 #12954

elsb

Hi Han,

Thanks again for these two follow-ups. I have fiddled with a few things. There were never quotes in the file path, but I added them as an experiment and then the script can’t find the file at all. So, as you say, there cannot be any quotes in the file path. I also changed the decimal places– I think I’ve tried all up to 4 now, and the result is the same every time. I actually don’t think decimals are the problem (see below). I can clip a single segment (.eaf and accompanying media, using the script) and have never had a problem with this.

However, I’ve narrowed down the problem further, so this might provide some insight. I realized that the correct times *are* being clipped, but they are being clipped from the wrong .eaf (located in the same folder). For example, the clip labeled 010912_172111_202111.mp4 is actually a clip (from the correct timepoint, 172.111) from a different .eaf file in the same folder: 010605.c2elan.eaf. And the clip labeled 010427_418611_448611.mp4 is a clip from that timepoint (again the correct one, 418.611) in a different .eaf file in the same folder: 010829.c2elan.eaf. Finally, I opened only one video to begin with (010427.mp4), because this would ensure that only that video could get clipped. As predicted, 010427 was the only video that got clipped, but the resulting clip is labelled 010829_990111_1020111.mp4– again the script cuts the right time (the one associated with 010829.c2elan.eaf) from the wrong video.

I will explore clipping the videos in other programs and other operating systems but I felt this last discovery might be informative. It’s as if the .eaf is invisibly linked to the wrong .mp4…

-Emily

May 9, 2019 at 13:52 #12955

Han

Hi Emily,

I don’t understand much of this all, especially since in the report you posted earlier it says “clipping n segments from abc.mp4” followed by “processing of abc.eaf done”.

Two things that I can imagine:
– that either the tab-delimited text rows (or lines) got mixed up such that the segments’ begin and end time are on the row of wrong eaf file
– that opening the video files in QuickTime Player causes the mixing up. In principle the clipping should work without first opening the video.
I’m not sure if this is what you did in all attempts, or just once for testing, but I’m wondering whether that could cause the mix up. I believe the clipping is always performed on the window in focus, the active window (in the AppleScript just identified as “document 1”). This could also explain the last use case you mention?

May 16, 2019 at 21:47 #12959

elsb

Hi Han,

I’ve solved the problem. Thank you again for your help in finding the solution!

Here is what I needed to do:

To use the ‘create multiple media clips’ function in my version of ELAN (5.4) on my Mac (OSX), a tab-delimited.txt file must have the format: Column 1 (start time in ss.msec); Column 2 (end time in ss.msec); Column 3 (complete file path to the .eaf file, with no spaces in the file path and no quotes).

Notes on the .txt file setup: Duration seems to be an optional 3rd column (in which case file path is 4th). For me, the function seems to work regardless of the number of decimals for start and end times, but there must be at least one decimal. So, if your start or end time is 42s, it should read 42.0s in the text file, or something like 42.001s if the .0 is causing problems.

Media files and .eafs must be in the same folder, and, in my experience these other two conditions must be met: 1) The two files must have been opened together and saved in ELAN (then closed) prior to clipping and 2) No ELAN files or Quicktime files should be open when running the script. I just have to open a blank ELAN file and run the script from there.

By doing all these things, the function is working perfectly. Thanks again for your help!

Emily

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.