MediaInfo-API Interface
Last Updated:2020-09-21
Query the Assigned Media Information
Interface description
The user can access the media information of assigned video and audio files through the URL Encoded results of BOS Bucket+Key.
Request
-
Request syntax:
GET /v{version}/mediainfo?bucket={BOS Bucket}&key={uriComponentEncode(BOS Key)} HTTP/1.1 accept-encoding: gzip, deflate x-bce-date: {utc-date-string} host: media.bj.baidubce.com accept: */* connection: keep-alive x-bce-request-id: {bce-request-id} content-type: application/json authorization: {bce-authorization-string}
- Request header: No special Header parameter
- Request parameter: None
-
Request example:
GET /v3/mediainfo?bucket=samplebucket&key=sampleforderpath%2Fsampleoutput.mp4 HTTP/1.1 accept-encoding: gzip, deflate x-bce-date: 2015-03-24T13:37:10Z host: media.bj.baidubce.com accept: */* connection: keep-alive x-bce-request-id: 3807ce30-5264-45f2-9b52-26b78e24a750 content-type: application/json authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2015-03-24T13:37:10Z/1800/host;x-bce-date/3e1bf9f50ae1fca2d704d61567810dde946fff3ca2e455676455a6f5c8cce596
Response
- Response header: No special Header parameter
- Response parameter:
Field name | Field type | Field description |
---|---|---|
bucket | String | Bucket of BOS where the audio and video files are located |
key | String | BOS key of audio and video files |
fileSizeInByte | Number | Size of audio and video files |
durationInSecond | Number | AV media duration |
container | String | Container type of the audio and video files |
etag | String | MD5 value of audio and video files |
type | String | File type |
video | Object | Collection of video information |
+ codec | String | Encoding specification of video files |
+ heightInPixel | Number | Video height |
+ widthInPixel | Number | Video width |
+ bitRateInBps | Number | Video media code stream |
+ frameRate | Number | Frame rate of video media |
+ rotate | Number | Rotation angle (some videos contain that parameter) |
+ dar | String | Width-height proportion of video display, such as “16:9” (some videos contain that parameter) |
audio | Object | Collection of audio information |
+ codec | String | Encoding specifications of audio files |
+ channels | Number | Sound track information of audio files |
+ sampleRateInHz | Number | Sampling rate of audio files |
+ bitRateInBps | Number | Code rate of audio files |
-
Response example:
HTTP/1.1 200 OK Transfer-Encoding: chunked x-bce-request-id: 3807ce30-5264-45f2-9b52-26b78e24a750 Cache-Control: no-cache Server: BWS Date: Tue, 24 Mar 2015 13:37:10 GMT Content-Type: application/json;charset=UTF-8 { "bucket": "samplebucket", "key": "samplefolderpath/sampleoutput.mp4", "fileSize": 102400, "durationInSecond": 60, "container": "mp4", "eTag": "bf407c4ca0dc4f2f7d581ec94ca36876", "type": "video", "video": { "codec": "h264", "heightInPixel": 1024, "widthInPixel": 768, "bitRateInBps": 2500 }, "audio": { "codec": "acc", "channels": 2, "sampleRateInHz": 96000, "bitRateInBps": 1100 } }