Coder Social home page Coder Social logo

devicefarmer / minicap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openstf/minicap

252.0 252.0 66.0 2.48 MB

Stream real-time screen capture data out of Android devices.

License: Other

Makefile 11.32% Shell 1.80% JavaScript 1.70% HTML 0.40% C++ 73.38% C 0.83% Kotlin 10.57%
hacktoberfest

minicap's People

Contributors

dependabot-preview[bot] avatar jessecodebones avatar koral-- avatar pcrepieux avatar qmfrederik avatar sorccu avatar varundtsfi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minicap's Issues

Video Player Frame stuck while Playing DRM protected Content | Android 11

In Android 10, If we play DRM-protected video content(Netflix), Minicap will throw a green layer in a video player region and the stream continues without stuck.

In Android 11, If we play DRM-protected video content(Netflix), Minicap will crash the stream and stuck with a static frame. Until we restart the minicap server, It remains stuck.

Expected Output: Android 11 behavior should be the same as Android 10
Device: Pixel 4a
Android Version: 11
SDK: 30

No android secured screen in Android 12

What is the issue or idea you have?

Have you tried STF?

Using latest JNI update
I am still unable to get secured screens(for example, changing pin code)
This behavior is only happening on Android 12 devices

Vector<> have different types XI AOMI MI_10 MIUI_12 Android 10 (SDK 29)

Hi,
We are facing this issue in Xiaomi MIUI 11 and MIUI 12 too. As per my understanding It's not related with Android Version but related with Xiaomi MIUI Version. Previously it was coming in MIUI 11 but not it's there in 12 too.
I tried to downgrade my xiaomi device from MIUI 11 to MIUI 10 then its started working.
Below is the old reference
(openstf#169)
(#2)
Previously It was coming in LG Got Resolved by @pcrepieux but Same binaries which is working fine for LG devices those are not working in Xiaomi.
In Xiaomi It coming as a black screen.

Device Details:-
[ro.product.model]: [Mi 10]
[ro.build.version.incremental]: [V12.0.2.0.QJBINXM]
[ro.build.version.release]: [10]
[ro.build.version.sdk]: [29]
[ro.build.version.security_patch]: [2020-07-01]
[ro.com.google.gmsversion]: [10_202005]
[ro.miui.ui.version.code]: [10]
[ro.miui.ui.version.name]: [V12]

INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:240) Creating SurfaceComposerClient
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:243) Performing SurfaceComposerClient init check
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:254) Creating virtual display
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:260) Creating buffer queue
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:263) Setting buffer options
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:267) Creating CPU consumer
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:271) Creating frame waiter
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:275) Publishing virtual display
Vector<> have different types (this=0x7fd1f95480, rhs=0x73e7b4e030)
aborted

Pixel 3 Android 12 won't connect

not connecting to stf pixel 3 android 12?

updated pixel 3 to android 12 and it stopped working with stf.
What could be the problem?
logs:

Feb 22 16:21:13 stf-1 stf[1352]: 2022-02-22T13:21:13.995Z INF/device:resources:service 13041 [G6NPCV03579485D] Installing STFService
Feb 22 16:21:14 stf-1 stf[1352]: 2022-02-22T13:21:14.909Z FTL/device 13041 [G6NPCV03579485D] Setup had an error PrematureEOFError: Premature end of stream, needed 1 more bytes
Feb 22 16:21:14 stf-1 stf[1352]:     at Socket.<anonymous> (/usr/local/lib/node_modules/@devicefarmer/stf/node_modules/@devicefarmer/adbkit/lib/adb/parser.js:118:32)
Feb 22 16:21:14 stf-1 stf[1352]:     at emitNone (events.js:111:20)
Feb 22 16:21:14 stf-1 stf[1352]:     at Socket.emit (events.js:208:7)
Feb 22 16:21:14 stf-1 stf[1352]:     at endReadableNT (_stream_readable.js:1064:12)
Feb 22 16:21:14 stf-1 stf[1352]:     at _combinedTickCallback (internal/process/next_tick.js:138:11)
Feb 22 16:21:14 stf-1 stf[1352]:     at process._tickCallback (internal/process/next_tick.js:180:9)
Feb 22 16:21:14 stf-1 stf[1352]: 2022-02-22T13:21:14.910Z FTL/util:lifecycle 13041 [G6NPCV03579485D] Shutting down due to fatal error

