擷取視訊資料

本主題顯示使用 HTTP GET 方法的各種範例要求。

簡介

在本主題中,您將學習如何使用來檢索有關您的Video Cloud視頻的各種信息。CMS API要求。要創建這些請求,請將本文檔中列出的端點附加到帶有您的帳戶ID的基本URL中。

    https://cms.api.brightcove.com/v1/accounts/{account_id}/{endpoint}
    
    

要求CMS API需要包含您的訪問令牌的授權標頭。如需有關如何取得用戶端認證並使用它們來擷取存取權杖的詳細資訊,請參閱 Brightcove OAuth 概觀

獲取視頻

檢索視頻雲帳戶中所有視頻的數據。

端點:/videos

請求

    https://cms.api.brightcove.com/v1/accounts/1507807800001/videos
    
    

響應

[
  {
    "id" : "2114345471001",
    "account_id" : "1507807800001",
    "complete" : true,
    "created_at" : "2013-01-23T19:06:16.328Z",
    "cue_points" : [ {
    "name" : "Flying Off",
    "type" : "CODE",
    "time" : 2.64,
    "metadata" : null,
    "force_stop" : false,
    "asset_id" : null
    }, {
    "name" : "Pre-roll",
    "type" : "AD",
    "time" : 0.0,
    "metadata" : null,
    "force_stop" : false,
    "asset_id" : null
    }, {
    "name" : "Bird Back",
    "type" : "CODE",
    "time" : 5.938,
    "metadata" : null,
    "force_stop" : false,
    "asset_id" : null
    }, {
    "name" : "Post-roll",
    "type" : "AD",
    "time" : 8.242,
    "metadata" : null,
    "force_stop" : false,
    "asset_id" : null
    } ],
    "custom_fields" : {
    "customfield1" : "Approved",
"customfield2" : "Verified"
  }, ...
]

獲取視頻

檢索特定視頻或ID多個視頻的數據

端點:/videos/{video_id}[,{video2_id},{video3_id}]

請求

    https://cms.api.brightcove.com/v1/accounts/1507807800001/videos/2114345471001
    
    

響應

    {
    "id" : "2114345471001",
    "account_id" : "1507807800001",
    "complete" : true,
    "created_at" : "2013-01-23T19:06:16.328Z",
    "cue_points" : [ {
    "name" : "Flying Off",
    "type" : "CODE",
    "time" : 2.64,
    "metadata" : null,
    "force_stop" : false,
    "asset_id" : null
    }, {
    "name" : "Pre-roll",
    "type" : "AD",
    "time" : 0.0,
    "metadata" : null,
    "force_stop" : false,
    "asset_id" : null
    }, {
    "name" : "Bird Back",
    "type" : "CODE",
    "time" : 5.938,
    "metadata" : null,
    "force_stop" : false,
    "asset_id" : null
    }, ...
    
    

獲取來源

檢索特定視頻的來源。

端點:/videos/{video_id}/sources

請求

    https://cms.api.brightcove.com/v1/accounts/1507807800001/videos/2114345471001/sources
    
    

響應

    [
    {
    "asset_id": "5164827527001",
    "remote": false,
    "src": "https://brightcove.vo.llnwd.net/e2/hls/57838016001/57838016001_5164827527001_5164799982001.m3u8?pubId=57838016001&videoId=5164799982001",
    "type": "application/vnd.apple.mpegurl"
    },
    {
    "asset_id": "5164827527001",
    "remote": false,
    "src": "https://brightcove.hs.llnwd.net/e2/hls/57838016001/57838016001_5164827527001_5164799982001.m3u8?pubId=57838016001&videoId=5164799982001",
    "type": "application/vnd.apple.mpegurl"
    }, ...
    ]
    
    

獲取圖像

檢索特定視頻的圖像。

端點:/videos/{video_id}/images

請求

    https://cms.api.brightcove.com/v1/accounts/1507807800001/videos/2114345471001/images
    
    

響應

    {
    "thumbnail" : {
    "id" : "3815806023001",
    "src" : "https://brightcove.vo.llnwd.net/v1/unsecured/media/1507807800001/201410/2431/1507807800001_3815806023001_thumb.jpg?pubId=1507807800001"
    },
    "poster" : {
    "id" : "3815782921001",
    "src" : "https://brightcove.vo.llnwd.net/v1/unsecured/media/1507807800001/201410/273/1507807800001_3815782921001_still.jpg?pubId=1507807800001"
    }
    }
    
    

通過refid獲取視頻

使用參考ID檢索特定視頻的數據。

端點:/videos/ref:{video_reference_id}

請求

    https://cms.api.brightcove.com/v1/accounts/1507807800001/videos/ref:titmouse_title_refid7
    
    

響應

    {
    "id" : "2114345471001",
    "account_id" : "1507807800001",
    "complete" : true,
    "created_at" : "2013-01-23T19:06:16.328Z",
    "cue_points" : [ {
    "name" : "Flying Off",
    "type" : "CODE",
    "time" : 2.64,
    "metadata" : null,
    "force_stop" : false,
    "asset_id" : null
    }, ...
    
    

通過引用獲取來源

使用參考ID檢索特定視頻的來源。

端點:/videos/ref:{video_reference_id}/sources

請求

    https://cms.api.brightcove.com/v1/accounts/1507807800001/videos/ref:titmouse_title_refid7/sources
    
    

響應

    [
    {
    "asset_id": "5192219618001",
    "remote": false,
    "src": "https://brightcove.vo.llnwd.net/v1/uds/pd/57838016001/201611/3753/57838016001_5192219618001_5192207668001.mp4?pubId=57838016001&videoId=5192207668001",
    "codec": "H264",
    "container": "MP4",
    "encoding_rate": 1823000,
    "duration": 41237,
    "height": 540,
    "width": 960,
    "size": 9417086,
    "uploaded_at": "2016-11-01T09:37:37.336Z"
    },
    {
    "asset_id": "5192219618001",
    "remote": false,
    "src": "https://brightcove.hs.llnwd.net/v1/uds/pd/57838016001/201611/3753/57838016001_5192219618001_5192207668001.mp4?pubId=57838016001&videoId=5192207668001",
    "codec": "H264",
    "container": "MP4",
    "encoding_rate": 1823000,
    "duration": 41237,
    "height": 540,
    "width": 960,
    "size": 9417086,
    "uploaded_at": "2016-11-01T09:37:37.336Z"
    }, ...
    ]
    
    

通過refid獲取圖像

使用參考ID檢索特定視頻的圖像。

端點:/videos/ref:{video_reference_id}/images

請求

    https://cms.api.brightcove.com/v1/accounts/1507807800001/videos/ref:titmouse_title_refid7/images
    
    

響應

    {
    "thumbnail" : {
    "id" : "3815806023001",
    "src" : "https://brightcove.vo.llnwd.net/v1/unsecured/media/1507807800001/201410/2431/1507807800001_3815806023001_thumb.jpg?pubId=1507807800001"
    },
    "poster" : {
    "id" : "3815782921001",
    "src" : "https://brightcove.vo.llnwd.net/v1/unsecured/media/1507807800001/201410/273/1507807800001_3815782921001_still.jpg?pubId=1507807800001"
    }
    }