# zbar

Detect bar codes in the video streams and send them as element messages to the GstBus if message property is TRUE. If the attach-frame property is TRUE, the posted barcode message includes a sample of the frame where the barcode was detected (Since 1.6).

The element generates messages named `barcode`. The structure contains these fields:

- GstClockTime `timestamp`: the timestamp of the buffer that triggered the message.
- gchar * `type`: the symbol type.
- gchar * `symbol`: the detected bar code data, as a string.
- GBytes * `symbol-bytes`: the detected bar code data, as bytes. (Since 1.26)
- gint `quality`: an unscaled, relative quantity: larger values are better than smaller values.
- GstSample `frame`: the frame in which the barcode message was detected, if the attach-frame property was set to TRUE (Since 1.6)

## Example launch lines

     gst-launch-1.0 -m v4l2src ! videoconvert ! zbar ! videoconvert ! xvimagesink

This pipeline will detect barcodes and send them as messages.

     gst-launch-1.0 -m v4l2src ! tee name=t ! queue ! videoconvert ! zbar ! fakesink t. ! queue ! videoconvert ! xvimagesink

Same as above, but running the filter on a branch to keep the display in color

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseTransform
                        ╰──GstVideoFilter
                            ╰──zbar

## Factory details

Authors: – Stefan Kost

Classification: – `Filter/Analyzer/Video`

Rank – none

Plugin – zbar

Package – GStreamer Bad Plug-ins

## Pad Templates

### `sink`

    video/x-raw:
             format: { Y800, I420, YV12, NV12, NV21, Y41B, Y42B, YUV9, YVU9 }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

Presence – always

Direction – sink

Object type – GstPad

### `src`

    video/x-raw:
             format: { Y800, I420, YV12, NV12, NV21, Y41B, Y42B, YUV9, YVU9 }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

Presence – always

Direction – src

Object type – GstPad

## Properties

### attach-frame

    “attach-frame” gboolean

Attach a frame dump to each barcode message

Flags : Read / Write

Default value : false

### binary

    “binary” gboolean

Enable or disable binary QR codes, where binary data is not converted to text.

Flags : Read / Write

Default value : false

Since : 1.26

### cache

    “cache” gboolean

Enable or disable the inter-image result cache

Flags : Read / Write

Default value : false

### message

    “message” gboolean

Post a barcode message for each detected code

Flags : Read / Write

Default value : true

The results of the search are