The Format resource defines the complete encoding profile. You must give its ID for each job you create. You can use the GUI to create a new format here.
GET /format.(xml|json)
With the cURL command:
curl -u username:passwd https://heywatch.com/format.json
[
{
"name": "Flash Video H264",
"sample_rate": 44100,
"category": "formats",
"audio_channels": 2,
"container": "mp4",
"video_bitrate": 800.0,
"audio_bitrate": 96.0,
"id": 1086,
"audio_codec": "aac",
"height": 240,
"two_pass": false,
"video_codec": "h264",
"fps": 25.0,
"width": 320,
"owner": false
},
{
"name": "MP4 - 3000kbps - 2pass",
"sample_rate": 0,
"category": "formats",
"audio_channels": 0,
"container": "mp4",
"video_bitrate": 3000.0,
"audio_bitrate": 64.0,
"id": 1975,
"audio_codec": "",
"height": 240,
"two_pass": true,
"video_codec": "mpeg4",
"fps": 23.98,
"width": 320,
"owner": true
}
]
GET /format/ID.(xml|json)
With the cURL command:
curl -u username:passwd https://heywatch.com/format/1086.json
{
"name": "Flash Video H264",
"sample_rate": 44100,
"category": "formats",
"audio_channels": 2,
"container": "mp4",
"video_bitrate": 800.0,
"audio_bitrate": 96.0,
"id": 1086,
"audio_codec": "aac",
"height": 240,
"two_pass": false,
"video_codec": "h264",
"fps": 25.0,
"width": 320,
"owner": false
}
POST /format.(xml|json)
With the cURL command:
curl -u username:passwd -X POST \
-d "category=devices" \
-d "name=iPad" \
-d "container=mp4" \
-d "video_codec=h264" \
-d "video_bitrate=1500" \
-d "fps=30" \
-d "width=1280" \
-d "height=720" \
-d "audio_channels=2" \
-d "audio_codec=aac" \
-d "audio_bitrate=128" \
-d "sample_rate=44000" \
-d "two_pass=false" \
https://heywatch.com/format.json
{
"name": "iPad",
"sample_rate": 44000,
"category": "devices",
"audio_channels": 2,
"container": "mp4",
"video_bitrate": 1500.0,
"audio_bitrate": 128.0,
"id": 7147,
"audio_codec": "aac",
"height": 720,
"two_pass": false,
"video_codec": "h264",
"fps": 30.0,
"width": 1280,
"owner": true
}
PUT /format.(xml|json)
Same as POST parameters.
With the cURL command:
curl -i -u username:passwd -X PUT \
-d "name=iPad 720p" \
https://heywatch.com/format/7147.json
HTTP/1.1 204 No Content
Server: nginx/0.5.32
Date: Wed, 08 Jun 2011 12:48:58 GMT
Connection: close
Status: 204
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.0
X-UA-Compatible: IE=Edge,chrome=1
X-Runtime: 0.018841
Set-Cookie: _session_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxx; path=/; expires=Fri, 10-Jun-2011 13:28:48 GMT
Cache-Control: no-cache
DELETE /format/ID.(json|xml)
You can only delete the formats you’ve created (owner=true).
curl -i -u username:passwd -X DELETE "http://heywatch.com/format/1975.json"
HTTP/1.1 204 No Content
Server: nginx/0.5.32
Date: Thu, 10 Feb 2011 11:10:46 GMT
Connection: close
Status: 204
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.0
X-UA-Compatible: IE=Edge,chrome=1
X-Runtime: 0.015292
Set-Cookie: _session_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; path=/; expires=Sat, 12-Feb-2011 11:31:11 GMT
Cache-Control: no-cache
Service made by Particles
Follow @particles