Skip to content

Commit 3a0775b

Browse files
save file
1 parent 31711d0 commit 3a0775b

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

blog/25-11-15/ffmpeg-in-the-browser/ffmpeg-in-the-browser.html

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,17 @@ <h4>
486486
</h4>
487487
<ul>
488488
<li>
489-
<b>WebCodecs (recommended):</b> Native browser API. Minimal code, no external library downloads, good performance.
489+
<b>
490+
WebCodecs (recommended):
491+
</b>
492+
Native browser API. Minimal code, no external library downloads, good performance.
490493
Requires you to parse or otherwise obtain SPS/PPS for the decoder config.
491494
</li>
492495
<li>
493-
<b>Broadway (JS/asm.js/WASM):</b> A historical JavaScript H.264 decoder compiled from Android’s C decoder via Emscripten.
496+
<b>
497+
Broadway (JS/asm.js/WASM):
498+
</b>
499+
A historical JavaScript H.264 decoder compiled from Android’s C decoder via Emscripten.
494500
Runs fully in JS without browser codecs, but is heavier and slower compared to hardware/native paths.
495501
Useful if WebCodecs isn’t available or you need a pure-JS path.
496502
</li>
@@ -519,14 +525,23 @@ <h4>
519525
</h4>
520526
<ul>
521527
<li>
522-
<b>From container:</b> If your H.264 comes from MP4, read the avcC box (AVCDecoderConfigurationRecord). It contains SPS/PPS you can pass as description.
528+
<b>
529+
From container:
530+
</b>
531+
If your H.264 comes from MP4, read the avcC box (AVCDecoderConfigurationRecord). It contains SPS/PPS you can pass as description.
523532
</li>
524533
<li>
525-
<b>From Annex B elementary stream:</b> Extract NAL units with start codes 00 00 00 01 (or 00 00 01). Find NAL types: 7 = SPS, 8 = PPS; 5 = IDR.
534+
<b>
535+
From Annex B elementary stream:
536+
</b>
537+
Extract NAL units with start codes 00 00 00 01 (or 00 00 01). Find NAL types: 7 = SPS, 8 = PPS; 5 = IDR.
526538
Collect SPS/PPS bytes and build a description buffer compatible with your browser’s AVCC expectations.
527539
</li>
528540
<li>
529-
<b>Why this matters:</b> The decoder uses SPS/PPS to understand frame dimensions, profiles, and other parameters;
541+
<b>
542+
Why this matters:
543+
</b>
544+
The decoder uses SPS/PPS to understand frame dimensions, profiles, and other parameters;
530545
skipping them is the most common reason minimal examples fail.
531546
<br>
532547
<a href='https://stackoverflow.com/questions/79264506/error-using-webcodecs-to-decode-h264-data-and-display-on-browser-from-http-fetch'>
@@ -547,7 +562,10 @@ <h4>
547562
This is the simplest pipeline for a single snapshot.
548563
</li>
549564
<li>
550-
<b>Alternatives:</b> Use VideoFrame directly with HTMLVideoElement/WebGL for preview and only snapshot when needed;
565+
<b>
566+
Alternatives:
567+
</b>
568+
Use VideoFrame directly with HTMLVideoElement/WebGL for preview and only snapshot when needed;
551569
then export via canvas as above. Guides and examples show decode pipelines using WebCodecs for both playback and encoding.
552570
<br>
553571
<a href='https://www.slingacademy.com/article/decode-and-encode-video-with-the-webcodecs-api-in-javascript/'>

0 commit comments

Comments
 (0)