minicap shared library broken on SDK 31

What is the issue or idea you have?

When running the minicap binary on android 12 beta, we get the following error:

CANNOT LINK EXECUTABLE "/data/local/tmp/minicap": cannot locate symbol "_ZN7android21SurfaceComposerClient23getPhysicalDisplayTokenEm" referenced by "/data/local/tmp/minicap.so"

I had a look into the libgui.so library and the signature of the function is now the following:

android::SurfaceComposerClient::getPhysicalDisplayToken(android::PhysicalDisplayId)

The current minicap_30.cpp is using a int32_t instead of the PhysicalDisplayId type.

Have you tried STF?

[ENHANCEMENT] minicap written in pure public Android Java APIs

I have working project (for Android Q(10) and up) that captures internal audio as well as device screen on android, i dont know the current STF provides streaming internal audio from connected android device to browser app, but i hopefully think that it can be implemented i think

also as far as i read from minicap readme, it says it will be changed with more upstream solution(directly capture android screen via MediaProjection APIs)

socket streaming in android works flawlessly too as you know(based on pure java api)

i can work on this if its worthwhile what do you think, what are the future plans?

cc @sorccu @koral-- @pcrepieux

Error connecting Pixel 4xl Device - applet not found

Unable to connect to Pixel 4XL device. See the command and error output below:

Command:
adb -s 99121FFBA0069C shell CLASSPATH=/data/local/tmp/minicap/minicap-0.8.apk /data/local/tmp/minicap/minicap /system/bin io.devicefarmer.minicap.Main -Q 60 -P 1440x3040@1440x3040/0

What is the issue?
minicap: applet not found

VERSION_CODE: 3
VERSION_NAME: 0.8

Device Information:
Device: Pixel 4XL
Resolution: 1440x3040
Adnroid Version: 11

Screenshot is not possible after executing stf.

I'm setting up stf on a mac.

Screenshot is not possible after executing stf.

stf exe log
스크린샷 2024-01-05 오후 5 41 16

stf screenshot log
스크린샷 2024-01-05 오후 5 26 08
스크린샷 2024-01-05 오후 5 26 43

After downloading minicap, follow the guide

$ git submodule init
$ git submodule update
$ Library/Android/sdk/ndk/25.2.9519653/build/ndk-build
was performed,
$ ./run.sh autosize -t
When you enter the command

**'+ experimental/gradlew -p experimental assembleDebug
Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

  • Where:
    Settings file '/Users/device/Desktop/grip-stf/minicap/experimental/settings.gradle'

  • What went wrong:
    Could not compile settings file '/Users/device/Desktop/grip-stf/minicap/experimental/settings.gradle'.

startup failed:
General error during semantic analysis: Unsupported class file major version 65'**

It's android 13, does rooting need to be done?


stf doctor is
'2024-01-05T08:32:12.122Z INF/cli:doctor 14729 [] OS Arch: arm64
2024-01-05T08:32:12.123Z INF/cli:doctor 14729 [
] OS Platform: darwin
2024-01-05T08:32:12.124Z INF/cli:doctor 14729 [] OS Platform: 23.2.0
2024-01-05T08:32:12.124Z INF/cli:doctor 14729 [
] Using Node 20.10.0
2024-01-05T08:32:12.129Z INF/cli:doctor 14729 [] Using ZeroMQ 4.2.2
2024-01-05T08:32:12.136Z INF/cli:doctor 14729 [
] Using GraphicsMagick 1.3.42
2024-01-05T08:32:12.140Z INF/cli:doctor 14729 [] Using ProtoBuf 3.20.3
2024-01-05T08:32:12.140Z INF/cli:doctor 14729 [
] Using RethinkDB 2.4.4
2024-01-05T08:32:12.142Z INF/cli:doctor 14729 [*] Using ADB 1.0.41'

