VirtualCamera

安卓虚拟摄像头 android virtual camera

具体的使用方法(English version is below):

1、安装xposed框架(传统xposed,edxp,lsposed等均可,不确定虚拟框架能否使用,已经确定VMOS可用,应用转生不可用)
2、安装模块,启用模块,lsposed等包含定义域的框架需要选勾目标app,但无需选勾系统框架。
3、将需要替换的视频命名为 virtual.mp4 ,放在 /sdcard/DCIM/Camera1/ 目录下。(前置摄像头需要水平翻转后右旋90°保存,onPreviewFrame需要匹配分辨率)
4、若需要拦截拍照事件,请在 /sdcard/DCIM/Camera1/ 目录下放置 1000.bmp 用于替换,(前置摄像头需要水平翻转后右旋90°保存,需要匹配分辨率)
5、**授予目标应用读取本地文件的权限,至少是允许读取媒体文件。**
6、强制结束目标应用/重启手机。

如何获得分辨率??(仅拦截onPreviewFrame和拍照需要,其它系统自动处理)
在目标应用中打开摄像头,可在弹出的toast消息里看见。

Camera2接口有问题??
是的,目前Camera2接口的HOOK不是所有应用程序都能生效,部分app报错打开相机失败,如果想停用Camera2接口的HOOK,可在 /sdcard/DCIM/Camera1/ 下创建 disable.jpg ,以停用此项HOOK

我不需要静音??
在 /sdcard/DCIM/Camera1/ 下创建 no-silent.jpg ,就不会静音了。

开源地址 : https://github.com/w2016561536/android_virtual_cam

Detailed usage :

1. Install this moudle. enable it in Xposed. Framework which has a scope list need to choose target app, but needn't to choose system framework.
2. Create virtual.mp4 and put it under /sdcard/DCIM/Camera1/ ,(if use front camera ,image should be Flip horizontal and right rotation 90 degrees, if you want to hook onPreviewFrame ,the resolution should be matched)
3. If you wants to hook image capture event, you should create 1000.bmp under /sdcard/DCIM/Camera1/ for replace. (if use front camera ,image should be Flip horizontal and right rotation 90 degrees, the resolution should be matched)
4. authorize the target app to access local storage in system.
5. Reboot your phone or shutdown target app.

bugs with camera2 api, need to disable it?
create disable.jpg under /sdcard/DCIM/Camera1/ to disable this method hook.

how to get resolution ??(only hook onPreviewFrame and image capture need it)?
open camera in target app, and you can find resolution in toast message.

Needn't mute?
Create no-silent.jpg under /sdcard/DCIM/Camera1/ , and it will play sounds.

open source repo link : https://github.com/w2016561536/android_virtual_cam

有bug、疑问请直接在issue中提出(bug, question can be raised in issue)

请勿用于违法用途,所有后果自负!!!
DO NOT USE FOR ANY ILLEAGLE INTENTION!!YOU NEED TO TAKE ALL RESPONSIBILITY AND CONSEQUENCE!!"

Author(s): 
Package: 
com.example.vcam
Version name: 
3.2
Release type: 
Stable (low risk of bugs)
Download: 
Number of downloads: 
47 in total · 46 in the last 24 hours
MD5 checksum: 
cbe72c92286d8ed21153f17071297531
Uploaded on: 
Saturday, September 25, 2021 - 15:50
Changes: 

优化camera2

optimize camera2 API

Version name: 
3.1
Release type: 
Stable (low risk of bugs)
Download: 
Number of downloads: 
8 in total · 2 in the last 24 hours
MD5 checksum: 
a3890f1b4ca705b1c6a89b368047e750
Uploaded on: 
Saturday, September 25, 2021 - 13:14
Changes: 

优化camera2

optimize camera2 API

Version name: 
3.0
Release type: 
Stable (low risk of bugs)
Number of downloads: 
122 in total · 2 in the last 24 hours
MD5 checksum: 
c0ade04d0fd671da3a35a6ac1708a39b
Uploaded on: 
Friday, September 17, 2021 - 19:02
Changes: 

修复bug,优化camera接口

fix bugs ,polish camera api

Version name: 
2.9
Release type: 
Stable (low risk of bugs)
Number of downloads: 
16 in total · 0 in the last 24 hours
MD5 checksum: 
42054ef87ab03bfdf41618241620e3ed
Uploaded on: 
Friday, September 17, 2021 - 14:17
Changes: 

解决一些应用程序在结束预览后闪退
在结束预览后自动关闭声音

fix some apps get crash when stop preview
automatically stop sounds playing when stop preview

Version name: 
2.8
Release type: 
Stable (low risk of bugs)
Download: 
Number of downloads: 
156 in total · 0 in the last 24 hours
MD5 checksum: 
f7d5908657e17fce9a94aaa9fcb1cd34
Uploaded on: 
Monday, September 13, 2021 - 16:48
Changes: 

解决一些应用程序闪退问题

solve some crash problems

Version name: 
2.7
Release type: 
Stable (low risk of bugs)
Download: 
Number of downloads: 
54 in total · 0 in the last 24 hours
MD5 checksum: 
ab865a93964e31085a4f878b16b08a23
Uploaded on: 
Sunday, September 12, 2021 - 16:39
Version name: 
2.6
Release type: 
Stable (low risk of bugs)
Download: 
Number of downloads: 
55 in total · 0 in the last 24 hours
MD5 checksum: 
1bccfeaa6a75fe404ed0fdd29a79b64a
Uploaded on: 
Saturday, September 11, 2021 - 18:01
Changes: 

修复部分Camera2 bug
解决Surface冲突引起的重音问题

repair some Camera2's bugs
Solve stress problems caused by surface conflicts

Version name: 
2.5
Release type: 
Stable (low risk of bugs)
Download: 
Number of downloads: 
136 in total · 0 in the last 24 hours
MD5 checksum: 
00aeb795bf039373f287720bcbe51f99
Uploaded on: 
Friday, September 17, 2021 - 19:02
Changes: 

合并不静音分支的功能