<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Reifora developer notes]]></title><description><![CDATA[Reifora developer notes]]></description><link>https://reifora.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 28 Nov 2026 22:43:15 GMT</lastBuildDate><atom:link href="https://reifora.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[A real video cut that FFmpeg scene > 0.4 missed]]></title><description><![CDATA[A scene detector returned no candidates for a video that visibly cuts from a close-up to a wider table shot. Lowering the threshold from 0.4 to 0.3 found…]]></description><link>https://reifora.hashnode.dev/a-real-video-cut-that-ffmpeg-scene-0-4-missed</link><guid isPermaLink="true">https://reifora.hashnode.dev/a-real-video-cut-that-ffmpeg-scene-0-4-missed</guid><category><![CDATA[FFmpeg]]></category><dc:creator><![CDATA[th0t3p]]></dc:creator><pubDate>Sat, 28 Nov 2026 14:07:29 GMT</pubDate><content:encoded><![CDATA[<p>A scene detector returned no candidates for a video that visibly cuts from a close-up to a wider table shot. Lowering the threshold from 0.4 to 0.3 found the change at 2.666667 seconds. The frame's reported scene score was 0.306273.</p>
<p>I build Castario. This AI-assisted tutorial records a local inspection of our existing public GTA diner example on November 27, 2026, with the Castario walkthrough rechecked on November 28, 2026. It did not generate a new video or change the production service. The point is how to investigate an empty detector result using a known file and explicit filter settings.</p>
<h2>Keep the file and the detector settings together</h2>
<p>The <a href="https://castario.app/video/gta-diner/guide/">public diner walkthrough</a> links to the existing MP4. The inspected file has 105 video frames at 24 fps, a 1920 × 1080 canvas and an audio stream. Its container duration is 4.375011 seconds. Its SHA-256 is b3c10636f04416bff1a290cf0c0a0a1cd1612a304b8d16d1fae86de2551f2882. A different encoding may produce different scores, even if it looks similar.</p>
<p>The visual check used complete frames sampled across the short clip. They show a close-up followed by the character across the diner table. That supplies a known transition to investigate. Metadata about duration and frame size alone would not establish that the shot changes.</p>
<p>I ran the following filter with FFmpeg 9.0.1. This command reads the file and writes detection information to the terminal; it does not save a re-encoded video. Replace /absolute/path/gta-diner.mp4 with your local file. No environment variables are required.</p>
<pre><code class="language-sh">ffmpeg -hide_banner -i /absolute/path/gta-diner.mp4 \
  -vf "select=gt(scene\,0.3),metadata=print" \
  -an -f null -
</code></pre>
<p>The relevant output was pts_time:2.666667 and lavfi.scene_score=0.306273. This identifies a candidate frame by its input timestamp. It is not a statement that every adjacent frame is visually correct.</p>
<p>For this unchanged input, a strict threshold of 0.3 selected one candidate. Thresholds of 0.4 and 0.5 selected none. The <a href="https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect">FFmpeg select documentation</a> includes a scene-selection example and a suggested starting range. A starting value still needs checking against your footage.</p>
<h2>Run the comparison without shell interpolation</h2>
<p>Save this as /tmp/reifora-scene-demo/scene-threshold.ts and run node --experimental-strip-types /tmp/reifora-scene-demo/scene-threshold.ts /absolute/path/gta-diner.mp4. It needs FFmpeg on PATH. The example was run with Node v22.23.2.</p>
<pre><code class="language-typescript">import { spawnSync } from 'node:child_process';

const input = process.argv[2];
if (!input) throw new Error('Usage: node scene-threshold.ts /absolute/path/video.mp4');

const checks = [
  { label: 'full-frame', prefix: '', threshold: 0.3 },
  { label: 'full-frame', prefix: '', threshold: 0.4 },
  { label: 'full-frame', prefix: '', threshold: 0.5 },
  // This rectangle is a deliberate analysis control for the 1920x1080 sample.
  // It is not an automatic crop detector or an export recommendation.
  { label: 'center-rectangle-control', prefix: 'crop=1440:1080:240:0,', threshold: 0.4 },
];

const results = checks.map(({ label, prefix, threshold }) =&gt; {
  const filter = `${prefix}select=gt(scene\\,${threshold}),metadata=print`;
  const result = spawnSync('ffmpeg', [
    '-hide_banner', '-i', input, '-vf', filter, '-an', '-f', 'null', '-',
  ], { encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 });
  if (result.error) throw result.error;
  if (result.status !== 0) {
    throw new Error(`ffmpeg failed (${result.status}): ${result.stderr}`);
  }
  const candidates: { seconds: number; score: number }[] = [];
  let seconds: number | undefined;
  for (const line of result.stderr.split('\n')) {
    const time = line.match(/\bpts_time:([-+0-9.eE]+)/);
    if (time) seconds = Number(time[1]);
    const score = line.match(/lavfi\.scene_score=([-+0-9.eE]+)/);
    if (score &amp;&amp; seconds !== undefined) {
      const value = Number(score[1]);
      if (!Number.isFinite(seconds) || !Number.isFinite(value)) {
        throw new Error('Invalid timestamp or scene score in ffmpeg output');
      }
      candidates.push({ seconds, score: value });
      seconds = undefined;
    }
  }
  return { label, threshold, candidates };
});
console.log(JSON.stringify(results, null, 2));
</code></pre>
<p>The last check deliberately changes one input condition: it analyzes a centered 1440 × 1080 rectangle of this 1920 × 1080 sample. That control selected the same timestamp at threshold 0.4, reporting a score of 0.408364. It demonstrates that changing the analyzed rectangle changes the score. The rectangle is an explicit test choice, not a result from an automatic black-border detector or a suggested delivery crop.</p>
<p>Leave the original file untouched. If you compare results from a full frame and a cropped analysis view, label them separately. Resizing, color conversion or other preprocessing would also require their own controlled comparison before drawing a conclusion about its effect.</p>
<h2>Inspect the candidate, and inspect empty results too</h2>
<p>Extract a short strip of complete frames around the candidate. With this constant-frame-rate sample, the candidate is at frame 64 when counting the first frame as zero. Looking at frames on both sides helps distinguish a cut from a blink, quick camera movement or lighting change. For variable-frame-rate input, use the actual frame timestamps instead of converting time to a frame index with one assumed rate.</p>
<p>An empty result means that no frame passed the configured test. It does not establish that the clip contains one shot. Lowering a threshold can add false positives, so keep the candidate list and review it instead of declaring that more candidates must be better.</p>
<p>This test does not measure face resemblance, audio quality or whether a generated action follows its reference. It provides a timestamp for a closer look. Keep the input fingerprint, FFmpeg version, preprocessing and threshold in the same receipt so someone else can repeat the check.</p>
]]></content:encoded></item><item><title><![CDATA[Calculate how much of an image object-fit: cover hides]]></title><description><![CDATA[Calculate the visible source rectangle for cover and contain, with tested TypeScript and real square and portrait image dimensions.]]></description><link>https://reifora.hashnode.dev/calculate-how-much-of-an-image-object-fit-cover-hides</link><guid isPermaLink="true">https://reifora.hashnode.dev/calculate-how-much-of-an-image-object-fit-cover-hides</guid><category><![CDATA[CSS]]></category><dc:creator><![CDATA[th0t3p]]></dc:creator><pubDate>Thu, 26 Nov 2026 14:14:17 GMT</pubDate><content:encoded><![CDATA[<p>A square thumbnail can hide the top and bottom of a portrait poster even when the downloaded file is intact. Before asking an image model for another result, compare the source dimensions with the preview box and its object-fit setting.</p>
<p>I build Reifora. This AI-assisted tutorial uses dimensions read from two existing fictional-portrait examples on our public GTA picture guide on November 26, 2026. The TypeScript below was run locally; it is a standalone geometry example, not a claim about code deployed in Reifora or a browser rendering test.</p>
<h2>Start with the actual file dimensions</h2>
<p>The <a href="https://reifora.com/guides/gta-ai-picture-generator/">GTA poster and cover-collage walkthrough</a> has a 1024 × 1024 solo example and a 768 × 1024 collage. Both came from an earlier real generation test using the same fictional adult portrait. No new generation is needed to use their dimensions in this calculation.</p>
<p>Put the collage in a 320 × 320 content box. With cover, its width must reach 320 pixels. The scale is 320 / 768, so the rendered height becomes about 426.67 pixels. A centered square box hides about 53.33 rendered pixels above and below it. In source coordinates, that removes 128 pixels at each end: 25 percent of the image area is outside the box.</p>
<p>With contain, the height reaches 320 pixels first. The image displays at 240 × 320, leaving 40 pixels of space on each side. All of the source is visible. The <a href="https://www.w3.org/TR/css-images-3/#the-object-fit">CSS Images specification</a> defines the sizing behavior; <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/object-fit">MDN's object-fit guide</a> gives examples.</p>
<h2>Calculate the visible source rectangle</h2>
<p>Use the image dimensions and the img element's content-box dimensions. This example assumes object-position: 50% 50%, an axis-aligned box, and contain or cover. It does not model transforms, rounded-corner clipping, EXIF orientation, or clipping by an ancestor.</p>
<p>Save the following as /tmp/reifora-fit-demo/fit-preview.ts. It uses only Node's built-in assertion module and no environment variables. Run it with a Node version that supports TypeScript type stripping, for example: node --experimental-strip-types /tmp/reifora-fit-demo/fit-preview.ts.</p>
<pre><code class="language-typescript">import assert from 'node:assert/strict';

type Size = { width: number; height: number };
type Fit = 'contain' | 'cover';

export function fitPreview(image: Size, box: Size, fit: Fit) {
  for (const value of [image.width, image.height, box.width, box.height]) {
    if (!Number.isFinite(value) || value &lt;= 0) {
      throw new RangeError('Image and box dimensions must be positive and finite');
    }
  }
  if (fit !== 'contain' &amp;&amp; fit !== 'cover') throw new TypeError('Unsupported fit');
  const ratios = [box.width / image.width, box.height / image.height];
  const scale = fit === 'contain' ? Math.min(...ratios) : Math.max(...ratios);
  const rendered = { width: image.width * scale, height: image.height * scale };
  const visible = {
    width: Math.min(image.width, box.width / scale),
    height: Math.min(image.height, box.height / scale),
  };
  return {
    rendered,
    offset: {
      x: (box.width - rendered.width) / 2,
      y: (box.height - rendered.height) / 2,
    },
    sourceRect: {
      x: (image.width - visible.width) / 2,
      y: (image.height - visible.height) / 2,
      ...visible,
    },
    visibleFraction: (visible.width * visible.height) / (image.width * image.height),
  };
}

const collage = { width: 768, height: 1024 };
const square = { width: 320, height: 320 };
const cover = fitPreview(collage, square, 'cover');
assert.deepEqual(cover.sourceRect, { x: 0, y: 128, width: 768, height: 768 });
assert.equal(cover.visibleFraction, 0.75);
const contain = fitPreview(collage, square, 'contain');
assert.equal(contain.visibleFraction, 1);
assert.deepEqual(contain.offset, { x: 40, y: 0 });
assert.equal(fitPreview({ width: 1024, height: 1024 }, square, 'cover').visibleFraction, 1);
assert.equal(fitPreview({ width: 1024, height: 1024 }, { width: 270, height: 480 }, 'cover').visibleFraction, 0.5625);
for (const invalid of [0, -1, NaN, Infinity]) {
  assert.throws(() =&gt; fitPreview({ width: invalid, height: 1024 }, square, 'cover'), RangeError);
}
console.log(JSON.stringify({ cover, contain, validation: 'passed' }, null, 2));
</code></pre>
<p>The cover sourceRect is { x: 0, y: 128, width: 768, height: 768 }, and visibleFraction is 0.75. The contain result has visibleFraction: 1 and offset: { x: 40, y: 0 }. The assertions also check matching square ratios, a square source in a 9:16 box, and invalid dimensions.</p>
<p>For cover, use the larger of the width and height scale ratios. For contain, use the smaller. Divide the box size by that scale to find how much source area fits, capped at the source dimensions. Centering splits the excess evenly between opposite sides. Negative display offsets describe overflow; positive offsets describe unused space.</p>
<h2>Check what the browser is actually showing</h2>
<p>Read the selected image's naturalWidth and naturalHeight after it has loaded; zero dimensions are a reason to wait or investigate loading. These are intrinsic, density-corrected browser dimensions, not necessarily the raw encoded pixel count. MDN documents that distinction in <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/naturalWidth">naturalWidth</a>. For file-level reporting, read the downloaded file's metadata too.</p>
<p>If the element uses srcset, inspect currentSrc so you know which resource supplied those dimensions. Use the content box after subtracting padding and borders. A transformed getBoundingClientRect can describe a different size from the layout box, so keep transforms out of this simple calculation.</p>
<p>Then inspect computed object-fit and object-position. Changing the position moves the visible crop but does not recover the whole image under cover when the ratios differ. An ancestor with overflow hidden or a mask can remove more content than this calculation predicts.</p>
<p>For a review view where every panel matters, contain is a useful default:</p>
<pre><code class="language-css">.review-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
}
</code></pre>
<p>Its parent still needs a defined size. Keep access to the original file when a compact gallery uses cover. The geometry tells you which source region is visible; it cannot tell you whether a face, hand or panel boundary inside that region is correct. Inspect the complete image before deciding that the generator cut something off.</p>
]]></content:encoded></item><item><title><![CDATA[Why we built a free Christmas card maker with photo templates]]></title><description><![CDATA[How Reifora’s free Christmas card maker uses browser rendering, local PNG export and one optional AI portrait for four card layouts.]]></description><link>https://reifora.hashnode.dev/why-we-built-a-free-christmas-card-maker-with-photo-templates</link><guid isPermaLink="true">https://reifora.hashnode.dev/why-we-built-a-free-christmas-card-maker-with-photo-templates</guid><dc:creator><![CDATA[th0t3p]]></dc:creator><pubDate>Wed, 25 Nov 2026 14:33:08 GMT</pubDate><content:encoded><![CDATA[<p>You have a photo you like and a Christmas message to send. The remaining work is fairly small: put the photo in a frame, make the words readable, and save an image that you can send from your phone.</p>
<p>We built <a href="https://reifora.com/images/christmas-card/">Reifora's free Christmas card maker</a> around that task. This article was drafted with AI assistance.</p>
<h2>Start with a photo, finish with a file</h2>
<p>The free editor opens without an account. Choose a template, select a photo from your device, and edit the title and greeting. There is an optional field for your name. The preview updates as you work, and Download PNG exports a 1080 × 1350 image.</p>
<p>That file is yours to attach to a message or email. Downloading a card does not automatically post it anywhere.</p>
<p>The templates give you a few different compositions to try. A rectangular opening leaves more room for people near the edge of a photo. A round opening works well when one person is near the center. If someone gets cropped out, switching frames can be easier than trying to make the same photo work in every layout.</p>
<img src="https://reifora.com/picture-assets/christmas/card/guide/finished-en.webp" alt="An exported Christmas photo card from the Reifora walkthrough" style="display:block;margin:0 auto" />

<p><em>A card exported from the free editor. The example uses an AI-generated fictional portrait.</em></p>
<p>The <a href="https://reifora.com/guides/how-to-make-a-digital-christmas-card/">illustrated Christmas card walkthrough</a> shows the editing steps with short animations. It also has a text-only option.</p>
<h2>Keep the ordinary editing work in the browser</h2>
<p>Putting a photo inside a frame does not require an AI request. The free editor crops and scales the image locally, then draws the photo, artwork and text into the exported card.</p>
<p>This lets the ordinary editing flow stay free without requiring credits. The photo and greeting are not uploaded for that flow. Keep a downloaded copy if you want to retain your card: the editor does not provide a saved project history, and it clears its working photo and text when you leave.</p>
<p>The text needed attention too. A greeting that looks fine as a short label can become hard to read once someone writes a full sentence. We updated the optional four-card layouts to keep the title, greeting and sender together, with the greeting wrapping across lines. We also moved the photo control under the heading on phones, so someone arriving with a photo can find the input sooner.</p>
<p>These are small changes, but they affect whether someone can finish a card they actually want to send.</p>
<h2>Make the Santa hat an optional edit</h2>
<p>There is a separate AI option for a clear adult portrait: add a Santa hat, then use the resulting photo in four card layouts. It costs $0.50 through a one-time Stripe checkout, or 1 credit after signing in.</p>
<p>The important implementation detail is that we generate one photo. The browser reuses that result to compose the four cards, so changing the card layout does not require another AI generation. All four layouts are included in that price.</p>
<p>This is a fixed Santa-hat edit. There is no prompt box in this flow. Choosing it uploads the selected photo for AI processing, and the result may change other details as well. The example shows what the edit is intended to do; it does not guarantee identical results for every portrait.</p>
<p>Reifora also has a separate <a href="https://reifora.com/images/christmas/">AI Christmas photo generator</a> for people who want a different Christmas scene. That is another paid photo effect. You can still make and download a standard card with your existing photo for free.</p>
<h2>Make one card easy to send from a phone</h2>
<p>For the optional set, the mobile flow puts the selected card's PNG first. Where the browser supports sharing image files, it can open the device's share sheet. The ZIP containing the set is a secondary download.</p>
<p>Browser support varies. A share sheet opening also does not tell us that a recipient received the image. The file download remains available when direct file sharing is unavailable.</p>
<p>If you already have a photo ready, <a href="https://reifora.com/images/christmas-card/">open the Christmas card maker</a>, try a frame, and check the greeting in the preview before saving it.</p>
]]></content:encoded></item><item><title><![CDATA[Check a generated MP4 before calling it done]]></title><description><![CDATA[A local TypeScript and ffprobe example for checking video dimensions, duration and audio, tested against a retained MP4.]]></description><link>https://reifora.hashnode.dev/check-a-generated-mp4-before-calling-it-done</link><guid isPermaLink="true">https://reifora.hashnode.dev/check-a-generated-mp4-before-calling-it-done</guid><category><![CDATA[TypeScript]]></category><dc:creator><![CDATA[th0t3p]]></dc:creator><pubDate>Wed, 25 Nov 2026 04:08:30 GMT</pubDate><content:encoded><![CDATA[<p>A video job can finish and still leave you with the wrong artifact: a short clip with no audio, an unexpected frame size, or a file that does not decode. A completion status is useful, but the downloaded file needs its own check.</p>
<p>I work on Reifora. This article uses a retained output from an earlier product test to explain a local verification step. The TypeScript program below is a standalone teaching example, not a description of Reifora's production backend or a claim that it performs these checks automatically.</p>
<h2>Give the file its own expected specification</h2>
<p>The sample is a silent Private Jet Exit clip. Probing that exact retained MP4 gives:</p>
<pre><code class="language-json">{
  "width": 768,
  "height": 1344,
  "duration": 10.125,
  "hasAudio": false
}
</code></pre>
<p>The <a href="https://reifora.com/video/private-jet-exit/guide/">public guide has the input and downloadable example</a>. Its portrait is an AI-generated fictional adult, and the MP4 is an earlier actual product output. No new video generation was purchased to prepare this article.</p>
<p>Use a file you have permission to inspect. Save it as <code>result.mp4</code>. For this particular sample, the expected duration is 10.125 seconds, the encoded frame is 768 × 1344, and audio should be absent. Those values describe this test artifact. Another template needs its own specification.</p>
<p>A tolerance makes the duration comparison explicit. Here, 0.05 seconds allows a small difference around the known sample duration. It is a choice for this example, not a general recommendation for every frame rate or delivery requirement.</p>
<h2>Probe locally, then compare</h2>
<p>This example needs Node.js 22.18 or newer with TypeScript type stripping available, and FFmpeg's <code>ffprobe</code> on <code>PATH</code>. It uses Node's built-in modules and no environment variables or package dependencies. Save the following as <code>audit-video.ts</code> in your working directory.</p>
<p>The process receives the local filename as an argument, without a shell. There is a 15-second timeout and a one-megabyte output limit. The code selects a video by its stream type rather than assuming that the first stream is video.</p>
<pre><code class="language-typescript">import { execFileSync } from 'node:child_process';
import { statSync } from 'node:fs';
import { resolve } from 'node:path';
import { pathToFileURL } from 'node:url';

type Probe = {
  format?: { duration?: string };
  streams?: Array&lt;{
    codec_type?: string;
    width?: number;
    height?: number;
  }&gt;;
};

type Spec = {
  width: number;
  height: number;
  duration: number;
  tolerance: number;
  audio: 'required' | 'absent' | 'either';
};

export function inspect(file: string) {
  const path = resolve(file);
  if (!statSync(path).isFile()) throw new Error('Expected a local file');
  const raw = execFileSync('ffprobe', [
    '-v', 'error', '-show_entries',
    'format=duration:stream=codec_type,width,height',
    '-of', 'json', path,
  ], { encoding: 'utf8', timeout: 15000, maxBuffer: 1024 * 1024 });
  const probe = JSON.parse(raw) as Probe;
  const streams = probe.streams ?? [];
  const videos = streams.filter(s =&gt; s.codec_type === 'video');
  if (videos.length !== 1) throw new Error('Expected one video stream');
  const video = videos[0];
  const duration = Number(probe.format?.duration);
  if (!Number.isFinite(duration) || duration &lt;= 0) {
    throw new Error('Missing or invalid duration');
  }
  if (!Number.isInteger(video.width) || !Number.isInteger(video.height) ||
      (video.width ?? 0) &lt;= 0 || (video.height ?? 0) &lt;= 0) {
    throw new Error('Missing or invalid dimensions');
  }
  return {
    width: video.width as number,
    height: video.height as number,
    duration,
    hasAudio: streams.some(s =&gt; s.codec_type === 'audio'),
  };
}

export function compare(actual: ReturnType&lt;typeof inspect&gt;, spec: Spec) {
  if (![spec.width, spec.height, spec.duration, spec.tolerance].every(Number.isFinite) ||
      spec.width &lt;= 0 || spec.height &lt;= 0 || spec.duration &lt;= 0 || spec.tolerance &lt; 0) {
    throw new Error('Invalid expected specification');
  }
  const failures: string[] = [];
  if (actual.width !== spec.width || actual.height !== spec.height) {
    failures.push(`dimensions: ${actual.width}x${actual.height}`);
  }
  if (Math.abs(actual.duration - spec.duration) &gt; spec.tolerance) {
    failures.push(`duration: ${actual.duration}`);
  }
  if (spec.audio === 'required' &amp;&amp; !actual.hasAudio) failures.push('audio missing');
  if (spec.audio === 'absent' &amp;&amp; actual.hasAudio) failures.push('unexpected audio');
  return failures;
}

if (process.argv[1] &amp;&amp; import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
  if (!process.argv[2]) throw new Error('Usage: node audit-video.ts ./result.mp4');
  console.log(JSON.stringify(inspect(process.argv[2]), null, 2));
}
</code></pre>
<p>Run it from the directory containing the script and file:</p>
<pre><code class="language-sh">node audit-video.ts ./result.mp4
</code></pre>
<p>The CLI prints measurements. It deliberately does not infer a specification from a template name. To turn the measurements into an acceptance check, call the exported comparison function with values you know in advance:</p>
<pre><code class="language-typescript">import { inspect, compare } from './audit-video.ts';

const actual = inspect('./result.mp4');
const failures = compare(actual, {
  width: 768,
  height: 1344,
  duration: 10.125,
  tolerance: 0.05,
  audio: 'absent',
});

if (failures.length) throw new Error(failures.join('; '));
</code></pre>
<p><code>required</code> means that an audio stream must exist. <code>absent</code> means that one must not exist. <code>either</code> leaves that check open. An audio stream being present says nothing about whether it is audible or contains the intended soundtrack.</p>
<h2>Check the checker with a wrong expectation</h2>
<p>The example passed against the retained sample with the specification above. Changing the expected width to 1920 produced a dimension failure. Changing duration to five seconds produced a duration failure. Requiring audio produced <code>audio missing</code>. A negative tolerance and a missing local file were rejected.</p>
<p>These small failures matter because a validator that only passes its happy path can hide an incorrect comparison. Keep a known file and at least one intentionally wrong specification when adapting this code.</p>
<p>The sample's SHA-256 is:</p>
<pre><code class="language-text">d1d404f01abc63317a734d35361a7a4e1865d814084c32f1f4baa622a98f2caf
</code></pre>
<p>That identifies the exact retained file used here. If the public sample is replaced later, compare the hash before assuming you are running the same example.</p>
<h2>Decode after reading metadata</h2>
<p>ffprobe reports container and stream information. It is useful for quick structural checks, but it does not establish that every packet decodes. For the same local file, a separate decode check was also run:</p>
<pre><code class="language-sh">ffmpeg -v error -xerror -i ./result.mp4 -map 0:v:0 -map '0:a?' -f null -
</code></pre>
<p>The optional audio mapping accepts this silent sample. The command completed successfully for the retained file. Capture the exit status in an automated workflow; a process starting successfully is not the same as a successful decode.</p>
<p>For server-side processing of untrusted media, use resource limits and a maintained FFmpeg build. The local-file restriction in this small program avoids turning an input string into an arbitrary remote fetch, but does not make a media decoder a security boundary.</p>
<h2>Record the limits of the result</h2>
<p>This example compares encoded dimensions. It does not account for display rotation or non-square pixels; normalize those inputs or extend the check before using it for arbitrary uploads. It also requires exactly one video stream, which deliberately excludes some otherwise valid multimedia files.</p>
<p>The measurements do not assess face likeness, hand shape, shot continuity, subtitles or music rights. Watch the content for those questions. A useful record can say “metadata matched the sample specification; full decode passed; visual review still pending.” That gives the next person a clear account of what was actually checked.</p>
<p>Technical reference: <a href="https://ffmpeg.org/ffprobe.html">ffprobe documentation</a> and <a href="https://ffmpeg.org/ffmpeg.html">FFmpeg documentation</a>. This article and its teaching code were prepared with AI assistance, reviewed against those references, and exercised locally as described above.</p>
]]></content:encoded></item></channel></rss>