{"id":13523586,"url":"https://github.com/mbebenita/Broadway","last_synced_at":"2025-04-01T01:33:04.584Z","repository":{"id":1751392,"uuid":"2577939","full_name":"mbebenita/Broadway","owner":"mbebenita","description":"A JavaScript H.264 decoder.","archived":false,"fork":false,"pushed_at":"2023-01-22T15:40:35.000Z","size":94798,"stargazers_count":2745,"open_issues_count":90,"forks_count":426,"subscribers_count":113,"default_branch":"master","last_synced_at":"2025-03-30T23:06:42.424Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbebenita.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-14T18:20:43.000Z","updated_at":"2025-03-28T21:58:56.000Z","dependencies_parsed_at":"2023-02-12T16:45:31.711Z","dependency_job_id":null,"html_url":"https://github.com/mbebenita/Broadway","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbebenita%2FBroadway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbebenita%2FBroadway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbebenita%2FBroadway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbebenita%2FBroadway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbebenita","download_url":"https://codeload.github.com/mbebenita/Broadway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246567125,"owners_count":20798117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:01.563Z","updated_at":"2025-04-01T01:33:04.560Z","avatar_url":"https://github.com/mbebenita.png","language":"C","funding_links":[],"categories":["C","others","Video"],"sub_categories":[],"readme":"Broadway.js\n===========\nA JavaScript H.264 decoder.\n\n\nView a Live Demo:  \nhttp://mbebenita.github.io/Broadway/foxDemo.html  \nhttp://mbebenita.github.io/Broadway/storyDemo.html  \nhttp://mbebenita.github.io/Broadway/treeDemo.html  \n\nThe video player first needs to download the entire video before it can start playing, thus appearing to be a bit slow at first, so have patience. You can start the video by clicking on each player. The top left player runs on the main thread, while the remaining players run in background worker threads.\n\nUse an example node app as template:  \nhttps://github.com/soliton4/BroadwayStream  \n\nTechnical info\n==============\n\nThe demo is Android's H.264 decoder compiled with Emscripten to JavaScript, then further optimized with\nGoogle's JavaScript closure compiler and further optimized by hand to use WebGL.\n\nBuilding the demo:\n\nInstall and configure Emscripten (https://github.com/kripken/emscripten)  \nThe current version of Broadway was built with emscripten 1.35.12  \n\nThe code for the demo is in the Decoder folder, to build it run the make.py python script. (Requires at least python 2.7)\n\nEncoding Video\n==============\n\nThe decoder expects an .mp4 file and does not support weighted prediction for P-frames and CABAC entropy encoding. To create such bitstreams use ffmpeg and x264 with the following command line options:\n\n```\nffmpeg -y -i sourceFile -r 30000/1001 -b:a 2M -bt 4M -vcodec libx264 -pass 1 -coder 0 -bf 0 -flags -loop -wpredp 0 -an targetFile.mp4\n```\n\nAPI\n===\n\nPlayer.js, Decoder.js and YUVWebGLCanvas.js all have a unified module definition.  \nYou can use them as plain js files or with common.js / AMD  \n\n# Player.js:  \n\n```\nvar p = new Player({\n  \u003coptions\u003e\n});\n\np.canvas; // the canvas - put it where you want it\n\np.decode(\u003ch264 data\u003e);\n```\n\n## Options:  \n\nuseWorker true / false  \nDecode in a worker thread  \n\nworkerFile \u003cstring\u003e  \nPath to Decoder.js. Only neccessary when using worker. Defaults to \"Decoder.js\"  \n\nwebgl true / \"auto\" / false  \nUse webgl. defaults to \"auto\"  \n\nsize { width: \u003cnum\u003e, height: \u003cnum\u003e }  \nInitial size of the canvas. Canvas will resize after video starts streaming.  \n\n## Properties:  \n\ncanvas  \ndomNode  \n\nrefers to the canvas element.  \n\n## methods:  \n\ndecode (\u003cbin\u003e)\n\nFeed the decoder with h264 stream data.  \n\n\n# Decoder.js:  \n\n```\nvar p = new Decoder({\n  \u003coptions\u003e\n});\n\np.onPictureDecoded; // override with a callback function\n\np.decode(\u003ch264 data\u003e);\n```\n\n## options:  \n\nrgb true / false  \nIf true will convert the image to rgb. sligtly slower.  \n\n## properties:  \n\nonPictureDecoded  callback function(\u003cbin\u003e, width, height)\n\nWill be called for each frame.\n\n## methods:  \n\ndecode (\u003cbin\u003e)\n\nFeed the decoder with h264 stream data.  \n\n\n# [Real World Uses of Broadway.js](https://github.com/mbebenita/Broadway/wiki/Real-World-Uses)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbebenita%2FBroadway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbebenita%2FBroadway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbebenita%2FBroadway/lists"}