How does Marfeel detect images and videos in an article?
Marfeel detects images and videos in every article to power four capabilities:
- Display the main image of an article in Compass view
- Compute
Image count - Compute
Video count - Provide the main video for use in Amplify
The detection relies on three sources of editorial metadata: LD+JSON structured data, Microdata, and Open Graph meta tags.
Main image of an article
Section titled “Main image of an article”Marfeel selects the main image through a waterfall process, stopping at the first successful match:
- LD+JSON data (For more details visit https://schema.org/image):
<script type="application/ld+json">{"@context": "https://schema.org","@type": "NewsArticle","image": "mainImage.jpg"}</script>
- Microdata
<img itemprop="image" src="https://domain.com/path/to/img.jpg">
- Or from Meta OG types (supports both property and name attributes):
<meta property="og:image" content="https://mywebsite.com/images/mainImage.jpg" />
Image count
Section titled “Image count”Marfeel calculates the number of images in an article by taking the maximum value among the following counts:
- Count the relevant ImageObject in
LD+JSON, only from image and associatedMedia entity attributes. - Count the image in Microdata
- Count the
<img>nodes from a cleaned XPath DOM.
{ "@type": "ImageObject",
"url": "mainImage.jpg",
"width": { // Optional "@type": "QuantitativeValue", "value": 1000 },
"height": { // Optional "@type": "QuantitativeValue", "value": 1000 },
"name": "Image title", // Optional
"author": { // Optional "@type": "Person", "name": "Photographer name" }}Video count
Section titled “Video count”Marfeel calculates the number of videos in an article by taking the maximum value among the following counts:
- Count the relevant VideoObject in
LD+JSON, only from video and associatedMedia entity attributes. - Count the video in Microdata
- Count the
<video>nodes from a cleaned XPath DOM.
Main video of an article
Section titled “Main video of an article”Marfeel selects the main video through the same waterfall approach used for images:
- LD+JSON
videofield (For more details visit https://schema.org/video):<script type="application/ld+json">{"@context": "https://schema.org","@type": "NewsArticle","video": {"@type": "VideoObject","contentUrl": "https://example.com/video.mp4","embedUrl": "https://example.com/embed/video","thumbnailUrl": "https://example.com/thumb.jpg"}}</script> - Microdata
<video itemprop="video" src="https://domain.com/path/to/video.mp4">
- Or from Meta OG types (supports both property and name attributes):
<meta property="og:video" content="https://mywebsite.com/videos/mainVideo.mp4" />
The video URL preference order is: contentUrl > embedUrl > url. When available, the video thumbnail (thumbnailUrl) is also extracted.
If images or videos are not detected as expected, check the multimedia troubleshooting guide for common issues and fixes.
How does Marfeel determine the main image of an article?
Marfeel uses a waterfall process: it first checks LD+JSON structured data for a schema.org image property, then falls back to Microdata (itemprop=“image”), and finally checks Open Graph meta tags (og:image). The first match wins.
How does Marfeel count images and videos in an article?
Marfeel takes the maximum value among three counts: ImageObject or VideoObject entries in LD+JSON, Microdata elements, and actual <img> or <video> nodes found in the cleaned XPath DOM of the article body.
What is the URL preference order for main video detection?
Marfeel prioritizes contentUrl first, then embedUrl, then url. When available, the video thumbnail (thumbnailUrl) is also extracted.