How can I correctly provide a mock webcam video to Chrome?

后端 未结 3 1659
庸人自扰
庸人自扰 2020-12-24 02:57

I\'m trying to run end-to-end testing in Chrome for a product that requires a webcam feed halfway through to operate. From what I understand this means providing a fake webc

3条回答
  •  無奈伤痛
    2020-12-24 03:45

    After reading the link you provided I noticed that we can also provide an mjpeg.

    Depending on what your test requirements - this may be sufficient for you.

    ffmpeg -i oldfile.mp4 newfile.mjpeg

    then I tested using:

    google-chrome --use-fake-device-for-media-stream --use-file-for-fake-video-capture=newfile.mjpeg

    After navigating to Tracking JS I could see the video being played back.

    I hope that works for you!

提交回复
热议问题