Bug #3003
openGenerating QR code using MP4
0%
Description
If you can generate an MP4 autoplaying silent video in Javascript, then you'll be able to display a super-white QR code using Wide Gamut HDR standards:
https://github.com/dtinth/superwhite
It could be done in ffmpeg.wasm but it's very large (over 25MB)
There is also a library that does FFMPEG as a service worker:
https://gist.github.com/ilblog/5fa2914e0ad666bbb85745dbf4b3f106
In PHP, we can do it using ffmpeg on the server: https://stackoverflow.com/questions/5892308/create-video-file-using-php
It seems wasteful to transfer the entire ffmpeg to the client just to generate this QR code. But on the server, we can certainly make use of an ffmpeg if it is installed!
ffmpeg -r 10 -b 1800 -i %03d.png test1800.mp4
But the hard part is figuring out how to set the white pixels to super-white in HDR color space. Here are some possible leads:
https://www.reddit.com/r/ffmpeg/comments/g3uucr/how_do_i_encode_4k_hdr_video_as_h265_with_ffmpeg/
https://www.reddit.com/r/ffmpeg/comments/v3k4mn/how_to_add_a_png_to_hdr_video_without_messed_up/