Git Product home page Git Product logo

libde265.js's Introduction

libde265.js

Pure JavaScript HEVC/H.265 video decoding library using libde265.

Compiled from libde265 using Emscripten. Should run in all current browsers like Google Chrome 33+, Firefox 28+, IE 11+, Opera 20+ and Safari 7+ on OSX Mavericks. Older versions might work, but this is mostly untested.

NOTE: This is a very early preview which needs more testing and lots of optimizations!

Building

(currently only tested on Linux)

  • Install Emscripten and put into your PATH
  • Execute the build.sh, this will download and compile libde265 using Emscripten and will generate the libde265.js file.
  • If the version of your default LLVM is below 3.2, you might need to install the package llvm-3.2 (or newer) and set the environment variable LLVM_ADD_VERSION to 3.2 (or whatever you installed).

Examples

A small example can be found in the demo folder and on https://strukturag.github.io/libde265.js/.

Known issues

  • More code from libde265 should be made asm.js aware
  • Decoding should be made asynchronous through WebWorkers where available

Copyright (c) 2014 struktur AG

libde265.js's People

Contributors

fancycode avatar

Stargazers

Qing Qiao avatar Bünyamin Kırmızı avatar Eugene avatar  avatar edy avatar  avatar alex avatar 零天君 avatar Mike Harty avatar tangtes avatar  avatar 泛用型一般技术力工具人 avatar leehao avatar  avatar Jean Leao avatar Mikaio Melo de Souza avatar Ali Rahmani avatar Kyle avatar anil avatar jitenshap avatar  avatar  avatar  avatar  avatar nanguantong avatar RuHong pan avatar Eugene avatar  avatar  avatar CMJ_123 avatar  avatar gitboyzcf avatar Simon Blee avatar John Deng avatar  avatar xinde avatar ArBing Xie avatar 小潼 avatar addwater1 avatar Antoine Chauvin avatar  avatar puhuaqiang avatar Persimmons avatar gkju avatar  avatar  avatar 小忧忧 avatar  avatar 屁 avatar 初冬 avatar HaitianDai avatar  avatar Sterne Lee avatar James Edward Lewis II avatar swordmouse avatar gangganghao avatar  avatar Hoonseok Kim avatar Jay avatar Claire Chang avatar captain-hema avatar Lucas Cesar F. de Medeiros avatar  avatar  avatar Jameson Steiner avatar Quang Huy Nguyen Thac  avatar laojian avatar  avatar Laurent avatar tomorrow avatar damon lin avatar  avatar Javed Malik  avatar  avatar  avatar Ben Lau avatar vuecli avatar hu avatar halo avatar Sosky Hwang avatar Charles Le avatar Lu Yang avatar GAURAV avatar xiangxudong avatar 제민 avatar SpongeBob avatar Boush Li avatar Lakshmi Narayanan G avatar Hayk Martiros avatar  avatar 践行者 avatar Michael Kuefner avatar CyfforPro avatar  avatar Tianlan Zhou avatar huizluo avatar DogTorrent avatar Guido avatar  avatar Jamie.LiuMJ avatar

Watchers

Cinemacloud avatar Lev Panov avatar Neustradamus avatar fxwan avatar  avatar k8n avatar Jeff Le avatar Ofer Herman avatar mjs avatar James Cloos avatar yejinlei avatar Michael Anthony avatar Simon Eisenmann avatar Phuoc Chau avatar Dmitriy Voeykov avatar  avatar Yuqing Jiang avatar alvis avatar Andrei Ionescu avatar  avatar  avatar Yeonggyoo Jeon avatar  avatar  avatar sgy avatar winning1120xx avatar Jason_Ace avatar  avatar  avatar ℂ𝕠𝕠𝕠𝕝 (𝕘𝕚𝕥𝕙𝕦𝕓.𝕔𝕠𝕞/ℂ𝕠𝕠𝕠𝕝) avatar alberthk43 avatar  avatar iDzeir avatar Byungwoo Kim avatar  avatar  avatar Neptune Hsu avatar  avatar  avatar  avatar  avatar  avatar  avatar seshukumar kolli avatar chenp avatar  avatar  avatar Javed Malik  avatar

