Barcode Analysis Results

The following XML is a single record produced during barcode analysis:

<record>
  ...
  <trackname>barcode.Result</trackname>
  <BarcodeResult>
    <id>b8c4331e-6058-4786-83d9-a43e605f463e</id>
    <text>some text</text>
    <barcodeType>Code-128</barcodeType>
    <region>
      <left>94</left>
      <top>66</top>
      <width>311</width>
      <height>98</height>
    </region>
    <parentID>4d69390f-a8c4-4c5d-a0b0-705a3f98aa9b</parentID>
  </BarcodeResult>
</record>

The record includes the following information:

  • The id element provides a unique identifier for the detected barcode. The barcode analysis engine issues an ID for each detected appearance of a barcode. If you are detecting barcodes in video and consecutive frames show the same barcode in a near-identical location, all records related to that appearance will have the same ID.

    For example, if a barcode appears in the same location for fifty consecutive video frames, the engine uses the same ID for each record in the data track and produces a single record in the result track. The record in the result track will have a timestamp that covers all fifty frames.

    If the barcode moves to a different location on the screen, or disappears and then reappears, the engine considers this as a new detection and produces a new ID and a new record in the result track.

  • The text element contains the data encoded by the barcode. If Media Server detects a barcode with a supplement, for example EAN-13+EAN-2, the text element contains the digits from both parts of the barcode, separated by a hyphen.
  • The barcodeType element contains a string which describes the type of the detected barcode. This can be any of the following values:

    • Codabar
    • Code-128
    • Code-39
    • Code-93
    • Datalogic 2/5
    • Data Matrix
    • EAN-13
    • EAN-13+EAN-2
    • EAN-13+EAN-5
    • EAN-8
    • EAN-8+EAN-2
    • EAN-8+EAN-5
    • I25
    • IATA 2/5
    • Industrial 2/5
    • Matrix 2/5
    • Patch Code
    • PDF417
    • QR
    • UPC-A
    • UPC-A+EAN-2
    • UPC-A+EAN-5
    • UPC-E
    • UPC-E+EAN-2
    • UPC-E+EAN-5
  • The region element describes the position of the barcode in the ingested media. If Media Server detects a barcode with a supplement, for example EAN-13+EAN-2, the region includes both parts of the barcode.
  • The parentID element is empty, unless you configure the analysis engine with Region=Input in which case it contains the UUID of the input record. This provides a way to link the result with other records (from another analysis task) that supplied the region to analyze. To generate a single record combining the information, you can use the Combine ESP engine and the example Lua script parentuuidMatch.lua.