Minimum required Android version for minicap-kotlin?

Since I am having issues with some devices and the default minicap implementation, I tried minicap-kotlin on an Android 8 device, and couldn't get it working.
Running CLASSPATH=/data/local/tmp/minicap/minicap-kotlin.apk /system/bin/app_process io.devicefarmer.minicap.Main -Q 60 -P 1080x1920@1080x1920/0 just results in an "Aborted" message.

Is there some minimum version requirement?

b'CANNOT LINK EXECUTABLE "/data/local/tmp/minicap": cannot locate symbol "_ZTVN7android13LayerMetadataE" referenced by "/data/local/tmp/minicap.so"...\r\n'

What is the issue or idea you have?
I'm trying to adapt minicap on Android U. At present, I have successfully compiled, but the following error is reported in the actual application.
b'CANNOT LINK EXECUTABLE "/data/local/tmp/minicap": cannot locate symbol "_ZTVN7android13LayerMetadataE" referenced by "/data/local/tmp/minicap.so"...\r\n'

I don't have a clue how to solve this problem, can anyone provide some help

Have you tried STF?

Vector<> have different types —— XIAOMI MI_8 Android 9 (sdk 28)

$ adb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -P 1440x2560@1440x2560/0 -t
PID: 2479
INFO: Using projection 1440x2560@1440x2560/0
INFO: (external/MY_minicap/src/minicap_28.cpp:241) Creating SurfaceComposerClient
INFO: (external/MY_minicap/src/minicap_28.cpp:244) Performing SurfaceComposerClient init check
INFO: (external/MY_minicap/src/minicap_28.cpp:255) Creating virtual display
INFO: (external/MY_minicap/src/minicap_28.cpp:261) Creating buffer queue
INFO: (external/MY_minicap/src/minicap_28.cpp:264) Setting buffer options
INFO: (external/MY_minicap/src/minicap_28.cpp:268) Creating CPU consumer
INFO: (external/MY_minicap/src/minicap_28.cpp:272) Creating frame waiter
INFO: (external/MY_minicap/src/minicap_28.cpp:276) Publishing virtual display
Vector<> have different types (this=0x7fc7d7f700, rhs=0x7fc7d7f820)
Aborted

I alse have this problem, but there is no problem at beginning, after some days it happened, the devices is XIAOMI MI_8 Android 9 (sdk 28)

Need android-31 arm64-v8a.so

@pcrepieux
I need minicap31.so for armv8_64 as I am using vnc. I have intergrated vnc with android-31 arm64-v8a
your current apk approach is not suitalble for me can you provide me android-31 arm64-v8a.so

I will integrate your apk approach later but right now I need minicap.so for android 12 support

Minicap stream gets stuck | DRM protected content

Observations
1 .Playing DRM protected content in Android 10 throws green video panel and continue stream

2.Whereas,In Android 11 the stream get stucks.

Suspect :
Minicap.so file for different SDK and different processor set.

Issue Reproduced Environment :
Device : real time pixel 4a
Process set : arm64-v8a
Os: Android 11

Stream in Android 11 should be rendered as similar to other Android versions without getting stuck.

Destroying virtual display on Samsung Galaxy S4 (GT-I9500)

Periodically (once every 3 runs) the minicap stops working on the Samsung Galaxy S4 (GT-I9500, API level 17).
The service starts, but closes after a couple of seconds.
The log contains only the following information:

INFO: Using projection 1080x1920@1080x1920/0
INFO: (external/MY_minicap/src/minicap_17.cpp:239) Creating SurfaceComposerClient
INFO: (external/MY_minicap/src/minicap_17.cpp:242) Performing SurfaceComposerClient init check
INFO: (external/MY_minicap/src/minicap_17.cpp:249) Creating virtual display
INFO: (external/MY_minicap/src/minicap_17.cpp:255) Creating CPU consumer
INFO: (external/MY_minicap/src/minicap_17.cpp:261) Creating buffer queue
INFO: (external/MY_minicap/src/minicap_17.cpp:267) Creating frame waiter
INFO: (external/MY_minicap/src/minicap_17.cpp:271) Publishing virtual display
INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 6268932 bytes for JPG encoder
INFO: (external/MY_minicap/src/minicap_17.cpp:286) Destroying virtual display

Also, other services not related to the minicap stop working.
At such moments, the logcat contains a lot of the following messages:

D/SensorHubManager( 3815): onGetSensorHubDataLocked: library = 1, 1, 15, 17
D/Sensorhubs( 3543): readContextData: 1, 1, 15, 17
D/SensorHubManager( 3815): onGetSensorHubDataLocked: library = 1, 1, 15, 17
D/Sensorhubs( 3543): readContextData: 1, 1, 15, 17
D/SensorHubManager( 3815): onGetSensorHubDataLocked: library = 1, 1, 15, 17
D/Sensorhubs( 3543): readContextData: 1, 1, 15, 17

Such issues do not arise without running the minicap service on this device.

Have you encountered such issues on the GT-I9500?
How can this be fixed?

Why dose -d parameter have no effects?

What is the issue or idea you have?
I want to use -d to change the screen with displayId, but it didn't change
Have you tried STF?

I use STF, and i just want to change screen with displayId,
there is also anthor issue,but no more answer under it.
please, any body help?

Android 11 support

Hello!
Does minicap support Android 11 devices?
In Read.me says that Android 9 is the highest version, but with my Android 10 devices the minicap works.
Will the minicap build from Master branch works with Android 11 devices?

where is minicap.so for android sdk 33?

i need minicap.so for android sdk 33.
how can i get that file?

I saw #40
I try to use minicap-debug.apk, but the screenshot interval is unstable in different scenarios and the screenshot interval is very long minicap-debug.apk doesn't meet my requirements,So I still need the screenshot of minicap. so for Android sdk 33。Can you help me

Error: "Failed to instantiate [ch.qos.logback.classic.LoggerContext]"

What is the issue or idea you have?
I launch the kotlin version of minicap on an Android 29 AVD (rooted) via this command :

CLASSPATH=/data/local/tmp/minicap/minicap-kotlin2.apk /system/bin/app_process /system/bin io.devicefarmer.minicap.Main -Q 60 -P 800x1280@800x1280/0

...but I get following error:

Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
	at android.os.Environment.getExternalStorageState(Environment.java:1026)
	at ch.qos.logback.core.android.AndroidContextUtil.getMountedExternalStorageDirectoryPath(Unknown Source:0)
	at ch.qos.logback.core.android.AndroidContextUtil.setupProperties(Unknown Source:14)
	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(Unknown Source:12)
	at org.slf4j.impl.StaticLoggerBinder.init(Unknown Source:7)
	at org.slf4j.impl.StaticLoggerBinder.<clinit>(Unknown Source:20)
	at org.slf4j.impl.StaticLoggerBinder.getSingleton(Unknown Source:0)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
	at io.devicefarmer.minicap.provider.BaseProvider.<clinit>(BaseProvider.kt:44)
	at io.devicefarmer.minicap.Main$Companion.main(Main.kt:62)
	at io.devicefarmer.minicap.Main.main(Unknown Source:2)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:338)
PID: 7862
INFO: 800x1280@800x1280/0

Have you tried STF?
Have not tried it in STF.

It seems minicap is started anyway, but this error is breaking my toolchain... Any ideas of what's going on?

the prodoct of xiaomi 10 ,minicap is not work

i rebuild minicap project to android 11,i use docker ro run some server in pc, the phone information is below:

{ serial: '510ac8d4',
platform: 'Android',
manufacturer: 'XIAOMI',
operator: ',**联通',
model: 'Mi 10',
version: '11',
abi: 'arm64-v8a',
sdk: '30',
product: 'umi',
cpuPlatform: 'kona',
openGLESVersion: '3.2',
marketName: 'MI 10',
display:
{ id: 0,
width: 1080,
height: 2340,
xdpi: 386.3659973144531,
ydpi: 386.70098876953125,
fps: 90,
density: 2.75,
rotation: 0,
secure: true,
size: 6.665616096147213,
url: 'ws://10.0.20.158:7428' },
phone: { network: 'UNKNOWN' }

i put some data in stf-device-db, ex:
"Mi_10": {
"cpu": {
"cores": 8,
"freq": "2.84",
"name": "Qualcomm Technologies, Inc SM8250"
},
"date": "2020-05-01T15:00:00.000Z",
"display": {
"h": 2340,
"s": 6.67,
"w": 1080
},
"maker": {
"name": "XIAOMI"
},
"memory": {
"ram": 8192,
"rom": 262144
},
"name": {
"id": "Mi 10",
"long": "Mi 10"
},
"os": {
"type": "android",
"ver": "11"
}
}

the binary minicap tips:

2021-03-03T03:44:35.526Z INF/device:plugins:screen:stream 177 [510ac8d4] Setting frame producer projection to 843x843
2021-03-03T03:44:35.527Z INF/device:plugins:screen:stream 177 [510ac8d4] Requesting frame producer to start
2021-03-03T03:44:35.527Z INF/device:plugins:screen:stream 177 [510ac8d4] Launching screen service
2021-03-03T03:44:35.551Z INF/device:plugins:screen:stream 177 [510ac8d4] minicap says: "PID: 28302"
2021-03-03T03:44:35.551Z INF/device:plugins:screen:stream 177 [510ac8d4] minicap says: "INFO: Using projection 1080x2340@389x843/0"
2021-03-03T03:44:35.552Z WRN/device:plugins:screen:stream 177 [510ac8d4] Shell keeping minicap running ended unexpectedly
2021-03-03T03:44:35.553Z INF/device:plugins:screen:stream 177 [510ac8d4] Connecting to minicap service
2021-03-03T03:44:35.630Z INF/device:plugins:connect 177 [510ac8d4] Listening on port 7413
2021-03-03T03:44:35.631Z IMP/device:plugins:connect 177 [510ac8d4] Remote Connect Started for device "510ac8d4" at "10.0.20.158:7413"
2021-03-03T03:44:37.075Z INF/device:plugins:screen:stream 177 [510ac8d4] Disconnecting from minicap service
2021-03-03T03:44:37.076Z INF/device:plugins:screen:stream 177 [510ac8d4] Stopping minicap service
2021-03-03T03:44:37.077Z FTL/device:plugins:screen:stream 177 [510ac8d4] Frame producer had an error FailError: Failure: 'closed'

so i wnat to debug minicap, do you help me what to do next? thanks.

Minicap for Android 11

What is the issue or idea you have?
stf is not working on Android 11 which requires minicap.so file

Have you tried STF?
Yes. It is not working

May I know, how we can build the so file using AOSP code. Do I need to follow exactly this minicap-shared or is there any other simple way

Right now android-r-beta-2 is available
openstf#208

Tried new approach on Android 12 beta-1

What is the issue or idea you have?

Have you tried STF?

@pcrepieux I have tried new approach which you have provided Experimental ([#12)] on Google Pixel 3XL (#12) which is not working. I know it's in beta version but still I gave it a try and getting below stats

1:- adb shell CLASSPATH=/data/local/tmp/minicap-0.1-debug.apk app_process /system/bin io.devicefarmer.minicap.Main
PID: 6057
Listening on minicap
createDisplay
Killed (getting only Killed nothing else not much data to debug)

2:- node app.js
Listening on port 9002
Got a client
chunk(length=24)
banner { version: 1,
length: 24,
pid: 6057,
realWidth: 1440,
realHeight: 3040,
virtualWidth: 1440,
virtualHeight: 3040,
orientation: 0,
quirks: 2 }
Lost a client
Got a client

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.