libde265.js's Issues

iOS Safari iPhone 4s and 5s

I debugged libde265.js on my iPhone 4s and was wondering why i can´t see HEVC content, cause it worked fine under iOS with my iPad AIR, both devices were running iOS 7.1.

The safari debugger brings light on this, i added a console.log output to my iOS Safari browser (iPhone 4s):

[Log] 268435456 (libde265.js, line 1085)

RangeError: ArrayBuffer size is not a small enough positive integer. anonyme Funktion) (libde265.js, line 1087)

It seems an error in sizeof the buffer array near (Searched for "Initialize the runtime's memory in libde265.js- cause the debugger doenst show the right line number as my javscript IDE") - i founded it and showed me these lines of code where i add the console.log(TOTAL_MEMORY) to see why we have this size Array error, see:

// Initialize the runtime's memory
// check for full engine support (use string 'subarray' to avoid closure compiler confusion)
assert(typeof Int32Array !== 'undefined' && typeof Float64Array !== 'undefined' && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),
'JS engine does not provide full typed array support');
console.log(TOTAL_MEMORY);
var buffer = new ArrayBuffer(TOTAL_MEMORY);

So TOTAL_MEMORY seems to be 268435456, and that is too high value for the new ArrayBuffer.

I do not know if this is fixable, cause the generated code is done by emscripten i think.

What do you think?

Gary

coded parameter out of range error

While trying to decode an heic picture coming from an iPhone X I am getting this error:

hevc-decoder.js:166 coded parameter out of range

In this case, code is 8.

I am using Nokia's decoder which in turn uses libde265.js.

See nokiatech/heif#33

issue while building library with emscripten

Following errors occurred during compilation of library with emscripten,

emsdk-master/fastcomp/emscripten/system/include/libcxx/memory:2148:9: error:
cannot initialize a member subobject of type 'int *' with an rvalue of
type 'long'
: _value(_VSTD::forward<_Up>(__u))
^ ~~~~~~~~~~~~~~~~~~~~~~~~

emsdk-master/fastcomp/emscripten/system/include/libcxx/memory:2148:9: error:
cannot initialize a member subobject of type 'option_base **' with an
rvalue of type 'long'
: _value(_VSTD::forward<_Up>(__u))
^ ~~~~~~~~~~~~~~~~~~~~~~~~

emsdk-master/fastcomp/emscripten/system/include/libcxx/memory:2148:9: error:
cannot initialize a member subobject of type 'std::__2::basic_string
*' with an rvalue of type 'long'
: _value(_VSTD::forward<_Up>(__u))
^ ~~~~~~~~~~~~~~~~~~~~~~~~

emsdk-master/fastcomp/emscripten/system/include/libcxx/memory:2251:9: error:
no matching constructor for initialization of
'__compressed_pair_elem<std::__2::basic_string *, 0>'
: _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
^ ~~~~~~~~~~~~~~~~~~~~~~~

emsdk-master/fastcomp/emscripten/system/include/libcxx/memory:2241:9: error:
no matching constructor for initialization of
'__compressed_pair_elem<std::__2::basic_string *, 0>'
: _Base1(std::forward<_Tp>(__t)), _Base2() {}
^ ~~~~~~~~~~~~~~~~~~~~~~

emsdk-master/fastcomp/emscripten/system/include/libcxx/memory:2251:9: error:
no matching constructor for initialization of
'__compressed_pair_elem<option_base **, 0>'
: _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
^ ~~~~~~~~~~~~~~~~~~~~~~~

attached the complete logs of build.sh
libde265_build_logs.txt

Please check the attached log file for the above mentioned errors.

Thanks in advance

