Earlier quoted context omitted.
> 2D barcode Which JS library do you use? I couldn't find a single library that can reliably scan PDF417 barcodes.
https://github.com/zxing-js/library Media constraints are the #1 reason it won't scan in my experience. You need at least ~1000px horizontal to reliably decode PDF417. If the resolution is 720p or lower, you aren't capturing enough information for a decode.
Scanning 2D barcodes only works reliable on smartphones with good camera and with good lighting.
I needed it for a ticket scanner used on an old phone at night entries for concerts.
Went and bought a hardware scanner (for 30€ or something) that connects itself as a "Bluetooth keyboard". Works like a charm.