Giter VIP home page Giter VIP logo

com.example.vcam'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

com.example.vcam'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

com.example.vcam's Issues

Audio plays through speaker, not through mic

hey I am hoping the audio from the video I use can play directly into the microphone, instead of into the speaker, and then I can mute my real microphone, is that possible? Right now it picks up so much background noise

dingtalk 6.0.15 照片替换问题

dingtalk 6.0.15中 可能被远程施法,之前一直能使用,这几天不能使用,表现为
1,照片1000.bmp存在时,不能替换,
2,视频virtual.mp4 会直接预览视频,点击拍照就是视频中的画面,而不是1000.bmp的画面
烦请大佬看看什么原因
支付宝替换1000.bmp是没有问题的

ANYONE HELP I PAY

@karmaisback1 Telegram plz seriously
Problem number 1
when i put video virtual.mp4 on dcmi/camera1. and target any apps. working good ..but the problem is sound video and when i videocall on whatsapp for test .. when I start doing the test I see that the video is displayed very well, but its music is not heard..the moment the camera opens, the phone's microphone comes into play...the music of the video is not heard... but my voice is heard..I don't know if I'm clear.
Problem number 2
When i use image 1000.bmp and when i put in camera1 and on target apps still not working ,, i convert image to jpg to bmp. still not working .... i want the proces to use image on front camera and back camera ..!!!!!

Cannot read QR code from video

The app works flawlessly for me and the mock video shows up as the camera view. At that point, the app is supposed to read a QR code from the camera view, but it doesn't seem to work when the qr code is shown virtually. Is there a solution for this?

VCAM IOS

Hey guys, i have found a similar version for virtual camera that works on iphone.

I have made a telegram chanel to show some demos and talk about it.

https://t.me/imageswap

Add an option for hiding icon launcher

Hi having an option for hiding the launcher it's necessary for some user especially that now we can bypass hiding icon from Android Q 10 and also enter module setting inside Lsposed Manager itself as a organized person i prefer having all my modules inside lsposed and be able to configure them there too the icon in the launcher isn't necessary because once you configured the module you don't need to open the module as a daily basis like other app, also basically you can just enter the module settings in Lsposed, so i hope you consider adding it

camera2 take photo error

the producer output buffer format 0x7fa30c04 doesn't match the imagereader's configured buffer format 0x21

MP4 works not correctly

Can anyone explain what I need fix in video file .mp4.
Below will be LSposed log :

【VCAM】帧预览回调初始化:宽:3168 高:1440 帧率:10
【VCAM】4参数拍照
【VCAM】第二个jpeg:com.onfido.android.sdk.capture.ui.camera.view.CameraSource$PictureDoneCallback@8919cf9
【VCAM】JPEG拍照回调初始化:宽:3168高:1440对应的类:android.hardware.Camera@d287c7f
【VCAM】java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference
【VCAM】[record]com.swissborg.android
【VCAM】帧预览回调初始化:宽:3168 高:1440 帧率:10
Loading module com.example.vcam from /data/app/~~-bqkxgODW2ZObvSWcJcCsQ==/com.example.vcam-9DNddt6Xk2bjpxMWDAxTRA==/base.apk
Loading class com.example.vcam.HookMain
【VCAM】创建预览
【VCAM】开始预览
【VCAM】帧预览回调初始化:宽:3168 高:1440 帧率:10
【VCAM】【decoder】开始解码
【VCAM】【decoder】set decode color format to type 2135033992
【VCAM】4参数拍照
【VCAM】第二个jpeg:com.onfido.android.sdk.capture.ui.camera.view.CameraSource$PictureDoneCallback@a48f65c
【VCAM】JPEG拍照回调初始化:宽:3168高:1440对应的类:android.hardware.Camera@e347a3a
【VCAM】java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference
【VCAM】创建预览
【VCAM】开始预览
【VCAM】[record]com.swissborg.android
Crash unexpectedly: java.lang.RuntimeException: getParameters failed (empty parameters)
at android.hardware.Camera.native_getParameters(Native Method)
at android.hardware.Camera.getParameters(Camera.java:2114)
at com.onfido.android.sdk.capture.ui.camera.view.CameraSource.getPictureSize(Unknown Source:4)
at com.onfido.android.sdk.capture.ui.camera.view.CameraSource.getPictureDimension(Unknown Source:0)
at com.onfido.android.sdk.capture.ui.camera.view.CameraSourcePreview.onLayout(Unknown Source:14)
at android.view.View.layout(View.java:23203)
at android.view.ViewGroup.layout(ViewGroup.java:6412)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:23203)
at android.view.ViewGroup.layout(ViewGroup.java:6412)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1103)
at android.view.View.layout(View.java:23203)
at android.view.ViewGroup.layout(ViewGroup.java:6412)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:23203)
at android.view.ViewGroup.layout(ViewGroup.java:6412)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
at android.view.View.layout(View.java:23203)
at android.view.ViewGroup.layout(ViewGroup.java:6412)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at android.view.View.layout(View.java:23203)
at android.view.ViewGroup.layout(ViewGroup.java:6412)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
at android.view.View.layout(View.java:23203)
at android.view.ViewGroup.layout(ViewGroup.java:6412)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:797)
at android.view.View.layout(View.java:23203)
at android.view.ViewGroup.layout(ViewGroup.java:6412)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3755)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3205)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2179)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8793)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1037)
at android.view.Choreographer.doCallbacks(Choreographer.java:845)
at android.view.Choreographer.doFrame(Choreographer.java:780)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Can't take picture in Virtual.mp4

Targeted app doesn't pick picture from camera1 directory, so tried virtual.mp4 to take picture, but it didn't work for me . Could you please help , and also tell me how I can report logs of targeted app as well as repo .

Virtual camera not using specified image from /Camera1/ folder when taking photo

The virtual camera(video) is working properly, but when I try to take a photo, it simply takes a regular picture using my default camera instead of using the image I placed under the /[INTERNAL_STORAGE]/DCIM/Camera1/ folder. I followed the guide's instructions and renamed the file to 1000.bpm, but it still isn't working.

视频黑屏

3.4版本能使用的视频,18-3.5版本黑屏,在应用目录和DCIM目录下都复制了一份,应用目录文件夹里多了一个has_shown.jpg,读取权限都开了的

Vcam not using picture in /Storage/DCIM/Camera1

Good day!

I am not able to get the module working. I resize the image, renamed it to 1000.bmp and placed it inside /Storage/DCIM/Camera1 or /Storage/Android/Data/[package name]/Files/Camera1 folder 📂. The target app has access to storage.

Really looking forward for a response.

Thanks!

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.