|
| 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> |
0 commit comments