tree: 63168aa7c52ad34ff473406472ae7ce869022d16 [search]
  1. animated-zero-delay.gif
  2. audio-data-copyto-offset.any.js
  3. audio-data-copyto-oversized.any.js
  4. audio-data-copyTo.any.js
  5. audio-data-serialization.any.js
  6. audio-data.any.js
  7. audio-data.crossOriginIsolated.https.any.js
  8. audio-data.crossOriginIsolated.https.any.js.headers
  9. audio-decoder.crossOriginIsolated.https.any.js
  10. audio-decoder.crossOriginIsolated.https.any.js.headers
  11. audio-decoder.https.any.js
  12. audio-encoder-aac-description.html
  13. audio-encoder-codec-specific.https.any.js
  14. audio-encoder-config.https.any.js
  15. audio-encoder.https.any.js
  16. audio-serialization.crossAgentCluster.helper.html
  17. audio-serialization.crossAgentCluster.https.html
  18. audioDecoder-codec-specific.https.any.js
  19. audioDecoder-pcm-output.https.any.js
  20. av1.mp4
  21. chunk-serialization.any.js
  22. encoded-audio-chunk.any.js
  23. encoded-audio-chunk.crossOriginIsolated.https.any.js
  24. encoded-audio-chunk.crossOriginIsolated.https.any.js.headers
  25. encoded-video-chunk.any.js
  26. encoded-video-chunk.crossOriginIsolated.https.any.js
  27. encoded-video-chunk.crossOriginIsolated.https.any.js.headers
  28. encodedVideoChunk-serialization.crossAgentCluster.helper.html
  29. encodedVideoChunk-serialization.crossAgentCluster.https.html
  30. four-colors-flip.avif
  31. four-colors-flip.gif
  32. four-colors-full-range-bt2020-pq-444-10bpc.avif
  33. four-colors-full-range-hlg-420-10bpc.avif
  34. four-colors-full-range-hlg-420-12bpc.avif
  35. four-colors-full-range-hlg-422-10bpc.avif
  36. four-colors-full-range-hlg-422-12bpc.avif
  37. four-colors-full-range-hlg-444-10bpc.avif
  38. four-colors-full-range-hlg-444-12bpc.avif
  39. four-colors-limited-range-420-8bpc.avif
  40. four-colors-limited-range-420-8bpc.jpg
  41. four-colors-limited-range-420-8bpc.webp
  42. four-colors-limited-range-422-8bpc.avif
  43. four-colors-limited-range-444-8bpc.avif
  44. four-colors.avif
  45. four-colors.gif
  46. four-colors.jpg
  47. four-colors.mp4
  48. four-colors.png
  49. four-colors.webp
  50. full-cycle-test.https.any.js
  51. h264.annexb
  52. h264.mp4
  53. h264_444.mp4
  54. h264_interlaced.mp4
  55. h264_sei.annexb
  56. h264_sei.mp4
  57. h265.annexb
  58. h265.mp4
  59. idlharness.https.any.js
  60. image-decoder-animated-zero-delay.https.any.js
  61. image-decoder-disconnect-readable-stream-crash.https.html
  62. image-decoder-image-orientation-none.https.html
  63. image-decoder-transfer-nondetachable-crash.https.html
  64. image-decoder-utils.js
  65. image-decoder.crossOriginIsolated.https.any.js
  66. image-decoder.crossOriginIsolated.https.any.js.headers
  67. image-decoder.https.any.js
  68. imagedecoder-bmp-in-ico-crash.https.html
  69. imagedecoder-zero-length-crash.https.html
  70. META.yml
  71. opus-multichannel.https.any.js
  72. pattern.png
  73. per-frame-qp-encoding.https.any.js
  74. README.md
  75. reconfiguring-encoder.https.any.js
  76. serialization-to-shared-and-service-workers-helper.js
  77. serialization-to-shared-and-service-workers.https.html
  78. serialization.crossAgentCluster.serviceworker.js
  79. sfx-aac.mp4
  80. sfx-alaw.wav
  81. sfx-opus.ogg
  82. sfx-pcm-f32.wav
  83. sfx-pcm-s16.wav
  84. sfx-pcm-s24.wav
  85. sfx-pcm-s32.wav
  86. sfx-pcm-u8.wav
  87. sfx-ulaw.wav
  88. sfx-vorbis.ogg
  89. sfx.adts
  90. sfx.flac
  91. sfx.mp3
  92. temporal-svc-encoding.https.any.js
  93. transfering.https.any.js
  94. utils.js
  95. video-decoder-no-size-in-configure.https.any.js
  96. video-decoder.crossOriginIsolated.https.any.js
  97. video-decoder.crossOriginIsolated.https.any.js.headers
  98. video-decoder.https.any.js
  99. video-encoder-canvasImageSource.https.html
  100. video-encoder-config.https.any.js
  101. video-encoder-content-hint.https.any.js
  102. video-encoder-flush.https.any.js
  103. video-encoder-h264.https.any.js
  104. video-encoder-h26x-annexb.https.any.js
  105. video-encoder-hbd.https.any.js
  106. video-encoder-orientation.https.any.js
  107. video-encoder-rescaling.https.any.js
  108. video-encoder-utils.js
  109. video-encoder.https.any.js
  110. video-frame-serialization.any.js
  111. videoColorSpace.any.js
  112. videoDecoder-444-h264.https.any.js
  113. videoDecoder-codec-specific-orientation.https.any.js
  114. videoDecoder-codec-specific-setup.js
  115. videoDecoder-codec-specific.https.any.js
  116. videoDecoder-h264-sei.https.any.js
  117. videoDecoder-interlaced-h264.https.any.js
  118. videoFrame-alpha-discard-utils.js
  119. videoFrame-alpha-discard.any.js
  120. videoFrame-alpha-discard.window.js
  121. videoFrame-alpha.any.js
  122. videoFrame-canvasImageSource.html
  123. videoFrame-construction.any.js
  124. videoFrame-construction.crossOriginIsolated.https.any.js
  125. videoFrame-construction.crossOriginIsolated.https.any.js.headers
  126. videoFrame-construction.crossOriginSource.sub.html
  127. videoFrame-construction.window.js
  128. videoFrame-copyTo-canvas.window.js
  129. videoFrame-copyTo-chroma-subsampling.any.js
  130. videoFrame-copyTo-opaque-swizzle.https.any.js
  131. videoFrame-copyTo-rgb.any.js
  132. videoFrame-copyTo-rgbx.any.js
  133. videoFrame-copyTo.any.js
  134. videoFrame-copyTo.crossOriginIsolated.https.any.js
  135. videoFrame-copyTo.crossOriginIsolated.https.any.js.headers
  136. videoFrame-createImageBitmap.any.js
  137. videoFrame-createImageBitmap.https.any.js
  138. videoFrame-drawImage-hbd.any.js
  139. videoFrame-drawImage-rgbx.any.js
  140. videoFrame-drawImage.any.js
  141. videoFrame-encode-preserves-input-utils.js
  142. videoFrame-encode-preserves-input.crossOrigin.helper.html
  143. videoFrame-encode-preserves-input.crossOrigin.https.html
  144. videoFrame-encode-preserves-input.https.any.js
  145. videoFrame-imageBitmap-crop.any.js
  146. videoFrame-metadata-rtpTimestamp.https.html
  147. videoFrame-odd-size.any.js
  148. videoFrame-orientation-drawImage.any.js
  149. videoFrame-orientation-imageBitmap.any.js
  150. videoFrame-orientation-utils.js
  151. videoFrame-orientation-webgl-i420.window.js
  152. videoFrame-orientation-webgl.window.js
  153. videoFrame-orientation.any.js
  154. videoFrame-rgbx-imageBitmap.any.js
  155. videoFrame-rgbx-utils.js
  156. videoFrame-rgbx-webgl.window.js
  157. videoFrame-rotation.any.js
  158. videoFrame-serialization.crossAgentCluster.helper.html
  159. videoFrame-serialization.crossAgentCluster.https.html
  160. videoFrame-serialization.https.html
  161. videoFrame-texImage.any.js
  162. videoFrame-utils.js
  163. vp8.webm
  164. vp9-codec-string-profile-constraints.https.any.js
  165. vp9.mp4
  166. WEB_FEATURES.yml
  167. webgl-test-utils.js
