uses data.KeyValue
uses media.PixelMapYUV
/* {"description" : "Data type to describe encoded video frames." } */
data EncodedFrame {
/* {"@description" : "The encoded frame data." } */
byte content[]
/* {"@description" : "The timestamp at which this frame should be visible during video playback." } */
int timestamp
}
/* {"description" : "API to encode video frames." } */
interface Encoder {
/* {"@description" : "Instantiate a new encoder, for a given video resolution (size), a frames-per-second value, and a set of optional configuration options." } */
Encoder(store WH size, int framesPerSecond, opt KeyValue options[])
/* {"@description" : "Encode the next video frame, indicating whether or not it should be a keyframe." } */
EncodedFrame[] encode(PixelMapYUV frame, bool keyFrame)
/* {"@description" : "Finish encoding, which may return a final batch of encoded frames." } */
EncodedFrame[] finish()
}To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n media.video.Encoder -m "reason for update" -u yourUsername
Version 3 (this version) by barry
Notes for this version: Adds a method to pass in optional encoder parameters