{"id":22683589,"url":"https://github.com/notedit/sji-android-screen-capture","last_synced_at":"2025-04-22T11:43:12.662Z","repository":{"id":21189242,"uuid":"24497049","full_name":"notedit/sji-android-screen-capture","owner":"notedit","description":"android screen capture (for HTML5 video live streaming, broadcast","archived":false,"fork":false,"pushed_at":"2014-01-10T14:27:49.000Z","size":7316,"stargazers_count":1,"open_issues_count":0,"forks_count":17,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T14:41:36.884Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notedit.png","metadata":{"files":{"readme":"README.md","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":"2014-09-26T11:28:44.000Z","updated_at":"2023-11-15T02:17:26.000Z","dependencies_parsed_at":"2022-08-05T11:30:17.439Z","dependency_job_id":null,"html_url":"https://github.com/notedit/sji-android-screen-capture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notedit%2Fsji-android-screen-capture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notedit%2Fsji-android-screen-capture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notedit%2Fsji-android-screen-capture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notedit%2Fsji-android-screen-capture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notedit","download_url":"https://codeload.github.com/notedit/sji-android-screen-capture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237013,"owners_count":21397393,"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-12-09T21:12:38.184Z","updated_at":"2025-04-22T11:43:12.639Z","avatar_url":"https://github.com/notedit.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"sji-android-screen-capture\n===================\n\u003cb\u003eAndroid Screen Capture (For HTML5 Video Live Streaming)\u003c/b\u003e  \nThis project is aimed to capture android screen and view it in HTML5 video capable browser.  \nYes, real time, low bandwidth.  This product will do encoding in android by \u003ca href=\"http://ffmpeg.org/\"\u003effmpeg\u003c/a\u003e.  \n\u003cpre\u003e\u003ccode\u003e\u003ca href=\"http://youtu.be/CWcOjzAJ6Sg\"\u003erecorded video sample( converted by youtube)\u003c/a\u003e  \n\u003ca href=\"http://youtu.be/1wZYHHzMwQ8\"\u003eUsage video\u003c/a\u003e\u003c/code\u003e\u003c/pre\u003e\n  \n[Screenshot]\n\u003cimg src=\"doc/screenshot-menu.png\" /\u003e\n\u003cimg src=\"doc/screenshot-png.png\" /\u003e\n\n[How to use]  \n  \n1.\u003cb\u003eSetup PC Environment (Windows/Mac/Linux/Unix)\u003c/b\u003e  \n\u003cpre\u003e\u003ccode\u003e\u003ca href=\"http://developer.android.com/sdk/index.html\"\u003eInstall Android SDK\u003c/a\u003e (at least \"Platform Tools\" which include adb(Android Debug Bridge)).  \n\u003ca href=\"http://nodejs.org/download/\"\u003einstall node.js\u003c/a\u003e.  \nInstall android USB driver automatically or manually when you first plug Android into PC.  \n\u003c/code\u003e\u003c/pre\u003e\n\n3.\u003cb\u003eStart Android Screen Capture (include a video stream server) on PC\u003c/b\u003e  \n\u003cpre\u003e\u003ccode\u003ecd path_of_this_project/bin  \nnode stream.js\n\u003c/code\u003e\u003c/pre\u003e\nYou can edit configuration file \u003ca href=\"https://raw.github.com/sjitech/sji-android-screen-capture/master/bin/stream.json\"\u003estream.json\u003c/a\u003e to change IP, port, SSL...  \n\u003cbr/\u003e\u003cbr/\u003e\n4.\u003cb\u003eShow video/image of android from PC by browsing \u003ca href=\"http://localhost:3000/\"\u003ehttp://localhost:3000/\u003c/a\u003e\u003c/b\u003e  \u003cbr/\u003e\nFor video, currently only support \u003ca href=\"http://www.webmproject.org/\"\u003eWebM\u003c/a\u003e video, so recommend \u003ca href=\"http://www.google.com/chrome\"\u003eGoogle Chrome Browser\u003c/a\u003e.  \nFor image, currently support animated PNG by \u003ca href=\"http://en.wikipedia.org/wiki/MIME#Mixed-Replace\"\u003emulti-part http response\u003c/a\u003e. Chrome and Firefox are well supported.  \n\u003cbr/\u003e\u003cbr/\u003e\nTo embed Animated PNG image into your html page:  \n\u003cpre\u003e\u003ccode\u003e\u0026lt;img src=\"http://localhost:33333/capture?device=yourDeviceSerialNumber\u0026type=apng\u0026fps=4\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\nTo embed webm video into your html page:  \n\u003cpre\u003e\u003ccode\u003e\u0026lt;video controls preload=\"none\" autobuffer=\"false\"\u0026gt;  \n  \u0026lt;source src=\"http://localhost:33333/capture?device=yourDeviceSerialNumber\u0026type=webm\u0026fps=4\" type=\"video/webm\"\u003e  \n\u0026lt;/video\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e  \n\nTo just capture one screenshot:  \n\u003cpre\u003e\u003ccode\u003e\u0026lt;img src=\"http://localhost:33333/capture?device=yourDeviceSerialNumber\u0026type=png\" /\u0026gt;\n\u003c/code\u003e\u003c/pre\u003e\n\n[Note]:  \nAll above URLs can specify scale and rotate optionally by append following querystring:\n\u003cpre\u003e\n\u0026scale=0.5\u0026rotate=270 or  \n\u0026scale=300x or  \n\u0026scale=300x200 or  \n\u0026scale=x200 ...  \n\u003c/pre\u003e  \n  \nFor advanced usage, please start menu page, move mouse to link and button to see URL.  \n\u003cbr/\u003e\n\u003cbr/\u003e\nYou can attach an access key for device so all above URL must  appended \u0026accessKey=yourAccessKey otherwise you get \"access denied\" error response.  \nTypically stream web server administrator set adminKey e.g. xxxx,   \nthen submit URL request:  \n\u003cpre\u003e  \nhttp://localhost:3000/deviceControl?adminKey=xxxx\u0026action=setAccessKey\u0026accessKey=yyyy\u0026device=sn1\u0026device=sn2  ....  \n\u003c/pre\u003e  \nThis will attach access key yyyy to device sn1 and sn2.  \n  \nTo start record Animated PNG image, you can submit following URL request:  \n\u003cpre\u003e  \nhttp://localhost:3000/deviceControl?adminKey=xxxx\u0026action=startRecording\u0026device=sn1\u0026device=sn2\u0026type=apng\u0026fps=4  \n\u003c/pre\u003e  \n  \nThis will start record on device sn1 and sn2. The fps means rate. You can optionally specify scale and rotate querystring.  \n  \nTo stop record Animated PNG image, embed following URL into your HTML img tag:  \n\u003cpre\u003e  \nhttp://localhost:3000/deviceControl?adminKey=xxxx\u0026action=stopRecording\u0026device=sn1\u0026device=sn2    \n\u003c/pre\u003e  \n  \nTo play record file Animated PNG image, embed following URL into your HTML img tag:  \n\u003cpre\u003e  \nhttp://localhost:33333/playRecordedFile?\u0026device=sn1\u0026accessKey=yyyy\u0026type=apng  \n\u003c/pre\u003e  \n  \nYou can optionally specify custom playback rate by fps querystring.  \n\nTo download record file Animated PNG image, embed following URL into your HTML page:  \n\u003cpre\u003e  \nhttp://localhost:33333/downlodRecordedFile?\u0026device=sn1\u0026accessKey=yyyy\u0026type=apng  \n\u003c/pre\u003e  \n  \nFor webm format, just change apng to webm and img tag to video tag in above steps.   \n\n===================  \n[Note]  \n    Currently tested in android 4.2, 4.1, 4.0, 2.2, 2.3.  With PC Browser Chrome, Firefox.  \n    Host OS can be Windows/Mac/Linux (Unix should also be OK, but not tested).  \n    Build: src/build_all.sh has been tested in Mac OS X 10.7 64bit and Ubuntu 12 64bit,\n    Android NDK r8 or r9. Gcc 4.4.3 or 4.8.  \n    bin/android/run.sh_/busybox is download from \u003ca href=\"http://www.busybox.net/downloads/binaries/latest/busybox-armv5l\"\u003ebusybox binary downloads\u003c/a\u003e.  \n  \n[Todo]  \n    enhance performance!  \n    many many...  \n\n\u003cpre\u003e\n//done: refactor source\n//done: use configuration file (stream.json)\n//done: support SSL\n//done: use pfx format for server certificate and private key\n//done: support browser's javascript XMLHttpRequest\n//done: disable ffmpeg statistics log by default\n//done: admin web site\n//done: session management\n//done: test: stop recording\n//done: do not call getRemoteVer every time\n//done: resize in android\n//done: rotate in android\n//done: play recorded file( webm )\n//done: play recorded file( apng )\n//done: test: record webm video and record at same time\n//done: stress test replay apng\n//done: sort recorded file by time\n//done: memory leak test on repeatedly view recorded file and view live capture\n//done: Fixed: Force firefox/safari refresh page when history back\n//done: check device existence for viewLiveCapture request\n//done: stress test live capture (animated PNG)\n//done: stress test live capture (webm)\n//done: test close http stream when downloading or playing\n//done: do not show recording file, only show latest recorded file\n//done: check device availability first in /viewRecordedFile or /viewLiveCapture\n//done: show streaming counter in menu page\n\n//todo: test: on Windows OS, IE\n//todo: convert apng to mp4 so can control progress by viewer\n//todo: safari: multipart/x-mixed-replace\n//todo: kill orphan process\n//todo: join two webm file\n//todo: send webm video to browser and file at same time. Completely remove recordOption when viewLiveCapture\n//todo: adapt fps change without interrupting viewer\n//todo: use error image or video to show error\n//todo: water mark\n//todo: add audio\n//todo: make touchable: forward motion event to android\n//todo: remove dependence of adb\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotedit%2Fsji-android-screen-capture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotedit%2Fsji-android-screen-capture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotedit%2Fsji-android-screen-capture/lists"}