Characterise_Audio_using_FFprobe
Created: 2014-09-26 10:56:38
Last updated: 2014-09-26 11:02:40
The workflow takes an inputfilepath as input parameter. It relies on FFprobe being installed locally, when it is run. It has been tested with ffprobe version 0.10.3. It outputs bitrate, bitsPerSample, channels, duration and audio sampling frequency (hz) as well as an activity report (raw FFprobe STDOUT+STDERR).
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Bolette A. Jurik, Statsbiblioteket / SCAPE |
Titles (1)
Characterise Audio using FFprobe |
Descriptions (1)
The workflow takes an inputfilepath as input parameter. It relies on FFprobe being installed locally, when it is run. It has been tested with ffprobe version 0.10.3. It outputs bitrate, bitsPerSample, channels, duration and audio sampling frequency (hz) as well as an activity report (raw FFprobe STDOUT+STDERR). |
Dependencies (0)
Inputs (1)
Name |
Description |
inputfilepath |
|
Processors (2)
Name |
Type |
Description |
FFprobeCLI |
externaltool |
|
ExtractFromFFprobe |
beanshell |
Scriptif (ffprobe_output!=null && ffprobe_output.length()>0) {
int blockBegin = ffprobe_output.indexOf(" Duration: ")+" Duration: ".length();
block = ffprobe_output.substring(blockBegin);
//getDuration
durationStringEnd = block.indexOf(",");
durationString = block.substring(0,durationStringEnd).trim();
//Parse this to something
String[] durationStringArray = durationString.split(":");
duration = Double.parseDouble(durationStringArray[0])*60*60 +
Double.parseDouble(durationStringArray[1])*60 +
Double.parseDouble(durationStringArray[2]);
//getHz
audioBeginIndex = block.indexOf("Audio: ");
hzBeginIndex = block.indexOf(", ",audioBeginIndex)+2;
hzEndIndex = block.indexOf(",",hzBeginIndex)-3;
hz = block.substring(hzBeginIndex,hzEndIndex).trim();
//getChannels
channelsBeginIndex = block.indexOf(" ",hzEndIndex+2);
channelsEndIndex = block.indexOf(" ",channelsBeginIndex+1);
channelsString = block.substring(channelsBeginIndex,channelsEndIndex).trim();
channels = channelsString;
//getBitsPerSample
sBeginIndex = block.indexOf(" s",channelsEndIndex)+2;
sEndIndex = block.indexOf(",",sBeginIndex+1);
s = block.substring(sBeginIndex,sEndIndex);
bitsPerSample = s;
//bitrate
bitrateIndexBegin = sEndIndex+1;
bitrateIndexEnd = block.indexOf(" ",bitrateIndexBegin+1);
bitrateString = block.substring(bitrateIndexBegin,bitrateIndexEnd).trim();
bitrate = bitrateString;
}
|
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
ExtractFromFFprobe |
|
ffprobe_output
|
duration
hz
channels
bitsPerSample
bitrate
|
Outputs (6)
Name |
Description |
activityReport |
The full activity report from FFprobe.
|
bitrate |
audio bitrate: The bitrate of an audio stream measured in kbit/sec
|
bitsPerSample |
audio bits per sample: The number of bits per sample
|
channels |
Number of audio channels in an audio file
|
duration |
audio duration: The length of the audio file in seconds.
|
hz |
audio sampling frequency: Number of samples per second measured in Hertz (Hz)
|
Datalinks (8)
Source |
Sink |
inputfilepath |
FFprobeCLI:inputfile |
FFprobeCLI:STDOUT |
ExtractFromFFprobe:ffprobe_output |
FFprobeCLI:STDOUT |
activityReport |
ExtractFromFFprobe:bitrate |
bitrate |
ExtractFromFFprobe:bitsPerSample |
bitsPerSample |
ExtractFromFFprobe:channels |
channels |
ExtractFromFFprobe:duration |
duration |
ExtractFromFFprobe:hz |
hz |
Uploader
Component Validity
Loading
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (0)
(People/Groups)
None
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (1)
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment