Create a Python virtual environment.
$ mkvirtualenv moviebarcode -p python3
Install required libraries
$ (moviebarcode) pip install -r requirements.txt
Generate Moviebarcode with video2moviebarcode.py
$ (moviebarcode) python video2moviebarcode.py -v "video_path"
Use Moviebarcode module in your code
from src.moviebarcode import Moviebarcode
moviebarcode = Moviebarcode(video_path=video_path)
moviebarcode.generate()
moviebarcode.display_barcode()
# Create an image, .png file
moviebarcode.make_image()
Sample barcode outputs
Generate Eventbarcode with video2eventbarcode.py
$ (moviebarcode) python video2eventbarcode.py -f "json_files_path"
from src.eventbarcode import EventBarcode
eb = EventBarcode(
json_folder_path="json_files_path",
barcode_width=5,
no_of_colors=5,
verbose=True,
criteria='dominant'
)
eb.build(file_name="eventbarcode.png")
Or
from src.eventbarcode import EventBarcode
eb = EventBarcode(
json_folder_path=None,
barcode_width=5,
no_of_colors=5,
verbose=True,
criteria='dominant'
)
eb.json_files = [...] # Sorted list of json files to generate eventbarcode
eb.build(file_name="eventbarcode.png")
Sample Eventbarcode Images