Skip to content

Commit 293dc13

Browse files
authored
Merge pull request #1610 from bgruening/a_v_conversion
add ffmpeg tool for audio / video conversion
2 parents 78581c8 + 5eb22d5 commit 293dc13

11 files changed

+113
-0
lines changed

tools/ffmpeg/.shed.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: ffmpeg
2+
owner: bgruening
3+
description: A complete, cross-platform solution to record, convert and stream audio and video.
4+
long_description: |
5+
A complete, cross-platform solution to record, convert and stream audio and video.
6+
type: unrestricted
7+
categories:
8+
- Convert Formats
9+
remote_repository_url: https://github.com/bgruening/galaxytools/tree/master/tools/ffmpeg
10+
homepage_url: https://ffmpeg.org
11+
auto_tool_repositories:
12+
name_template: "{{ tool_id }}"
13+
description_template: "Wrapper for the ffmpeg suite tool: {{ tool_name }}"
14+
suite:
15+
name: "suite_ffmpeg"
16+
description: A complete, cross-platform solution to record, convert and stream audio and video.
17+
long_description: A complete, cross-platform solution to record, convert and stream audio and video.

tools/ffmpeg/ffmpeg_converter.xml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<tool id="ffmpeg_converter" name="FFmpeg Format Converter" version="0.1.0" profile="24.2">
2+
<description>Convert between video and audio formats</description>
3+
<requirements>
4+
<requirement type="package" version="7.1.1">ffmpeg</requirement>
5+
</requirements>
6+
<command detect_errors="exit_code">
7+
<![CDATA[
8+
ffmpeg -i '$input_file' output.${output_format} &&
9+
mv output.${output_format} '$output_file'
10+
]]>
11+
</command>
12+
<inputs>
13+
<param name="input_file" type="data" format="mp4,mov,avi,mkv,mp3,wav,flac,ogg" label="Input media file"/>
14+
<param name="output_format" type="select" label="Output format">
15+
<option value="mp4">MP4 (video)</option>
16+
<option value="mkv">MKV (video)</option>
17+
<option value="avi">AVI (video)</option>
18+
<option value="mov">MOV (video)</option>
19+
<option value="mp3">MP3 (audio)</option>
20+
<option value="wav">WAV (audio)</option>
21+
<option value="flac">FLAC (audio)</option>
22+
<option value="ogg">OGG (audio)</option>
23+
</param>
24+
</inputs>
25+
<outputs>
26+
<data name="output_file" format="ogg" from_work_dir="output.@output_format@" label="Converted file (${output_format})">
27+
<change_format>
28+
<when input="output_format" value="mp4" format="mp4"/>
29+
<when input="output_format" value="mkv" format="mkv"/>
30+
<when input="output_format" value="avi" format="avi"/>
31+
<when input="output_format" value="mov" format="mov"/>
32+
<when input="output_format" value="mp3" format="mp3"/>
33+
<when input="output_format" value="wav" format="wav"/>
34+
<when input="output_format" value="flac" format="flac"/>
35+
</change_format>
36+
</data>
37+
</outputs>
38+
<tests>
39+
<test expect_num_outputs="1">
40+
<param name="input_file" value="SampleVideo_360x240_cut.mp4" ftype="mp4"/>
41+
<param name="output_format" value="webm"/>
42+
<output name="output_file" file="SampleVideo_360x240_cut.webm" ftype="webm"/>
43+
</test>
44+
<test expect_num_outputs="1">
45+
<param name="input_file" value="SampleVideo_360x240_cut.mp4" ftype="mp4"/>
46+
<param name="output_format" value="flac"/>
47+
<output name="output_file" file="SampleVideo_360x240_cut.flac" ftype="flac"/>
48+
</test>
49+
<test expect_num_outputs="1">
50+
<param name="input_file" value="SampleVideo_360x240_cut.mp4" ftype="mp4"/>
51+
<param name="output_format" value="mp3"/>
52+
<output name="output_file" file="SampleVideo_360x240_cut.mp3" ftype="mp3"/>
53+
</test>
54+
<test expect_num_outputs="1">
55+
<param name="input_file" value="SampleVideo_360x240_cut.flac" ftype="flac"/>
56+
<param name="output_format" value="ogg"/>
57+
<output name="output_file" file="flac_to_ogg.ogg" ftype="ogg"/>
58+
</test>
59+
<test expect_num_outputs="1">
60+
<param name="input_file" value="SampleVideo_360x240_cut.mp4" ftype="mp4"/>
61+
<param name="output_format" value="mkv"/>
62+
<output name="output_file" file="SampleVideo_360x240_cut.webm" ftype="mkv"/>
63+
</test>
64+
</tests>
65+
<help>
66+
This tool uses FFmpeg to convert between common video and audio file formats.
67+
68+
Input formats:
69+
- Video: MP4, MOV, AVI, MKV
70+
- Audio: MP3, WAV, FLAC, AAC, OGG
71+
72+
Select the output format you want, and FFmpeg will handle the conversion.
73+
</help>
74+
<citations>
75+
<citation type="bibtex">
76+
@article{tomar2006converting,
77+
title={Converting video formats with FFmpeg},
78+
author={Tomar, Suramya},
79+
journal={Linux Journal},
80+
volume={2006},
81+
number={146},
82+
pages={10},
83+
year={2006},
84+
publisher={Belltown Media}
85+
}
86+
</citation>
87+
</citations>
88+
</tool>

tools/ffmpeg/test-data/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SampleVideo_360x240_1mb.mp4
616 KB
Binary file not shown.
105 KB
Binary file not shown.
32.2 KB
Binary file not shown.
375 KB
Binary file not shown.
98.1 KB
Binary file not shown.
215 KB
Binary file not shown.
65.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)