# zxing

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.18).

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.

- GstClockTime `stream-time`: timestamp converted to stream-time.

- GstClockTime `running-time`: timestamp converted to running-time.

- GstSample `frame`: the frame in which the barcode message was detected, if the .#GstZXing:attach-frame property was set to TRUE (Since 1.18)

  This element is based on the c++ implementation of zxing which can found at https://github.com/zxing-cpp/zxing-cpp.

## Example launch lines

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

This pipeline will detect barcodes and send them as messages.

     gst-launch-1.0 -m v4l2src ! tee name=t ! queue ! videoconvert ! zxing ! 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
                            ╰──zxing

## Factory details

Authors: – Stéphane Cerveau <scerveau></scerveau>

Classification: – `Filter/Analyzer/Video`

Rank – marginal

Plugin – zxing

Package – GStreamer Bad Plug-ins

## Pad Templates

### `sink`

    video/x-raw:
             format: { ARGB, xRGB, Y444, Y42B, I420, Y41B, YUV9, YV12 }
              width: [ 1, 2147483647 ]
             height: [ 1, 2147483647 ]
          framerate: [ 0/1, 2147483647/1 ]

Presence – always

Direction – sink

Object type – GstPad

### `src`

    video/x-raw:
             format: { ARGB, xRGB, Y444, Y42B, I420, Y41B, YUV9, YV12 }
              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

### format

    “format” GstBarCodeFormat *

Barcode image format

Flags : Read / Write

Default value : all (0)

### message

    “message” gboolean

Post a barcode message for each detected code

Flags : Read / Write

Default value : true

### try-faster

    “try-faster” gboolean

Try faster to analyze the frame

Flags : Read / Write

Default value : false

### try-rotate

    “try-rotate” gboolean

Try to rotate the frame to detect barcode (slower)

Flags : Read / Write

Default value : false

## Named constants

### GstBarCodeFormat

BARCODE_FORMAT_ALL all format BARCODE_FORMAT_AZTEC aztec format BARCODE_FORMAT_CODABAR codabar format BARCODE_FORMAT_CODE_39 code39 format BARCODE_FORMAT_CODE_93 code 93 format BARCODE_FORMAT_CODE_128 code 128 format BARCODE_FORMAT_DATA_MATRIX data matrix format BARCODE_FORMAT_EAN_8 EAN 8 format BARCODE_FORMAT_EAN_13 EAN 13 format BARCODE_FORMAT_ITF ITF format BARCODE_FORMAT_MAXICODE maxicode format BARCODE_FORMAT_PDF_417 pdf 417 format BARCODE_FORMAT_QR_CODE QR code format BARCODE_FORMAT_RSS_14 RSS 14 format BARCODE_FORMAT_RSS_EXPANDED RSS expanded format BARCODE_FORMAT_UPC_A UPC_A format BARCODE_FORMAT_UPC_E UPC_E format BARCODE_FORMAT_UPC_EAN_EXTENSION UPC_EAN_EXTENSION format

#### Members

`all` (0) – ALL
`aztec` (1) – AZTEC
`codabar` (2) – CODABAR
`code_39` (3) – CODE_39
`code_93` (4) – CODE_93
`code_128` (5) – CODE_128
`png` (6) – PNG
`ean_8` (7) – EAN_8
`ean_13` (8) – EAN_13
`itf` (9) – ITF
`maxicode` (10) – MAXICODE
`pdf_417` (11) – PDF_417
`qr_code` (12) – QR_CODE
`rss_14` (13) – RSS_14
`rss_expanded` (14) – RSS_EXPANDED
`upc_a` (15) – UPC_A
`upc_e` (16) – UPC_E
`upc_ean_expansion` (17) – UPC_EAN_EXTENSION

Since : 1.18

The results of the search are