Questions tagged [webcodecs]

The WebCodecs API gives web developers low-level access to the individual frames of a video stream and chunks of audio. Use this tag for questions about usage of the WebCodecs API and its related interfaces, such as VideoDecoder, VideoEncoder, AudioDecoder, and AudioEncoder.

32 questions
13
votes
3 answers

WebCodecs > VideoEncoder: Create video from encoded frames

I would like to create a video file from multiple images uploaded to my site. Until now, what I do is take these images, draw them 1-by-1 on a canvas, and use the MediaRecorder API to record them. However, there is a lot of idle time. Instead, I…
Amit
  • 5,924
  • 7
  • 46
  • 94
8
votes
2 answers

Javascript: frame precise video stop

I would like to be able to robustly stop a video when the video arrives on some specified frames in order to do oral presentations based on videos made with Blender, Manim... I'm aware of this question, but the problem is that the video does not…
tobiasBora
  • 1,542
  • 14
  • 23
7
votes
1 answer

Initialize an AudioDecoder for "vorbis" and "opus", description is required - what is it exactly?

I'm using the WebCodecs AudioDecoder to decode OGG files (vorbis and opus). The codec string setting in the AudioDecoder configuration is vorbis and opus, respectively. I have the container parsed into pages, and the AudioDecoder is almost ready for…
John Weisz
  • 30,137
  • 13
  • 89
  • 132
5
votes
2 answers

MediaRecorder ignoring VideoFrame.timestamp

I would like to generate a video. I am using MediaRecorder to record a track generated by MediaStreamTrackGenerator. Generating each frame takes some time, let's say 1 second, and I would like to generate the video at 10 fps. Therefore, when I…
Amit
  • 5,924
  • 7
  • 46
  • 94
3
votes
0 answers

FFmpeg.wasm demuxing - Get encodedChunks in Javascript

I am building a video editor whose process looks like this: Demuxing -> Decoding -> Editing -> Encoding -> Muxing. The demuxing and muxing process is currently done with mp4box.js. I would like to replace mp4box.js with ffmpeg.wasm. Unfortunately, I…
3
votes
2 answers

Decode MP4 video with VideoDecoder

I want to make a web app, which extracts each frame of a MP4 file, and saves it as a PNG. Setting the currentTime of a
Ivan Kuckir
  • 2,327
  • 3
  • 27
  • 46
3
votes
0 answers

WebCodec: how to play a video and go to a precise frame?

It seems that Javascript does not provide any way to reliably seek a precise frame. I'm therefore thinking that the last solution may be to use WebCodec. However, it's not clear to me how to use WebCodec to play a video or seek a precise frame.…
tobiasBora
  • 1,542
  • 14
  • 23
3
votes
1 answer

How to extract frames from video using webcodecs from chrome 86

WebCodecs is released in Chrome 86. But there's no real code example on how to use it yet. Given a video url, how to extract video frames as ImageData using webcodecs?
Lincolnhuj
  • 63
  • 6
2
votes
2 answers

HTML5 Video: How to get the index of current frame

I have a web application that processes mp4 video frame-by-frame using this WebCodecs library and stores the presentation timestamp and duration of every VideoFrame. Then i want to play the video and match the currently playing frame with the…
KarelPrdel
  • 99
  • 1
  • 1
  • 7
2
votes
1 answer

How many frame need to be decoded before output callback is invoked in webcodec(avc1.640028)

When I invoked VideoDecoder.decode( new EncodedVideoChunk(sample) ); once in a tick of requestAnimationFrame, I noticed the output callback is also invoked roughly in each requestAnimationFrame, but the video quality is poor However, when I…
Guichi
  • 2,150
  • 1
  • 19
  • 27
2
votes
0 answers

Decoding opus in chunks using AudioDecoder

I'm developing an application that has business logic that heavily depends on sound precision, hence I'm using the Web Audio API. The app has the functionality to manipulate audio files in multiple ways (fade in and fade out, programmatically seek…
1
vote
1 answer

Is it possible to encode to yuv422 with html5 VideoEncoder?

I am trying to record a video using HTML5 VideoEncoder. There's a number of AVC profiles one can use (https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter#av1). According to that page, 4:2:2 profiles are starting from 7A, like…
Rustam
  • 1,766
  • 18
  • 34
1
vote
1 answer

corruption of unknown origin in audio (libopus) and video (nvenc HEVC) bitstreams sent via webtransport API, and decoded with webcodecs

I'm using windows 11, and chrome for the web client. I have a golang program that runs two c++ programs as subprocess. the first uses the nvidia video codec SDK to set up an hevc encoder: NV_ENC_INITIALIZE_PARAMS IP = {}; NV_ENC_CONFIG C = {}; …
Tiger Yang
  • 61
  • 4
1
vote
0 answers

Configure WebCodecs API video decoder to match an NVENC Encoder

I have an H264 NVENC Encoder setup which encodes a video stream. I want to decode frames of that stream using the WebCodecs API in Google Chrome. My decoder configuration setup looks like this: let decoderConfig = {codec: "avc1.428020", width:…
Pruza
  • 11
  • 3
1
vote
0 answers

Decode frame produced by ffmpeg lib using webcodecs

server side extracting frame from video using ffmpeg library. Here is code: AVFormatContext *pFormatContext = avformat_alloc_context(); avformat_open_input(&pFormatContext, "VID_20230219_171331_300.mp4.mov", NULL, NULL); …
mccat
  • 33
  • 4
1
2 3