Video registration¶
This API registers a video to API server.After the video registration, tile creation process starts automatically. さらに特定のパラメータを追加することで、自動タグ付けやnsfw(not safe for work)に 該当する動画の確率を返すことが可能になります。また、動画中から音声(日本語のみ)を取得 及び解析し、文字列を返すことも可能です。
POST /api/1/videos
Note
About media activation:Media status will not be active after running this API yet. You need to activate the media to render it as fv. Please performs media activation API after tile creation is finished. [Appendix] 音声認識パラメータを付けて動画登録した場合は、動画から音声が抽出・解析が行われ、その中で名詞をデータベースに登録します。 登録された音声タグは[音声タグ取得API]により取得することが出来ます。
Parameters¶
output_type
- Response Type
- x: Output in XML format
- blank: Output in JSON format
- Response Type
upfile [required]
- Upload file is Up to 200MB
tile_type [required]
- Tile Type. you can specify only one type.
- hd 16:9 / sd 4:3 / r 3:2 / s 1:1
duration
- Duration of the tile for creation (1-900 seconds)Please specify the time duration within the registration video’s time duration.The duration will be the time duration of posting video automatically if you specify a value of time duration which exceeds it.[Appendix]
levels
- This parameter specifies the level of the tile to be created. Multiple input is available by inserting comma. if this part is not specified, it creates level1 tiles only.Level 1 tiles are automatically created in the video registration process.ex)If level = 2 is specified: tile level 1 and 2 are created.If level = 3,4 is specified: tile level of 1, 3, and 4 are created.
tile_qualitys
- This parameter specifies the quality of the tile to be created. Multiple input is available by inserting comma. If this parameter is not specified, it returns error.ex)If tile_qualitys=2 is specified, tile with quality=2 is created.If tile_qualitys=1,2,3 are specified, tile with quality=1,2,3 is created.
audio_recog [オプション][本機能を利用するためには,別途お問い合わせ下さい.]
- 登録された動画から音声情報を抽出・解析し、AudioTagとして登録するパラメータです。指定する場合は、”audio_recog=1”を指定して下さい。(但し本パラメータを指定すると動画登録プロセス処理速度が数秒遅くなります。)
autotag [オプション][本機能を利用するためには,別途お問い合わせ下さい.]
- 登録された動画に対して画像・動画解析を行い、自動タグ付けを行うパラメータです。指定する場合は”autotag=1”を指定して下さい。(但し本パラメータを指定すると動画登録プロセス処理速度が数秒遅くなります。)
nsfw [オプション][本機能を利用するためには,別途お問い合わせ下さい.]
- 登録された動画に対して画像・動画解析を行い、該当メディアがNot-Safe-For-Workである確率(百分率)の計算を行うパラメータです。指定する場合は”nsfw=1”を指定して下さい。(但し本パラメータを指定すると動画登録プロセス処理速度が数秒遅くなります。)
thumbnail_position
- you can specify up to 10 thumbnail positions (which is needed to specify by frame) you want to make thumbnail image.Specifies the frame based on the frame rate of the API Reference video registration.Default thumbnail image (0 frame) is generated even if any frame are specified.ex)thumbnail_position = 5 ->Two thumbnails are generated (0 and 5 frames of the video).
crop_position
- When input video resolution is larger than output one, this parameter is required.1 : Center2 : Top-left3 : Top-right4 : Bottom-left5 : Bottom-right
padding_position
- When input video resolution is smaller than output one, this parameter is required.1 : Center2 : Top-left3 : Top-right4 : Bottom-left5 : Bottom-right
crop_inheriting
- The cropping / padding policy between multiple levels.0 (On) : Applying for same cropping / padding area1 (Off) : Optimizing cropping area each levels.
crop_policy_ob
- The policy for cropping / padding when output resolution is bigger than input one0 : [Cover] The resizing process with keeping aspect ratio.1 : [Contain] The resizing process with keeping aspect ratio.2 : [Fill] The resizing process without keeping aspect ratio.3 : [Dot by dot] The easy padding
crop_policy_ib
- The policy for cropping / padding when input resolution is bigger than output one.0 : [Cover] The resizing process with keeping aspect ratio.1 : [Contain] The resizing process with keeping aspect ratio.2 : [Fill] The resizing process without keeping aspect ratio.3 : [Dot by dot] The easy cropping
Sample Curl Command¶
- Basic認証を使用した方法
curl --basic -u {your account}:{your password} \
"https://example.com/api/1/videos?tile_type=hd&duration=10&levels=1,2&tile_qualitys=2&autotag=1&nsfw=1&audio_recog=1" \
-X POST -F "upfile=@{upload_file_path}"
- AccessToken認証を使用した方法
curl "https://example.com/api/1/videos?tile_type=hd&duration=10&levels=1,2&tile_qualitys=2&autotag=1&nsfw=1&audio_recog=1" \
-H "Authorization: Bearer {your access_token}" \
-X POST -F "upfile=@{upload_file_path}"
Response¶
status
- Result of Processsuccess: sucessother: failure
media_id
- Media ID registered
autotags
- 動画登録オプションにより”autotag=1”が指定された場合に、本パラメータが返却されます。配列であり,自動メディア解析及び付与されたタグが挿入されています。タグの数はメディアに応じて変わります。
nsfw
- 動画登録オプションにより”nsfw=1”が指定された場合に、本パラメータが返却されます。該当メディアがNot-Safe-For-Workである確率を百分率で返します。
audio_recognition
- 動画登録オプションにより”audio_recog=1”が指定され、かつ正常に分析が成功した場合に、本パラメータが返却されます。該当メディアからの音声を抽出し、その解析結果を文字列として返却致します。
Response Example - JSON¶
{
"media_id":474,
"status":"success",
"autotags":["technology","screen"],
"nsfw":"0.0019919699989259",
"audio_recognition":["愛する奥さんへ","いつも朝早く起きておにぎりを握ってくれていつもありがとうあなたのおにぎりのおかげでいつも仕事頑張りますこれからも美味しいおにぎりを握ってくれくださいいつもありがとう"]
}
Response Example - XML¶
<?xml version="1.0" encoding="UTF-8"?>
<response>
<media_id>475</media_id>
<status>success</status>
<autotags>
<entry>technology</entry>
<entry>screen</entry>
</autotags>
<nsfw>0.0019919699989259</nsfw>