mbebenita / Broadway

A JavaScript H.264 decoder.
Other
2.73k stars 426 forks source link

Access Unit Boundary Check #235

Closed ra-app closed 2 years ago

ra-app commented 2 years ago

@soliton4 have you ever seen such debug msg?

image

everything works great up to a res. 1920x1080 as soon the res changes to something higher like 1921x1081 or 4k, it breaks and it results in this >

image

the first 1/4 is broken.

ra-app commented 2 years ago

is YUV444 supported?

soliton4 commented 2 years ago

as far as i know they yuv444 decoding is essentially a hack where all 3 color channels are encoded in an extended y plane and both u and v planes remain empty. i think there is even a shader for it in the webgl code, if not just paste the decoded y plane as u and v planes by using a byte offset

as to your problem above i dont know whats going on. i recommend debugging the decoder in your c ide of choice. all the c sources are in the repo and i used it directly in a c++ project before.

if you want to dig deeper. the sources come from the google android project. perhaps there is a newer version available? if you must decode your stream in the web you can also utilize the openh264 project. i am happy to give you pointers in how to compile it to wasm. i have done it before. it works but with less performance. the benefit is that openh264 as broader support for different profiles.

hope this helped. let me know of your progress.

ra-app commented 2 years ago

as far as i know they yuv444 decoding is essentially a hack where all 3 color channels are encoded in an extended y plane and both u and v planes remain empty. i think there is even a shader for it in the webgl code, if not just paste the decoded y plane as u and v planes by using a byte offset

thanks will try that

as to your problem above i dont know whats going on. i recommend debugging the decoder in your c ide of choice. all the c sources are in the repo and i used it directly in a c++ project before.

👍

if you want to dig deeper. the sources come from the google android project. perhaps there is a newer version available? if you must decode your stream in the web you can also utilize the openh264 project. i am happy to give you pointers in how to compile it to wasm. i have done it before. it works but with less performance. the benefit is that openh264 as broader support for different profiles.

hope this helped. let me know of your progress.

thanks for this great help, found out that @oneam did it already https://github.com/oneam/h264bsd will try that one.

ra-app commented 2 years ago

solved

ra-app commented 2 years ago

after several perf. issues i used https://www.w3.org/TR/webcodecs/