API Documentation Job

URL: http://heywatch.com/job

Actions

Example response in XML: http://heywatch.com/job.xml [GET]

<jobs>
  <job>
    <id>1069525</id>
    <created-at>Fri Nov 06 10:55:59 +0100 2009</created-at>
    <updated-at>Fri Nov 06 10:55:59 +0100 2009</updated-at>
    <status>working</status>
    <progress>55</progress>
    <format-id>1086</format-id>
    <video-id>2052566</video-id>
    <encoded-video-id>0</encoded-video-id>
    <error-msg></error-msg>
    <ftp-directive></ftp-directive>
    <s3-directive></s3-directive>
    <http-upload-directive></http-upload-directive>
    <ping-url-after-encode></ping-url-after-encode>
    <ping-url-if-error></ping-url-if-error>
    <encoding-options>
    </encoding-options>
    <error-code></error-code>
  </job>
</jobs>

Valid parameters for POST

  • format_id : Format ID to use, if you set your default format and want to use it, use default_format=true
  • video_id : raw video ID to convert

Optional parameters

  • ftp_directive : upload the new encoded video to the FTP. Override the global option FTP. Must be: ftp://login:password@host:port/path
  • s3_directive : upload the new encoded video to your S3 account. Must be: s3://access_key:secret_key@bucket/object_key. Note that object_key is optional. This parameter will override the global option.
  • http_upload_directive : Upload the new encoded video to the specified HTTP address (multipart form POST). The parameter name containing the file object is “encoded_video”. You also receive the encoded_video_id, video_id, job_id and custom fields if any. Override the global option.
  • ping_url_after_encode : Ping the specified URL after the encode. Override the global option
  • ping_url_if_error : Ping the specified URL if the job failed. Override the global option

Note that custom fields don’t work here. To have them, you need to customize the ping urls like http://myhost.com/heywatch/ping/success?myid=1546

Encoding options

  • keep_video_size : if “true”, will not resize the video (ignore width and height values of the selected format)
  • keep_fps : if “true”, will keep the original FPS (ignore FPS value of the selected format)
  • keep_quality : if “true”, keep the video/audio bitrates, size, FPS, sample rate and channels
  • keep_sample_rate : if “true”, keep the original sample rate
  • keep_channels : if “true”, keep the original audio channels.
  • deinterlace : if “true”, will deinterlace the video
  • watermark_image_url : this is the URL of the image, must be png. The image will be incrusted in the video at the position you want like a logo you can see on TV. Note that transparent and semi-transparent images are compatible.
  • watermark_position : can be “topleft”, “topright”, “bottomleft” or “bottomright”, default is “topleft”
  • x264_options : See the X264 Options section below. Only for h264 video codec

X264 Options

Warning: Don’t use this option if you don’t know what you’re doing. The default parameter we use should be fine.

The X264 options form must be:

param1:value1,param2:value2,...

The values for the parameters flags, flags2 and partitions can be cumulated.

Eg. partitions:+partp8x8+partp4x4+partb8x8+parti8x8+parti4x4

Note we’re using the ffmpeg parameter names, not those from the x264 encoder. You can find on this site a complete description for all the parameters and the x264 -> ffmpeg parameters mapping: http://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping

Here are the available x264 parameters:

Parameter type Values
g integer
keyint_min integer
sc_threashold integer
bf integer 0 to 16
b_strategy integer 0, 1, 2
bframebias integer 0
flags2 string +bpyramid, +wpred, +mixed_refs, +dct8×8, -bpyramid, -wpred, -mixed_refs, -dct8×8
coder integer 0, 1
refs integer 0 to 16
flags string -loop, -fastskip, +loop, +fastskip
deblockalpha integer
deblockbeta integer
cqp integer
crf float
qdiff integer
i_qfactor float
b_qfactor float
chromaoffset integer
qcomp float
complexityblur float
qblur float
partitions string +partp8×8, +partp4×4, +partb8×8, +parti8×8, +parti4×4, -partp8×8, -partp4×4, -partb8×8, -parti8×8, -parti4×4
directpred integer
me_method string epzs, hex, umh, full
me_range integer
subq integer 1 to 9
trellis integer 0, 1, 2
level integer 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51
cmp string +chroma, -chroma

To learn more about these parameters and their effects:

To find the right H264 encoding parameters for your needs, you can find some ffmpeg presets in X264 presets.


Powered by JunebugWiki v0.0.18 Last edited by bruno on November 06, 2009 10:39 AM (diff)
Version 23 (current) «olderversions