webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Functions | Variables
barcode_decoder Namespace Reference

Functions

def convert_yuv_to_png_files (yuv_file_name, yuv_frame_width, yuv_frame_height, output_directory, ffmpeg_path)
 
def decode_frames (input_directory, zxing_path)
 

Variables

 stderr
 

Function Documentation

◆ convert_yuv_to_png_files()

def barcode_decoder.convert_yuv_to_png_files (   yuv_file_name,
  yuv_frame_width,
  yuv_frame_height,
  output_directory,
  ffmpeg_path 
)
Converts a YUV video file into PNG frames.

The function uses ffmpeg to convert the YUV file. The output of ffmpeg is in
the form frame_xxxx.png, where xxxx is the frame number, starting from 0001.

Args:
  yuv_file_name(string): The name of the YUV file.
  yuv_frame_width(int): The width of one YUV frame.
  yuv_frame_height(int): The height of one YUV frame.
  output_directory(string): The output directory where the PNG frames will be
    stored.
  ffmpeg_path(string): The path to the ffmpeg executable. If None, the PATH
    will be searched for it.

Return:
  (bool): True if the conversion was OK.

◆ decode_frames()

def barcode_decoder.decode_frames (   input_directory,
  zxing_path 
)
Decodes the barcodes overlaid in each frame.

The function uses the Zxing command-line tool from the Zxing C++ distribution
to decode the barcode in every PNG frame from the input directory. The frames
should be named frame_xxxx.png, where xxxx is the frame number. The frame
numbers should be consecutive and should start from 0001.
The decoding results in a frame_xxxx.txt file for every successfully decoded
barcode. This file contains the decoded barcode as 12-digit string (UPC-A
format: 11 digits content + one check digit).

Args:
  input_directory(string): The input directory from where the PNG frames are
    read.
  zxing_path(string): The path to the zxing binary. If specified as None,
    the PATH will be searched for it.
Return:
  (bool): True if the decoding succeeded.

Variable Documentation

◆ stderr

barcode_decoder.stderr