Media Injection
The Media Injection feature allows users to feed any image or video directly into a browser's camera stream during an Astrofarm session. This is particularly useful for testing camera-dependent workflows — such as document scanning, barcode reading, or facial recognition — without needing a physical camera, props, or specific lighting conditions.
Use Cases
Many applications rely on the device camera to capture real-world inputs like ID documents, barcodes, or faces. Testing these flows traditionally requires physical setups like holding documents in front of a webcam or finishing up with KYC , testing the image detection in the application, making tests inconsistent and hard to reproduce.
With Media Injection, users can upload a controlled image or video directly into the browser's camera stream from within the console, enabling reliable and repeatable testing of any camera-based feature without leaving their desk.
Steps to Use Media Injection
One-Time Setup
To use Media Injection, you need to enable the required Chrome flag on your device. This is a one-time setup and will not be needed again once completed.
- Open Chrome on your device and go to the flag link in your Astrofarm session panel.
- Copy the link “chrome://flags/#enable-command-line-on-non-rooted-devices” and paste in the chrome browser.

- Set the flag to Enabled and click Relaunch. Chrome application on the device will restart and it is expected.
Injecting Media
- Once flag is enabled on a device with a Chromium-based browser.
- In the AstroFarm Dashboard, locate the Media Injection section and toggle it on.
- Upload your media using one of the following methods:
- Browse from Computer — Drag and drop a file or click Browse to select one from your local machine.
- Media Store — Select a previously uploaded asset from the Media Store, accessible from the left navigation panel of the Astrofarm console.
- Click Inject.
- In your web app, trigger the camera flow as usual. Your uploaded media will appear as the live camera feed.
Supported Formats & Browsers
Image — .jpg, .jpeg, .png — Max size: 10 MB
Video — .mp4, .mov — Max size: 50 MB
Y4M Video — .y4m — Max size: 300 MB
Browsers: Google Chrome, Microsoft Edge, Brave, Opera (Chromium-based, Android)