Giter Club home page Giter Club logo

remotecam's Introduction

About

  • Software engineer
  • Serial startup co-founder for 7 years
  • Now tech consultant

Looking for work !

Tech skills used professionally

- Rust         ⭐⭐⭐
- Javascript   ⭐⭐⭐
- Game dev     ⭐⭐⭐
- Webgl/Opengl ⭐⭐⭐
- Mithril.js   ⭐⭐⭐
- SQL          ⭐⭐
- Google Cloud ⭐⭐
- Python       ⭐⭐
- React        ⭐⭐
- Scala        ⭐⭐
- Kotlin       ⭐
- C            ⭐
- C#           ⭐
- Linux        ⭐
- VR/AR        ⭐    

CV/Resume Français

CV/Resume English

remotecam's People

Contributors

ruddle avatar sherlockgougou 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

remotecam's Issues

Crash on start

Crashed on start on HUAWEI phone
I got this as the crash log:

08-30 20:37:12.392 17700 17700 E AndroidRuntime: FATAL EXCEPTION: main
08-30 20:37:12.392 17700 17700 E AndroidRuntime: Process: com.samsung.android.scan3d, PID: 17700
08-30 20:37:12.392 17700 17700 E AndroidRuntime: java.lang.RuntimeException: Unable to start service com.samsung.android.scan3d.serv.Cam@3a2c271 with Intent { act=start_camera_engine cmp=com.samsung.android.scan3d/.serv.Cam }: java.lang.NullPointerException
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4971)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at android.app.ActivityThread.access$3300(ActivityThread.java:260)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2486)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:110)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:219)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8668)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
08-30 20:37:12.392 17700 17700 E AndroidRuntime: Caused by: java.lang.NullPointerException
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at com.samsung.android.scan3d.serv.CamEngine.updateView(CamEngine.kt:310)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at com.samsung.android.scan3d.serv.CamEngine.initializeCamera(CamEngine.kt:296)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at com.samsung.android.scan3d.serv.CamEngine$initializeCamera$1.invokeSuspend(Unknown Source:14)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at com.samsung.android.scan3d.serv.Cam.onStartCommand(Cam.kt:98)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4951)
08-30 20:37:12.392 17700 17700 E AndroidRuntime:        ... 8 more

And this log may help:

08-30 20:34:46.531  1001  1528 E DE N ABT: mergeProcessorOperatingNormal:1523: COMPONENT_GMP already has data, can't add new data with MODE_COLOR_ENHANCE, mode:MODE_CAMERA|MODE_COLOR_ENHANCE|0x900->MODE_CAMERA|MODE_COLOR_ENHANCE|0x900

versioning issue

I just noticed that the APKs from each release identify as

package: name='com.samsung.android.scan3d' versionCode='1' versionName='1.0.0'

despite according to the tag names, none of them is v1.0.0 yet – and only one of them should be versionCode='1' (the first release ever). Could you please take care for versioning? It's hard to tell the APKs apart, to know which one is installed – and with versionCode never being increased, for Android to decide if an APK contains an update (it argues it does not but is the very same version already installed, thus also no update notifications).

Thanks in advance!

Crash on Pixel 7 upon startup

Whenever I open up the app I get this crash immediately on my pixel 7. I have tried both the Fdroid build, as well ae the github build posted on this repo and I get the same error.

type: crash
osVersion: google/panther/panther:13/TQ3A.230805.001/2023080800:user/release-keys
package: com.samsung.android.scan3d:4
process: com.samsung.android.scan3d
processUptime: 199 + 310 ms
installer: io.github.muntashirakon.AppManager

java.lang.RuntimeException: Unable to start service com.samsung.android.scan3d.serv.Cam@fc5514b with Intent { act=start_camera_engine cmp=com.samsung.android.scan3d/.serv.Cam }: java.lang.NullPointerException
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4690)
	at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2186)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7940)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ExecInit.main(ExecInit.java:49)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
Caused by: java.lang.NullPointerException
	at com.samsung.android.scan3d.serv.CamEngine.updateView(CamEngine.kt:310)
	at com.samsung.android.scan3d.serv.CamEngine.initializeCamera(CamEngine.kt:296)
	at com.samsung.android.scan3d.serv.CamEngine$initializeCamera$1.invokeSuspend(Unknown Source:14)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
	at com.samsung.android.scan3d.serv.Cam.onStartCommand(Cam.kt:98)
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4672)
	... 11 more

Package name

The package name is com.samsung.android.scan3d.
It is because Samsung only allow use of the telephoto camera to its own apps. Reusing their package name tricks android into giving access.
Ideally RemoteCam would use a unique package name.
I am all ears if anyone has a better solution.

Camera through USB?

Hi,
Thanks for this app! Works very well via network, although with some lag of course. I've never used DroidCam, but I understand that it can use the phone's camera through USB as well.
Can this be implemented in RemoteCam? Would it eliminate the lag entirely? Or maybe it can be done via ADB and/or scrcpy or something like that?

