Webm Seekable

0 views
Skip to first unread message

Darios Uclaray

unread,
Aug 3, 2024, 5:48:19 PM8/3/24
to slemaclavci

I am working on a video editor, and the video is rendered using the canvas, so I use the JS MediaRecorder API, but I have run into an odd problem, where, because the MediaRecorder API is primarily designed for live streams, my exported WebM file doesn't show how long it is until it's done, which is kinda annoying.

EDIT: Narrowed down the problem, this is a chrome bug, see =642012. I discovered a library called -ebml that may be able to make the webm seekable, but unfortunately, this is a javascript project, and I ain't setting up Typescript.

I tried to record audio.webm using HTML5 MediaRecorder on Chrome and it cannot seek. Which is a known bug for Chrome. And I'm using ffmpeg to fix this problem with billion different ways, but still haven't succeeded.

The ts-ebml package on npm has a command-line tool to make a Chrome webm recording seekable; its Typescript API could be used directly in the audio recorder to rewrite the webm file when recording is complete. The actual CLI implementation is only a few lines, and should work reasonably well even if the recording has to be read back into memory and written out again:

You have the video file that is non real-time, you can use a relevant package like ts-ebml to add the metadata, duration and other information and convert a non seekable file to a seekable webm video file.

Despite various attempts and troubleshooting, I've been unable to successfully play WebM videos in Safari using the HTML5 video tag with provided Blob URLs. The videos, which are recorded in WebM format using browsers such as Chrome, fail to play in Safari, causing inconvenience for users who rely on this browser for their browsing needs.

I understand that Safari may have certain limitations and compatibility issues with certain multimedia formats, but as WebM gains popularity as a widely used format for web-based videos, its support in Safari would greatly enhance the browsing experience for many users.

I'm reaching out to inquire if there are any known solutions, workarounds, or plans to address this issue. Specifically, I've attempted to utilize the HTML5 video tag with Blob URLs to play WebM videos in Safari, but to no avail. If there are alternative methods or techniques that I may have overlooked, I would greatly appreciate any guidance or assistance in enabling playback of WebM videos in Safari.

Ensuring cross-browser compatibility and seamless playback of multimedia content is crucial for providing a consistent and enjoyable user experience across different platforms and environments. Any insights or recommendations from the Apple community would be immensely helpful in resolving this issue.

If the content-type was not known at the time the original media file was retrieved (either it didn't have a .webm extension or the server provided something that wouldn't have allowed webkit to know it was a webm file) ; then this will be fixed _bug.cgi?id=270975

Persistent license in Encrypted Media Extensions (EME) means the license canbe persisted on the device so that applications can load the license intomemory without sending another license request to the server. This is howoffline playback is supported in EME.

As you may already know, all Android devices are required to support WidevineSecurity Level 3 (Widevine L3). However there are many devices out therethat also support the highest security level: Widevine Security Level 1 where all content processing, cryptography, and control isperformed within the Trusted Execution Environment (TEE).

As you may already know, the seekable attribute contains the rangesof the media resource to which the browser can seek. Typically, it contains asingle time range which starts at 0 and ends at the media resource duration. Ifthe duration is not available though, such as a live stream, the time range maycontinuously change.

The good news is that you can now more effectively customize theseekable range logic with Media Source Extensions (MSE) byproviding or removing a single seekable range that is union'ed with the currentbuffered ranges. It results in a single seekable range which fits both, whenthe media source duration is +Infinity.

The lossless audio coding format FLAC has been supported in regular mediaplayback since Chrome 56. FLAC in ISO-BMFF support (aka FLAC in MP4) was addedshortly after. And now FLAC in MP4 is available in Chrome 62 for Media SourceExtensions (MSE).

For info, Firefox folks are the ones who developed and implemented support fora FLAC in MP4 encapsulation spec, and the BBC has been experimenting withusing that with MSE. You can read the BBC's "Delivering Radio 3 ConcertSound" post to learn more.

If you rotate a device to landscape while a video is playing in the viewport,playback will automatically switch to fullscreen mode. Rotating the device toportrait puts the video back to windowed mode. Check out our past article formore details.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

