Repository navigation
Audio and video recordings in datasets - #26
Merged
Merged
Conversation
- uploadMedia: add a recording to a dataset from a File/Blob, a Buffer or ArrayBuffer, or a file path in Node.js - sendDataset takes recordings as media, also without time-series - listDatasets and downloadMedia
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of edge-ml/edge-ml#78 (JavaScript library). Uses the device API routes of edge-ml/Dataset-store#31.
What it adds
uploadMedia(url, key, datasetId, file, { kind?, name?, start?, fileName? })– adds an audio or video recording to a dataset and resolves to the stored entry.fileis aFile/Blobin the browser, and aBuffer,ArrayBufferor file path in Node.js.sendDatasettakes recordings asmedia: [{ file, start?, ... }]. A dataset that only holds recordings needs notimeSeries.listDatasets(url, key)– the project's datasets with their time-series and recordings (mediaSeries).downloadMedia(url, key, datasetId, mediaId)– the recording as anArrayBuffer.Nothing existing changes:
sendDatasetanddatasetCollectorsend the same requests as before when no media is given.Server
The routes are on a server with edge-ml/Dataset-store#31. Until that is promoted, prod answers 404 for these calls; everything else works as before.
Release
No version bump here, so merging does not publish. The release (4.2.0) is a separate PR.
Tests
11 new Jest tests (55 pass), browser bundle check passes. Run live against a local server with this branch's server side: upload from path, Buffer and Blob, dataset with and without time-series, listing, byte-identical download, and the refusals (unsupported format, wrong kind, read key, unknown dataset).