webcodecs/README.md

WebCodecs Test Files

Instructions

To add, update or remove a test file, please update the list below.

Please provide full reference and steps to generate the test file so that anybody can regenerate or update the file in the future.

Notes

  • When updating the sample offsets and descriptions for tests using mp4 files, it's easiest to use mp4box.js.
    • Sample offsets can be copied from the “Sample View” tab after unchecking all but offset and size. Use a multi-line edit mode and clang-format to quickly format entries.
    • Description entries can be found under moov.trak.mdia.minf.stbl.stsd in box view.
      • avc1.avcC or hvc1.hvcC has an offset, size in the same view. Add 8 to offset and subtract 8 from the size to get the values the tests want.
    • If you use ffprobe -show_packets to get sample offsets, you may need to add 4 to each pos value. You can tell if you need to by whether or not tests pass.

List of Test Files

four-colors.png

Generated using MSPaint like a true professional.

four-colors.avif

Lossless encoding must be used to ensure colors are perfect.

avifenc -l four-colors.png -o four-colors.avif

four-colors.webp

Lossless encoding must be used to ensure colors are perfect.

ffmpeg -i four-colors.png -lossless 1 -y four-colors.webp

four-colors-limited-range-420-8bpc.webp

ffmpeg -i four-colors.png -pix_fmt yuv420p four-colors-limited-range-420-8bpc.webp

four-colors.gif

High quality encoding must be used to ensure colors are perfect.

cp four-colors.png four-colors2.png
gifski -o four-colors.gif four-colors*.png

four-colors-flip.gif

High quality encoding must be used to ensure colors are perfect.

ffmpeg -i four-colors.png -vf "rotate=PI" four-colors2.png
gifski -o four-colors-flip.gif four-colors*.png

four-colors-flip.avif

ffmpeg -i four-colors-flip.gif -crf 16 four-colors-flip.avif

four-colors-limited-range-(420|422|444)-8bpc.avif

avifenc -r l -d 8 -y 420 -s 0 four-colors.png four-colors-limited-range-420-8bpc.avif
avifenc -r l -d 8 -y 422 -s 0 four-colors.png four-colors-limited-range-422-8bpc.avif
avifenc -r l -d 8 -y 444 -s 0 four-colors.png four-colors-limited-range-444-8bpc.avif

four-colors-full-range-bt2020-pq-444-10bpc.avif

avifenc -r f -d 10 -y 444 -s 0 --nclx 9/16/9 four-colors.png four-colors-full-range-bt2020-pq-444-10bpc.avif

four-colors-full-range-(420|422|444)-hlg-(10|12)bpc.avif

avifenc -r f -d 10 -y 420 -s 0 --nclx 9/18/9 four-colors.png four-colors-full-range-hlg-420-10bpc.avif
avifenc -r f -d 10 -y 422 -s 0 --nclx 9/18/9 four-colors.png four-colors-full-range-hlg-422-10bpc.avif
avifenc -r f -d 10 -y 444 -s 0 --nclx 9/18/9 four-colors.png four-colors-full-range-hlg-444-10bpc.avif
avifenc -r f -d 12 -y 420 -s 0 --nclx 9/18/9 four-colors.png four-colors-full-range-hlg-420-12bpc.avif
avifenc -r f -d 12 -y 422 -s 0 --nclx 9/18/9 four-colors.png four-colors-full-range-hlg-422-12bpc.avif
avifenc -r f -d 12 -y 444 -s 0 --nclx 9/18/9 four-colors.png four-colors-full-range-hlg-444-12bpc.avif

four-colors.jpg

Used Sqoosh.app with MozJPEG compression and RGB channels. exiftool was then used to add an orientation marker.

exiftool -Orientation=1 -n four-colors.jpg

four-colors-limited-range-420-8bpc.jpg

Used Sqoosh.app with MozJPEG compression and YUV channels. exiftool was then used to add an orientation marker.

exiftool -Orientation=1 -n four-colors-limited-range-420-8bpc.jpg

four-colors.mp4

Used a custom tool to convert four-colors.avif into a .mp4 file.

h264.mp4

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -pix_fmt yuv420p -vcodec h264 -tune zerolatency h264.mp4

h264_interlaced.mp4

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -vcodec h264 -vf "setfield=tff,format=yuv420p" -flags +ilme+ildct -top 1 h264_interlaced.mp4

h264_444.mp4

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -pix_fmt yuv444p -vcodec h264 h264_444.mp4

h264_sei.mp4

Similar to the construction of h264.mp4, but produces a file where the 5th frame is an SEI recovery point with a recovery_frame_cnt=0.

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -pix_fmt yuv420p -vcodec h264 -tune zerolatency -x264-params "open-gop=1:keyint=5:bframes=3" h264_sei.mp4

h264.annexb

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -pix_fmt yuv420p -vcodec h264 -tune zerolatency -f h264 h264.annexb

h264_sei.annexb

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -pix_fmt yuv420p -vcodec h264 -tune zerolatency -x264-params "open-gop=1:keyint=5:bframes=3" -f h264 h264_sei.annexb

h265.mp4

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -pix_fmt yuv420p -vcodec hevc -tag:v hvc1 -tune zerolatency h265.mp4

h265.annexb

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -pix_fmt yuv420p -vcodec hevc -tag:v hvc1 -tune zerolatency -f hevc h265.annexb

sfx.adts

sox -n -r 48000 sfx.wav synth 1 sine 480
ffmpeg -i sfx.wav -frames:a 10 -acodec aac -b:a 96K sfx.adts

sfx.mp3

sox -n -r 48000 sfx.wav synth 1 sine 480
ffmpeg -i sfx.wav -frames:a 10 -acodec libmp3lame -b:a 96K sfx.mp3

sfx.flac

sox -n -r 48000 sfx.wav synth 1 sine 480
ffmpeg -i sfx.wav -frames:a 10 sfx.flac

sfx-aac.mp4

sox -n -r 48000 sfx.wav synth 1 sine 480
ffmpeg -i sfx.wav -frames:a 10 -acodec aac -b:a 96K sfx-aac.mp4

sfx-*.wav

sox -n -r 48000 sfx.wav synth 1 sine 480
for codec in s16 s24 s32 f32
do
  # Add "le" suffix
  ffmpeg -i sfx.wav -frames:a 10 -acodec pcm_"$codec"le sfx-pcm-$codec.wav
done
ffmpeg -i sfx.wav -frames:a 10 -acodec pcm_u8 sfx-pcm-u8.wav
for codec in alaw mulaw
do
  ffmpeg -i sfx.wav -frames:a 10 -acodec pcm_$codec sfx-$codec.wav
done

sfx-opus.ogg

sox -n -r 48000 sfx.wav synth 1 sine 480
ffmpeg -i sfx.wav -frames:a 10 -acodec libopus -b:a 96K sfx-opus.ogg

### sfx-vorbis.ogg

sox -n -r 48000 sfx.wav synth 1 sine 480 ffmpeg -i sfx.wav -frames:a 10 -acodec libvorbis -b:a 96K sfx-vorbis.ogg


### av1.mp4

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -pix_fmt yuv420p -vcodec libaom-av1 av1.mp4


### vp8.webm

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -pix_fmt yuv420p -vcodec vp8 vp8.webm


### vp9.mp4

ffmpeg -f lavfi -i testsrc=rate=10:n=1 -t 1 -pix_fmt yuv420p -vcodec vp9 vp9.mp4