Microsoft Camcorder Video

From MultimediaWiki
Jump to navigation Jump to search

According to Microsoft's documentation, Camcorder Video allows users of Microsoft Office 97 to record video of their desktop. This would make it a screen capture codec if not for the fact that it actually records GDI and WINUSER API calls so in order to reconstruct image one has to implement those GDI calls.

Each frame consists of records containing GDI/WINUSER commands:

 bytes 0-3   size of record including this field
 bytes 4-5   command code
 bytes 6-9   unknown
 bytes 10-... command arguments, usually 16-bit integers

The internal state keeps a list of GDI objects in an internal array and references them by ID so that the command e.g. for drawing a rectangle sends as parameters rectangle coordinates (left, top, right, bottom) as well as the brush ID that will be selected before rectangle will be drawn. In general the commands that have brush, pen IDs or such send those IDs at the end of the list but before the variable-length part (e.g. points to draw polyline).

Known opcodes are:

  • 0x00 -- fill region using region and brush IDs
  • 0x01 -- draw a border around region; parameters are region/brush IDs plus stroke width/height
  • 0x02 -- invert region
  • 0x03 -- paint region using the provided region/brush IDs
  • 0x04 -- draw an arc using provided coordinates and brush ID
  • 0x05 -- draw a line to the provided point using brush ID
  • 0x06 -- moveto (parameters are point coordinates)
  • 0x07 -- not present
  • 0x08 -- polyline (first parameter is number of points, second parameter is brush ID, the rest are line points)
  • 0x09 -- draw a chord (same parameters as for arc)
  • 0x0A -- draw focused rectangle (parameters are rectangle coordinates)
  • 0x0B -- draw an ellipse (parameters are bounding rectangle plus pen and brush IDs)
  • 0x0C -- draw filled rectangle (WINUSER; parameters are its coordinates and brush ID)
  • 0x0D -- draw frame rectangle (same parameters)
  • 0x0E -- invert rectangle at the provided coordinates
  • 0x0F -- draw a pie (parameters are coordinates passed to the GDI function plus brush and pen IDs)
  • 0x10 -- draw a polygon (parameters are number of points, brush/pen IDs and vertices coordinates)
  • 0x11 -- draw a series of polygons (essentially the same parameters)
  • 0x12 -- draw a rectangle (GDI) using provided coordinates and brush/pen IDs
  • 0x13 -- draw a rounded rectangle using provided coordinates, corner radius and brush/pen IDs
  • 0x14 -- blit bitmap using the provided arguments to BitBlt and bitmap ID
  • 0x15 -- blit (optionally stretched bitmap)
  • 0x16 -- ExtFloodFill using provided coordinates, colour, mode and brush ID
  • 0x17 -- PatBlt using provided coordinates, mode and brush ID
  • 0x18 -- set pixel at the provided coordinates to the provided colour value
  • 0x19 -- stretched blit using provided coordinates, mode and bitmap ID
  • 0x1A -- SetDIBitsToDevice using provided bitmap data
  • 0x1B -- StretchDIBits using provided bitmap data
  • 0x1C -- draw provided text using specified pen/brush IDs
  • 0x1D -- same but using TextOut instead of ExtTextOut
  • 0x1E -- draw text with WINUSER function
  • 0x1F -- WINUSER TabbedTextOut
  • 0x20 -- draw window frame
  • 0x21 -- create new palette using provided data
  • 0x22 -- delete requested GDI object by ID
  • 0x23 -- unused
  • 0x24 -- init window parameters (origin and viewport)
  • 0x25 -- something similar
  • 0x26-0x32 -- unused
  • 0x33 -- set mapping mode to the provided argument
  • 0x34 -- set window and viewport extents
  • 0x35 -- set viewport origin
  • 0x36 -- set window origin
  • 0x37 -- set background mix mode
  • 0x38 -- set background colour
  • 0x39 -- set foreground mix mode
  • 0x3A -- set text colour
  • 0x3B -- set text align mode
  • 0x3C -- set text justification
  • 0x3D -- set brush origin
  • 0x3E -- set polygon fill mode
  • 0x3F -- create new brush with the provided parameters as store it at the provided ID
  • 0x40 -- create new font using the provided parameters and destination ID
  • 0x41 -- create patterned brush
  • 0x42 -- create new pen
  • 0x43 -- create memory object (some kind of bitmap?) by copying data from the stream to the given ID object
  • 0x44 -- init some window parameters
  • 0x45 -- unused
  • 0x46 -- create new bitmap using data from the stream
  • 0x47 -- init some window parameters
  • 0x48 -- set default parameters to the drawing system (usually the very first opcode in the first frame)
  • 0x49 -- clear drawing system from used objects
  • 0x4A -- set some flag, probably for custom window clipping
  • 0x4B -- delete requested object