source: README.markdown @ 4698

Last change on this file since 4698 was 4698, checked in by Sander.Maijers@mpi.nl, 10 years ago

Horizontal showcase WebMAUS:
media_conv component

Documentation: https://trac.clarin.eu/media_conv

As deployed on: http://infra.clarin.eu/app/media_conv

File size: 2.3 KB
Line 
1# media_conv
2A Pyramid web service that converts audio data from WAV to M4A.
3
4## Dependencies
5* Python version 3.3+ with libraries:
6    * pyramid
7    * pyramid_debugtoolbar
8    * waitress
9
10## Usage
11The web service has one entry point `media_conv` that responds to HTTP `GET` and `POST` requests.
12
13###`media_conv`
14
15#### Parameters
161.  `input_mime_type`: MIME type of input media data at `input_media_url`.
172.  `jwplayer_file_url_hack`: whether to apply a hack to let JWplayer use media_conv successfully. `jwplayer_file_url_hack` can be `0` (enable) or `1` (disable).
183.  `input_media_url`: HTTP URL where the input media data can be retrieved from.
19
20#### Response
21A HTTP response with the audio data received after issuing a HTTP `GET` request based on the URL `input_media_url`.
22
23#### Notes
24The version of JW Player used by Annex requires a hack to accept a global identifier URI wherein media_conv is called to return `audio/mp4` audio.
25
261.   The HTTP request method is `GET`.
272.   `jwplayer_file_url_hack=1`.
283.   `input_media_url`... parameter and value combination has (fictional, extra) suffix of `.m4a`.
294.   The call URI ends with the `input_media_url` parameter and value combination and therefore ends with the `.m4a` string.
305.   The file `crossdomain.xml` to allow Flash cross-domain scripting is at the document root of the web site where the, if Annex runs from a different FQDN.
31
32#### Example usages (on Unix, with `curl`)
33Advised usage:
34
35    curl -v -X POST \
36        'http://infra.clarin.eu/app/media_conv?input_mime_type=audio/x-wav&jwplayer_file_url_hack=0&output_mime_type=audio/mp4&input_media_url=http://infra.clarin.eu/tmp/maus-pipeline/g001acn1_000_AAJ_1.wav' \
37        > /tmp/g001acn1_000_AAJ_1.m4a ;
38
39As used by Annex/JW Player, and on the server where the web application runs (localhost):
40
41    curl -v -X GET \
42        'http://127.0.0.1:6543/media_conv?input_mime_type=audio/x-wav&jwplayer_file_url_hack=1&output_mime_type=audio/mp4&input_media_url=http://infra.clarin.eu/tmp/maus-pipeline/g001acn1_000_AAJ_1.wav.m4a' \
43        > /tmp/g001acn1_000_AAJ_1.m4a ;
44
45## Future work
46
47=== Goals ===
481.   Make more robust: currently the conversion process creates a temporary file for each request that isn't being cleaned up. Move to a performant and stable database/key-value store.
492.   Handle more types of media.
Note: See TracBrowser for help on using the repository browser.