You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The third parameter of Mp4Player, which is webgl, must be false. When the webgl is true, you will get YUV420p data instead of RGBA.
The resolution is critical. THREEJS requires resolution dividable by 2 and no larger than 1024. Larger texture will cause iOS browser to crash. You heard right, neither Windows nor Android will crash, only iOS's browser will crash. You can do resize when copy data from buffer.
The decoded buffer cannot be given to THREE.DataTexture directly, I had to make a copy. Don't know why.
The decoded buffer needs a Y-axis flip before set as texture. It's because OpenGL texture memory start from bottom-left, instead of top-left.
Hope the example helps.
The text was updated successfully, but these errors were encountered:
Thanks for the great code!
I'm using Broadway to decode mp4 for frames used as THREEJS texture. Here's my example for reference.
to enable Broadway, add
<script>
to index.html, so that Broadway, Player, etc. become available in all other js files.Because I put those js files in the folder
Broadway
, I needed to change the code in Player.js line 57After reading the code in mp4.js, I decided to use the Mp4Player class to decode mp4 file in the background.
webgl
, must be false. When thewebgl
is true, you will get YUV420p data instead of RGBA.Hope the example helps.
The text was updated successfully, but these errors were encountered: