Giter VIP home page Giter VIP logo

android_virtual_cam's Introduction

android_virtual_cam

简体中文 | 繁體中文 | English

基于Xposed的虚拟摄像头

请勿用于任何非法用途,所有后果自负。

**大陆加速地址(Gitee平台): https://gitee.com/w2016561536/android_virtual_cam

支持平台:

  • 安卓5.0+

使用方法

  1. 安装此模块,并在Xposed中启用此模块,Lsposed等包含作用域的框架需要选择目标app,无需选择系统框架。

  2. 在系统设置中,授予目标应用读取本地存储的权限,并强制结束目标应用程序。若应用程序未申请此权限,请见步骤3。

  3. 打开目标应用,若应用未能获得读取存储的权限,则会以气泡消息提示,Camera1目录被重定向至应用程序私有目录/[内部存储]/Android/data/[应用包名]/files/Camera1/。若未提示,则默认Camera1目录为/[内部存储]/DCIM/Camera1/。若目录不存在,请手动创建。

注意:私有目录下的Camera1仅对该应用单独生效。

  1. 在目标应用中打开相机预览,会以气泡消息提示“宽:……高:……”,需要根据此分辨率数据制作替换视频,放置于Camera1目录下,并命名为virtual.mp4,若打开相机并无提示消息,则无需调整视频分辨率。

  2. 若在目标应用中拍照却显示真实图片,且出现气泡消息发现拍照和分辨率,则需根据此分辨率数据准备一张照片,命名为1000.bmp,放入Camera1目录下(支持其它格式改后缀为bmp)。如果拍照时无气泡消息提示,则1000.bmp无效。

  3. 如果需要播放视频的声音,需在/[内部存储]/DCIM/Camera1/目录下创建no-silent.jpg文件。(全局实时生效)

  4. 如果需要临时停用视频替换,需在/[内部存储]/DCIM/Camera1/目录下创建disable.jpg文件。(全局实时生效)

  5. 如果觉得Toast消息烦,可以在/[内部存储]/DCIM/Camera1/目录下创建no_toast.jpg文件。(全局实时生效)

  6. 目录重定向消息默认只显示一次,如果错过了目录重定向的Toast消息,可以在/[内部存储]/DCIM/Camera1/目录下创建force_show.jpg文件来覆盖默认设定。(全局实时生效)

  7. 如果需要为每一个应用程序分配视频,可以在/[内部存储]/DCIM/Camera1/目录下创建private_dir.jpg强制使用应用程序私有目录。(全局实时生效)

注意:6~10的配置开关均在应用程序中,您可以快捷地在应用程序中配置,也可以手动创建文件。

常见问题

A1. 前置摄像头方向问题?
Q1. 大多数情况下,替换前置摄像头的视频需要水平翻转并右旋90度,并且视频处理后的分辨率应与气泡消息内分辨率相同。但有时这并不需要,具体请根据实际情况判断。

Q2. 画面黑屏,相机启动失败?
A2. 目前有些应用并不能成功替换(特别是系统相机)。或者是因为视频路径不对(是否创建了两级Camera1目录,如./DCIM/Camera1/Camera1/virtual.mp4,但只需要一级目录)。

Q3. 画面花屏?
A3. 视频分辨率不对。

Q4. 画面扭曲,变形?
A4. 请使用剪辑软件修改原视频来匹配屏幕。

Q5. 创建disable.jpg无效?
A5. 如果应用版本<=4.0,那么[内部存储]/DCIM/Camera1目录下的文件对具有访问存储权限的应用生效,其余无权限应用应在私有目录下创建
如果应用版本>=4.1,那么应在[内部存储]/DCIM/Camera1创建,无论目标应用是否具有权限。

反馈问题

请直接在issues中反馈,如果为BUG反馈,请附带Xposed模块日志信息。

致谢:

提供HOOK思路: https://github.com/wangwei1237/CameraHook

H264硬解码: https://github.com/zhantong/Android-VideoToImages

JPEG转YUV: https://blog.csdn.net/jacke121/article/details/73888732

android_virtual_cam's People

Contributors

bad-copy avatar david082321 avatar w2016561536 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  avatar  avatar  avatar  avatar  avatar  avatar

android_virtual_cam's Issues

wei

微信8.0.15,按要求操作,扫一扫可以显示视频,但是扫不了视频里面的二维码,支付宝却可以扫到视频里面的码。微信拦截拍照照片,照片改成1000.bmp,分辨率改成1280x720,一直没拦截成功过。

分辨率问题

大神你好,在放入virtual.mp4文件后提示需要匹配分辨率,宽960,高720,在更改完分辨率之后,依然提示

需要针对视频校验app的改进建议。

有些做人脸验证的app的,在视频播放时,会连续拍摄多张照片,然后比对这几张照片,如何发现都是相同的那张1000.bmp,肯定就被判定为作弊了。 能否改进下功能,可以放入多张静态图片的,比如 1001.bmp 1002.bmp 1003.bmp 然后每次发现拍照时候循环读,这样就能解决app连续拍摄多张照片的困局了。

外勤365怎么hook

打开就是提示不存在替换视频,然后加了个视频,直接app就卡死了,然后就是我这个app只想替换照片该怎么去操作,

问题

快手花屏,抖音视频反转是怎么回事?

Virtual photo not showing in Bumble and Snapchat

Thank you very much for your excellent work! I've been looking for such an app for a very long time!
I want to use it on Bumble for live photo verification - it works perfectly in Telegram, but when I try to take a photo in Bumble (https://play.google.com/store/apps/details?id=com.bumble.app&hl=de&gl=US) or Snapchat, it doesn't implement the 1000.bmp and takes a real - not virtual - picture.
Is there a way to get it work? Any tips would be highly appreciated!

Thanks in advance.
Louis

Triggering read

Thank you for this great module.......

I got a qr-reading app, replacing input works and displays correct image but it does not 'trigger' the app to decode the qr.

Any idea how to activate the triggering?

感谢你的代码库
我现在有个问题如下:我有一个gr-reading app, 二维码可以不用扫描 然后直接播放一个二维码的视频来代替, 这个正常运行,但它然后好像就不行激活app来解析二维码。简单来说,它识别到了二维码,但是不知道怎么去处理二维码。

请问怎么样才能让app来解析和处理二维码?提前感谢

微信扫一扫可以识别了

微信扫一扫,二维码,可以识别了,分辨率要一致。
支付宝就不用 匹配分辨率,就可以识别。目前比较好用

Samsungs problem

Not working on samsungs all Android versions, xiaomi, honor and other is ok, but when use on sams apps is crushed😭😫in logs writing thread loop

已知问题

CameraX库在安卓9.0上,由于自动选取最新API,导致配置时相机没有被HOOK到,将“尝试”在下个版本修复。(改了不是一点东西)

也包括完全按照谷歌规定,使用Camera2的库,但使用最新API的应用程序,导致报告打开相机失败的情况。

安卓11微信无法直接读取data文件夹下文件

已经在气泡提示的
/storage/emulated/0/Android/data/com.tencent.mm/files/Camera1/

新建camera1文件夹且放入virtual.mp4文件
但由于安卓11的缘故 微信依然无法读取到
请问这种情况怎么解决..
在特殊应用权限的访问所有文件里
也没能找到微信进行授予权限

video playback problem on meet gmail

Vcam v3.0 | Virtual cam meet on gmail, i have 2 minutes video but the video does not play full video, the video only plays for 13 seconds and then returns to the beginning, After looping the third time the video will be stuck and the camera will automatically turn off, And while i turn camera back on the virtual cam only appears for 1 second and camera automatically turn back off, I have screen record the problem, here is the link https://drive.google.com/file/d/1mj3o_kne-9zhKHQ_sh9KsQPGSIbEQUKx/view

And on chrome the camera is black?
Screenshot_20210922-161155873

Does this problem occur on your phone?

能不能只用于微信呢

能不能只用于微信呢,防止其他应用无法使用相机功能,并且关闭后就不要提示信息什么的了

手机启动不了

试了几个手机激活以后都卡在开机界面,不能开机
红米5 plus
华为p10
oppo r9s

如果直接选择照片就好了

首先感谢大佬的模块
拍照后能直接去选择照片就好了
还有就是有1000.bmp在的情况下,创建disable.jpg,还是hook相机,是钉钉

安装闪退

没有安卓11可用的版本,小米9安装不上,安装阶段直接闪退

帧预览回调bug

在我尝试hook QQ的预览回调时,发现qq捕获了这样一张照片Screenshot_20210824-190028_QQ.jpg
上半部分是hook的结果,下半部分是真实照片
猜测可能与文件读取IO堵塞有关(但不清楚为啥别的app没这个bug)

setPreviewTexture处理有遗漏

setPreviewTexture传入的参数可能是null(Android 6.0.1):
android/hardware/camera2/legacy/RequestThreadManager.java
在configureOutputs函数中有如下代码片段:
try { mCamera.setPreviewTexture(/*surfaceTexture*/null); } catch (IOException e) { Log.w(TAG, "Failed to clear prior SurfaceTexture, may cause GL deadlock: ", e); } catch (RuntimeException e) {
这样就会造成HookMain.msurf = new Surface(HookMain.msurftext);抛出异常IllegalArgumentException

能屏蔽麦克风不

某些软件里想要他只播放视频的声音即可,不用把环境音也录进去

Doesn't work in Bluestack emulator

Android 7.1 & Xposed: Tested with system camera and code scanner in via explorer. The former one throws an error and the latter one scans a black scene.
A toast threw, with resolution information, when the first time I used it. However, the toast never appeared though the virtual.mp4 was deleted in the rest times.

声音没有停止

无休止地播放抖音中的声音,只有在你关闭应用程序时才会停止。xiaomi redmi note7 android 10

新功能

截图可以进行hook替换吗,对付一些流氓软件

能不能做一个视频切换的小工具

我在B站上看到了有人发布视频切换的小工具,我感觉那个小工具并不完善,还有些问题想请教,我在B站上给您私信了,看一下。有项目想对接下。

app crashes

Hi. When the application asks for camera it freezes and crashes. the resolution shows 1440x1080 i put the correct mp4 and bmp there and it crashes. i tried a bunch of pictures however same result. perhaps the problem is that it uses different camera api? i also tried to put disable.jpg, still same result. just oval field for face and dark screen then crash. please help what can be wrong. whatsapp works properly

视频不存在

3.4正常,3.5,3.6提示视频不存在,但是Camera1文件夹我根本就没动,卸载重新安装3.4,又能正常使用。

app内点击拍照无法做到截取视频中的一帧

例子(类似app要求通过相机实时拍一张身份证上传):app已经读取到了virtual.mp4,然后点击拍照,期望是app获取到点击拍照那一刻视频中的那一帧,结果是拍到的是真实照片。然后我按照guide放入一张1000.bmp,重复上述步骤,结果是app获取到了1000.bmp(并且是水平翻转的)
期望:用户能将virtual.mp4中的任意一帧作为拍照结果让app识别。

关于1000.bmp的问题。

您好,钉钉模拟拍照调用1000.bmp的时候,拍摄出来的图片自动向右旋转了90度,除非把1000.bmp的原图向左旋转90度保存,钉钉拍出来才是正的。除了手动将原图向左旋转90度以外,源码该修改哪儿才可以不用将调用的图片左旋转90度呢??望指点。。

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.