This API lets MediaSource apps more effectively customize theHTMLMediaElement.seekable range logic by providing (or removing) asingle seekable range that is union'ed with the current buffered ranges toresult in a single seekable range which fits both, when media duration is+Infinity.

Ubuntu Opera 11.11:
ogv and webm working fine expect that there are also is no download progress in the bar.
Does Opera really show somewhere the download progress? Screenshot? How does it look? Light grey like in FX?

We've been tracking Google's efforts to fix Chrome OS's unseekable video recordings since February this year, and over the last few months, work has progressed slowly on its bugtracker. The developers finally merged a fix recently, which closes the curtains on this frustrating limitation. While it's live in Chrome OS 93, Google chose not to push the fix into older versions. If your Chromebook is on the Stable channel, then you're stuck with the issue until this coming September.

The developers massively simplified the screen recorder's technical back-end. Previously, the recorder service passed muxer chunks to the client (ash) to write files to the disk. While it helped increased overall security, it prevented Chrome OS from creating seekable video files. To fix this, the service uses the file path of the footage and writes to it directly, using the browser to pass the file back to the recorder. Video players will now be able to seek through recordings and jump to any desired timestamp.

This WebM parser is a C++11-based parser that aims to be a safe and complete parser for WebM. It supports all WebM elements (from the old deprecated ones to the newest ones like Colour), including recursive elements like ChapterAtom and SimpleTag. It supports incremental parsing; parsing may be stopped at any point and resumed later as needed. It also supports starting at an arbitrary WebM element, so parsing need not start from the beginning of the file.

The parser (WebmParser) works by being fed input data from a data source (an instance of Reader) that represents a WebM file. The parser will parse the WebM data into various data structures that represent the encoded WebM elements, and then call corresponding Callback event methods as the data structures are parsed.

CMake support has been added to the root libwebm CMakeLists.txt file. Simply enable the ENABLE_WEBM_PARSER feature if using the interactive CMake builder, or alternatively pass the -DENABLE_WEBM_PARSER:BOOL=ON flag from the command line. By default, this parser is not enabled when building libwebm, so you must explicitly enable it.

The Reader interface acts as a data source for the parser. You may subclass it and implement your own data source if you wish. Alternatively, use the FileReader, IstreamReader, or BufferReader if you wish to read from a FILE*, std::istream, or std::vector, respectively.

The parser supports Reader implementations that do short reads. If Reader::Skip() or Reader::Read() do a partial read (returning Status::kOkPartial), the parser will call them again in an attempt to read more data. If no data is available, the Reader may return some other status (like Status::kWouldBlock) to indicate that no data is available. In this situation, the parser will stop parsing and return the status it received. Parsing may be resumed later when more data is available.

When the Reader has reached the end of the WebM document and no more data is available, it should return Status::kEndOfFile. This will cause parsing to stop. If the file ends at a valid location (that is, there aren't any elements that have specified a size that indicates the file ended prematurely), the parser will translate Status::kEndOfFile into Status::kOkCompleted and return it. If the file ends prematurely, the parser will return Status::kEndOfFile to indicate that.

As the parser progresses through the file, it builds objects (see webm/dom_types.h) that represent parsed data structures. The parser then notifies the Callback implementation as objects complete parsing. For some data structures (like frames or Void elements), the parser notifies the Callback and requests it to consume the data directly from the Reader (this is done for structures that can be large/frequent binary blobs in order to allow you to read the data directly into the object/type of your choice, rather than just reading them into a std::vector and making you copy it into a different object if you wanted to work with something other than std::vector).

The parser was designed to parse the data into objects that are small enough that the Callback can be quickly and frequently notified as soon as the object is ready, but large enough that the objects received by the Callback are still useful. Having Callback events for every tiny integer/float/string/etc. element would require too much assembly and work to be useful to most users, and pasing the file into a single DOM tree (or a small handful of large conglomerate structures) would unnecessarily delay video playback or consume too much memory on smaller devices.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages