
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@megh-computing/metadata-synchronizer
Advanced tools
Synchronizes a metadata stream with a video stream using a shared timestamp
Megh VAS products output video and metadata streams separately. This package can be used to correlate the out-of-band metadata with the MP4 video using timestamps present in both data streams:
Install the package as a dependency using npm:
$ npm install @megh-computing/metadata-synchronizer
or, install using yarn:
$ yarn add @megh-computing/metadata-synchronizer
import type {ImageFrame} from "@megh-computing/image-frame-pool";
import {MetadataSynchronizer} from "@megh-computing/metadata-synchronizer";
...
// Handle up to 10 seconds of de-sync between video and metadata (at 30fps)
// const synchronizer = new MetadataSynchronizer(30 /*fps*/ * 10 /*seconds*/);
const synchronizer = new MetadataSynchronizer(30 /*fps*/ * 10 /*seconds*/, {
// Optional frame memory management context for pooling and re-using frames
clone(frame: ImageFrame): ImageFrame {
return frame.clone();
},
release(frame: ImageFrame) {
frame.release();
},
});
// Configures the tolerance between timestamps before they are considered equal
synchronizer.setEqualityTolerance(0.001); // 1 millisecond
synchronizer.on("match", (frame: ImageFrame, metadata) => {
// Render metadata over frame and display
});
synchronizer.on("frameDropped", (frame: ImageFrame) => {
// Display frame with previous frame's metadata or no metadata at all
});
synchronizer.on("metadataDropped", (metadata) => {
// Do something with unused metadata?
});
synchronizer.on("warning", (type: string, message: string) => {
// By default, warnings will be printed to the console unless a handler is added
if (type === "trim") {
// Trim warnings indicate that capacity of queues has been reached,
// and the matching performance may degrade due to missing frames or metadata
console.warn("trim error:", message);
} else {
// Ignore other warnings
}
});
...
// Simply append the frames and metadata to the synchronizer,
// and the synchronizer will emit the events configured above
synchronizer.appendFrame(frame, frameTimestamp);
synchronizer.appendMetadata(metadata, metadataTimestamp);
// The synchronizer requires that the timestamps are in ascending order,
// so if/when either stream restarts, then the synchronizer must be reset
synchronizer.resetFrame();
synchronizer.resetMetadata();
// The oldest metadata timestamp can be queried to help determine if the metadata stream has restarted,
// and therefore the metadata side of the synchronizer must be reset
const oldestMetadataTimestamp = synchronizer.getOldestMetadataTimestamp();
if (oldestMetadataTimestamp != null) {
// Check if timestamp is less than oldest timestamp
if (metadataTimestamp < oldestMetadataTimestamp) {
// If so, then assume metadata has reset
synchronizer.resetMetadata();
}
}
synchronizer.appendMetadata(metadata, metadataTimestamp);
Copyright (c) 2021 Megh Computing, Inc.
All rights reserved. No warranty, explicit or implied, provided. Unauthorized use, modification, or distribution is strictly prohibited. Homepage: https://megh.com/
Please contact us if you use Megh VAS and would like to be issued a license to use this package.
FAQs
Synchronizes a metadata stream with a video stream using a shared timestamp
We found that @megh-computing/metadata-synchronizer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.