java.lang.IllegalArgumentException: Surface was abandoned

for some reason the surface is abandoned, a simple retry fixes the problem

    private suspend fun createCaptureSession(
        device: CameraDevice, targets: List<Surface>, handler: Handler? = null
    ): CameraCaptureSession? = suspendCoroutine { cont ->
        if (targets.any {
            !it.isValid
            }) {
            // re-initialize the camera
            Log.w("CamEngine", "Invalid surface targets, re-initializing camera")
            cont.resume(null);
            return@suspendCoroutine
        }
  // .....


		session = createCaptureSession(camera, targets, cameraHandler)
        if (session == null) {
            Log.i("CAMERA", "session is null")
            return initializeCamera();
        }

imageReader.acquireNextImage failed with ACQUIRE_MAX_IMAGES

It's clear that there are leaked image instances (not closed after use) but I didn't figure out where.

Replacing CamEngine.kt Line 230

var lastImg = imageReader.acquireNextImage()

with

var lastImg = imageReader.acquireLatestImage()

can be a temporary workaround for the issue, but we'd better find out where the images leaked.

Certificate issue

A scan (see here for details and background) just revealed the APKs at your releases are signed using a debug key. As that has security implications, may I ask you to please switch to a proper release key, and provide the corresponding APK signed with it? Thanks in advance!

Restart on orientation change

When screen changes orientation on Android 12 @ Pixel 3 XL with RemoteCam's activity in focus, RemoteCam v0.0.4 seems to restart: foreground notification is re-shown (with a sound), settings get reset, remote connections get disconnected.

If you don't want to properly deal with orientation then at least lock it with android:screenOrientation="portrait".

NULL IP

When I am staring the app and string streaming , in the IPs section it is showing
null:8080/cam.mjpeg

App Crash on Start

App Crash on Start

12-11 22:57:34.527 18686 18686 E AndroidRuntime: FATAL EXCEPTION: main
12-11 22:57:34.527 18686 18686 E AndroidRuntime: Process: com.samsung.android.scan3d, PID: 18686
12-11 22:57:34.527 18686 18686 E AndroidRuntime: java.lang.RuntimeException: Unable to start service com.samsung.android.scan3d.serv.Cam@a427085 with Intent { act=start_camera_engine cmp=com.samsung.android.scan3d/.serv.Cam }: java.lang.NullPointerException
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5286)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2531)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:230)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:319)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:8893)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: Caused by: java.lang.NullPointerException
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at com.samsung.android.scan3d.serv.CamEngine.updateView(CamEngine.kt:310)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at com.samsung.android.scan3d.serv.CamEngine.initializeCamera(CamEngine.kt:296)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at com.samsung.android.scan3d.serv.CamEngine$initializeCamera$1.invokeSuspend(Unknown Source:14)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at com.samsung.android.scan3d.serv.Cam.onStartCommand(Cam.kt:98)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5268)
12-11 22:57:34.527 18686 18686 E AndroidRuntime: 	... 9 more

Phone: Samsung Galaxy S22 Ultra
OS: Android 14

redirect to Webcam (virtual) in Firefox

I finally managed, inspired by the remote sh file, to get a virtual webcam to work properly in Firefox or Brave, so thanks to the dev. My PC has by default no webcam or video device.

  1. $ sudo modprobe -r v4l2loopback
  2. $ sudo modprobe v4l2loopback video_nr=0 card_label="Webcam" exclusive_caps=1
  3. Check with $ v4l2-ctl --list-devices which gives:
    Webcam (platform:v4l2loopback-000):
    /dev/video0
  4. $ ffmpeg -hide_banner -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -timeout 30000000 -stream_loop -1 -f mjpeg -i "http://192.168.0.128:8080/cam.mjpeg" -vf "format=yuv420p, transpose=1, fps=25" -f v4l2 /dev/video0

And it works great. Thanks again.

Win10 can't download mjpeg stream as mp4 using ffmpeg

I use the Windows 10 operating system, I copied the ip address in the app and opened it on my computer's browser and it worked fine,and I use the following command in the cmd window:
ffmpeg -i http://192.168.1.100:8080/cam.mjpeg -c:v libx264 -crf 23 output.mp4

20230824093239

It can't save the mjpeg as an mp4 video, I just get a 25kb output.mp4, it's not able to play, it's just a frame.

How should I operate so that the video shot on the mobile phone can be transmitted to the computer in real time and saved as mp4 ?

I can't fix the issue

it could make project
but when run, it shows:
Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.2.0-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0) and lifecycle-viewmodel-2.4.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.4.0)
Duplicate class androidx.lifecycle.ViewModelProviderKt found in modules jetified-lifecycle-viewmodel-ktx-2.2.0-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0) and lifecycle-viewmodel-2.4.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.4.0)

Go to the documentation to learn how to Fix dependency resolution errors.
Could you explain how to design it?
I could run cameraXApp,
https://github.com/liwenz/CameraXApp

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.