[GH-ISSUE #57] Set webcam as camera (webcam0) #45

Closed
opened 2026-03-01 15:39:37 +03:00 by kerem · 3 comments
Owner

Originally created by @zoutepopcorn on GitHub (Jan 3, 2018).
Original GitHub issue: https://github.com/budtmo/docker-android/issues/57

It would be nice to connect a webcam (or fake stream) to the android device.

I thing it could be done by adding

hardware.camera.back=webcam0
hardware.camera.front=none

to the /emulator/config.ini

It seems that docker under linux will provide /webcam/video0, and I was able to make an image with fswebcam. Now also the emulator flag looks good.

root@3d6542be84eb:~# emulator -webcam-list
List of web cameras connected to the computer:
 Camera 'webcam0' is connected to device '/dev/video0' on channel 0 using pixel format 'YUYV'

So when I edit the config.ini it was overwritten. My python skills are not so good, but I assume app.py is overwriting the config.ini.

    with open(config_path, 'a') as file:
        file.write('skin.path={sp}'.format(sp=skin_path))
    logger.info('Skin was added in config.ini')

Also I was wondering, howto keep your old emulator instead of starting a new one, when docker is rebooting..

Originally created by @zoutepopcorn on GitHub (Jan 3, 2018). Original GitHub issue: https://github.com/budtmo/docker-android/issues/57 It would be nice to connect a webcam (or fake stream) to the android device. I thing it could be done by adding ``` hardware.camera.back=webcam0 hardware.camera.front=none ``` to the /emulator/config.ini It seems that docker under linux will provide /webcam/video0, and I was able to make an image with fswebcam. Now also the emulator flag looks good. ``` root@3d6542be84eb:~# emulator -webcam-list List of web cameras connected to the computer: Camera 'webcam0' is connected to device '/dev/video0' on channel 0 using pixel format 'YUYV' ``` So when I edit the config.ini it was overwritten. My python skills are not so good, but I assume app.py is overwriting the config.ini. ``` with open(config_path, 'a') as file: file.write('skin.path={sp}'.format(sp=skin_path)) logger.info('Skin was added in config.ini') ``` Also I was wondering, howto keep your old emulator instead of starting a new one, when docker is rebooting..
kerem 2026-03-01 15:39:37 +03:00
Author
Owner

@budtmo commented on GitHub (Jan 3, 2018):

Hi @zoutepopcorn ,

Could you explain it why do you need webcam like what is use case / test do you want to perform? because I think for some cases there is a workaround by storing the picture and use it in the test.

Regarding the question that you asked, starting new container will give you always new emulator. if you want to reuse that emulator, you don’t need to delete the old container. I hope it answers your question.

you can also join our group https://gitter.im/butomo1989/docker-android if you have other question in future.

<!-- gh-comment-id:355058345 --> @budtmo commented on GitHub (Jan 3, 2018): Hi @zoutepopcorn , Could you explain it why do you need webcam like what is use case / test do you want to perform? because I think for some cases there is a workaround by storing the picture and use it in the test. Regarding the question that you asked, starting new container will give you always new emulator. if you want to reuse that emulator, you don’t need to delete the old container. I hope it answers your question. you can also join our group https://gitter.im/butomo1989/docker-android if you have other question in future.
Author
Owner

@SrinivasanTarget commented on GitHub (Jan 3, 2018):

@butomo1989 Can you come online in Appium Slack?

<!-- gh-comment-id:355059088 --> @SrinivasanTarget commented on GitHub (Jan 3, 2018): @butomo1989 Can you come online in Appium Slack?
Author
Owner

@budtmo commented on GitHub (Sep 14, 2018):

How to use it can be found in this commit

<!-- gh-comment-id:421361171 --> @budtmo commented on GitHub (Sep 14, 2018): How to use it can be found in [this commit](https://github.com/butomo1989/docker-android/commit/dfc86227e08eb03c7abd76d0b2de54a427f50a98)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-android#45
No description provided.