Use Medialooks WebCapture to turn a web page into a video source: a dashboard, presentation or full-frame graphics output. The SDK renders the page locally through an MLive or MFLive object. You can then preview, mix, record or output its frames through your normal SDK pipeline.
Need graphics over existing video? Use the HTML5 Overlay plugin. WebCapture creates a source; it does not automatically composite it over another video.
Jump to the MFormats setup, MPlatform setup, video format and alpha, or browser control.
Build the source pipeline
- Create a live object and select the Medialooks WebCapture video device.
- Set the page URL through
line-inand choose the input video format. - Pull frames in MFormats, or start the source and connect receivers in MPlatform.
- To navigate, run scripts or receive browser events, obtain the source's internal browser.
- At shutdown, stop processing, disconnect receivers, close the source and release application-owned COM objects.
The examples use an existing live object on your application's SDK-control thread. Keep one object for the source's lifetime, not one per frame. Enumerate devices at runtime: saved indices are not portable. No registry change is needed to set a URL.
Configure MFormats
MFormats selects a video device by its current index. With live declared as an MFORMATSLib.MFLiveClass, find WebCapture and set its page URL:
string pageUrl = "https://www.medialooks.com";
int count;
live.DeviceGetCount(eMFDeviceType.eMFDT_Video, out count);
int webCaptureIndex = -1;
for (int i = 0; i < count; i++)
{
string name;
int busy;
live.DeviceGetByIndex(eMFDeviceType.eMFDT_Video, i, out name, out busy);
if (name == "Medialooks WebCapture")
{
webCaptureIndex = i;
break;
}
}
if (webCaptureIndex < 0)
throw new InvalidOperationException("Medialooks WebCapture is not available.");
live.DeviceSet(eMFDeviceType.eMFDT_Video, webCaptureIndex, "");
live.PropsSet("line-in", pageUrl);
Use MFORMATSLib types throughout. The application supplies pageUrl; line-in accepts it directly, without changing a preconfigured URL list.
Pull frames from live and send them to a preview, writer or other receiver. Release each acquired frame in finally, and stop the loop before closing the source.
One worker-loop iteration, with an already configured MFPreviewClass preview:
MFFrame frame = null;
try
{
live.SourceFrameGet(-1, out frame, "");
if (frame != null)
preview.ReceiverFramePut(frame, -1, "");
}
finally
{
if (frame != null)
System.Runtime.InteropServices.Marshal.ReleaseComObject(frame);
}
Acquire frames on a worker, not the UI thread. The -1 wait is unbounded, so coordinate cancellation and source shutdown to avoid a blocked thread at exit. After the worker stops, call DeviceClose and release the live and preview objects.
Configure MPlatform
MPlatform selects the device by name. With live declared as an MPLATFORMLib.MLiveClass, find WebCapture and set the URL:
string pageUrl = "https://www.medialooks.com";
int count;
live.DeviceGetCount(0, "video", out count);
bool found = false;
for (int i = 0; i < count; i++)
{
string name, description;
live.DeviceGetByIndex(0, "video", i, out name, out description);
if (name == "Medialooks WebCapture")
{
found = true;
break;
}
}
if (!found)
throw new InvalidOperationException("Medialooks WebCapture is not available.");
live.DeviceSet("video", "Medialooks WebCapture", "");
live.DeviceSet("video::line-in", pageUrl, "");
Configure the input format, then start the source and connect receivers. For an existing, configured MPreviewClass, use the order shown in the Live Source sample:
live.ObjectStart(null);
preview.ObjectStart(live);
The Live Source sample also shows preview-window and audio/video monitoring setup. At shutdown, stop and close receivers before closing and releasing the live source.
Choose resolution, frame rate and alpha
Set the input format with FormatVideoSet(eMFT_Input, ...) before starting. This example requests progressive HD1080 at 30 fps with an alpha-capable pixel format:
var format = new M_VID_PROPS
{
eVideoFormat = eMVideoFormat.eMVF_Custom,
nWidth = 1920,
nHeight = 1080,
nAspectX = 16,
nAspectY = 9,
dblRate = 30.0,
eInterlace = eMInterlace.eMI_Progressive,
fccType = eMFCC.eMFCC_ARGB32
};
live.FormatVideoSet(eMFormatType.eMFT_Input, ref format);
Both SDK families use these method and structure names; select types from your live object's namespace. Set the rate your application needs. The requested rate does not prove that a complex page paints a fresh image for every frame: measure delivered frames and presentation on the target system.
To preserve transparency through the pipeline:
- Use a transparent page background.
- Request an alpha-capable pixel format such as ARGB32. Opaque YUV formats such as HDYC do not carry alpha.
- Keep alpha in downstream conversion, mixing and output.
A preview can show transparent areas against its own background. That alone does not mean alpha was lost.
The 30 fps example is not a universal HTML5 Overlay limit. Source format and browser paint cadence are separate. Set and verify both for your workflow; see the properties reference for supported rendering options.
Control the internal browser
After selecting and initializing WebCapture, obtain its own browser component. Creating a separate overlay object would control a different browser.
MFormats
object internalHtml = null;
try
{
live.DeviceGetInternal(eMFDeviceType.eMFDT_Video, out internalHtml);
var browser = (IMFBrowser)internalHtml;
browser.BrowserPageLoad(nextPageUrl);
}
finally
{
if (internalHtml != null && System.Runtime.InteropServices.Marshal.IsComObject(internalHtml))
System.Runtime.InteropServices.Marshal.ReleaseComObject(internalHtml);
}
MPlatform
object internalHtml = null;
try
{
live.ObjectGetInternal("", out internalHtml);
var browser = (IMFBrowser)internalHtml;
browser.BrowserPageLoad(nextPageUrl);
}
finally
{
if (internalHtml != null && System.Runtime.InteropServices.Marshal.IsComObject(internalHtml))
System.Runtime.InteropServices.Marshal.ReleaseComObject(internalHtml);
}
Use IMFBrowser to load another page, run JavaScript, navigate or forward supported input. See browser control and events for methods and the JavaScript bridge.
BrowserPageLoad starts navigation; it does not confirm that fonts, images, data or rendered output are ready. Have your page send a ready event after preparing its required resources, then validate SDK output. Do not substitute a fixed sleep.
The live source owns the browser's operating lifetime. Your returned interface is a reference to that browser, not an independent source:
- Stop using and release the returned reference before tearing down the live source. Do not release both
internalHtmland itsbrowseralias as separate objects. - Reacquire the interface after changing or restarting the device.
- Let the live source close its internal browser during normal shutdown.
Explore WebCapture in the SDK samples
Use these default installation paths for x64. The MFormats example is Tutorial Live Input, not a separate Sample Live Source application.
| Sample | Executable | C# project |
|---|---|---|
| MFormats — Tutorial Live Input | C:\Program Files (x86)\Medialooks\MFormats SDK\Samples\C#\Tutorial Live Input\bin\x64\Debug\Tutorial Live Input.exe |
C:\Program Files (x86)\Medialooks\MFormats SDK\Samples\C#\Tutorial Live Input\Tutorial Live Input.csproj |
| MPlatform — Live Source Sample | C:\Program Files (x86)\Medialooks\MPlatform SDK\Samples Basic\C#\Live Source Sample\bin\x64\Debug\Live Source Sample.exe |
C:\Program Files (x86)\Medialooks\MPlatform SDK\Samples Basic\C#\Live Source Sample\Live Source Sample.csproj |
- Select Medialooks WebCapture in Video (MFormats) or Video Device (MPlatform).
- Choose a preconfigured URL in Line and the input Format, then click Init Device.
- Keep Video Preview enabled in MPlatform. When finished, click Close Device.
Line is a selection list, not an editable address field. Use the API above to load an arbitrary URL. Available entries depend on the installation.
Optional: provide a URL selection list
MFormats can offer preconfigured pages as line-in choices. An installation may store this device configuration here:
HKEY_CURRENT_USER\Software\Medialooks\MFormats\MFLive\WebCapture
url.list
This list is only a convenience for device-selection UIs. Prefer setting line-in in code when your application chooses the URL. Do not change a user's registry just to open a page, or assume every computer has the same list.
Troubleshooting
| Symptom | Check first |
|---|---|
| WebCapture is absent from device enumeration | Check SDK architecture, component registration and installation of HTML5/WebCapture and its browser runtime. |
| The source exists but the page is blank | Check the URL, resource errors, network access and page readiness. Confirm that the selected WebCapture device was initialized, not another browser instance. |
| Transparent graphics have an opaque background | Check page CSS, the requested pixel format and downstream conversions or receivers that could discard alpha. |
| Video format is unexpected | Set the input format before starting, then inspect delivered frames. Preview-window dimensions do not establish frame format. |
| Page changes or rendering are slow | Measure page rendering and SDK processing. Check page complexity, resource loading and runtime compatibility. A requested output rate does not prove fresh browser paints. |
An earlier WebCapture sample interface is available for reference; sample appearance and availability depend on the SDK release.
Next steps
- HTML5 Overlay overview and quick start — place HTML graphics over an existing video source.
- Shared SDK deployment requirements — use the runtime components matching your application architecture.
- MLCG Editor workflow and SDK samples — design graphics in the web editor and use real published outputs.
- MLCG REST Client for C# — update MLCG session data and animation from your application.
Still have questions?
Tell us what didn’t work or what you’d like clarified.