Cnic details kyc?

(3660299696781)//,this id card details with id card, issues and expire date show.

Split code into different modules

Currently we have a huge big source file, it is difficult to read and maintain. Is it possible we split it into different modules (maybe as a npm module)?
I am asking this because I only need the Decoder feature of this library. I am using webpack as build tool

[enhancement]About the js file size.

Hi ,

I have download your demo, and run it on local server, it works well.
Great job, Thank you.

But I think this lib is very big, the min file almost 800k, And the js file is creating by Emscripten, it added some additional codes to lib. Do you have other version lib for javascript?

And I want change the video file in demo, it throws an error like issue#2: #2

Thanks for your working.
David

Live Streaming

Hi,

Is it possible to play live streams using this library?

Thanks,
Yaron T.

Please update.

Hi, this is a nice library to decode H265, however it was built many years ago, so it is not suit for present times, it lacks of some features like rendering into WebGL, decoding with WebAssembly, please update the new version. Thanks.

IE11 video don't playback

end line 22 this.Ea=new Worker(ab);
SCRIPT5022: SecurityError

URL-address of at least one BLOB-object revoked by closing BLOB-object for which it was created. Such URL-addresses will not be resolved, as data associated with them have been released.

I tried to set
video.crossOrigin = 'anonymous'
but it didn’t help.
CORS error?

So, video does not play.

Create Videos

Hello,

How did you encode the sample hevc file? I generated a couple of files using f265. If I bundle these in a matroska file they play happily in your chrome app, however the raw hevc does not play in libde265.js. Instead I get a hissy screen reminiscent of old analogue TVs when they were out of tune.

I was concerned that perhaps my emscripten build was borked so I downloaded libde265.js and your sample video from your demo site. I can play your video that way but not my own.

Best wishes, Max

Feeding small chunks of data to decoder cause latency?

In the source code I see you push 4096 bytes to decoder each time. I'm now using libde265.js to do streaming and instead of 4096bytes I use the data that the server side send me every time to feed the decoder. The length of the data I received is the size of a frame, thus it may be variant, sometimes large while sometimes very small. I think most of the time the data size is smaller than 4096 bytes. Then I call decoder.push_data() and decoder.decode() per frame, which is very frequent.

Is this why it causes some latency and I feel lag when I do other things in javascript such as tracking my mouse position? I don't know if I need to wait the received data size to be larger than 4096 bytes and then do decode() once, since it could also causes some 'waiting time' to reach the chunk size.

Decode data which from websocket will be very slow

I use websocket to send and receive H265 frames. Monitor the onmessage event, when frame comes, function decode will be called. But in this way, the video has a long latency, and data sending also be blocked.
How to fix it? Do I need to use webworker to get smooth video?

streaming support?

hi, is there a way to support decoding of a stream?
i want to encode a video stream using avconv. i transport the output to the browser using stdout and socket.io.

a demo what i am doing can be watched here:
https://www.youtube.com/watch?v=nDuHEMA5uSw

is it possible to use the libde265 for this purpouse?
thx

Intra Only Decoding

i study a lot your libde.265.js and really like the idea a lot. I generated one I-Frame only hevc file that i tried to decode and display in the video canvas.

I saw that the libde gets enough data to decode this one intra-frame, no error callback was called. the generated image never displays, and image

ing = get_next_picutre....always show a false boolean value in the function before the display image is called.

When i generated a second of 24 hevc frames (one I,P,B) , then the decoder is able to display these frames as one shot.

I packed the one intra hevc only file in a zip file and upload it for your download.

Is it possible to decode only one intra frame with libde265.js?
http://rebotnix.com/temp/one_intra.hevc.zip

Unsupported 10 bit video in 8 bit array?

I know you haven't implemented 10 bit yuv420 to rgb yet so I tried implementing it myself. I noticed the Y U and V arrays are from 0 to 255 but thats not 10 bit. I figured it out, it was cake xD

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.