Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add video support #3089

Merged
merged 16 commits into from
Oct 28, 2024
Merged

Add video support #3089

merged 16 commits into from
Oct 28, 2024

Conversation

lhoestq
Copy link
Member

@lhoestq lhoestq commented Oct 25, 2024

videos in /first-rows and /rows will be like

{"src": "https://huggingface.co/datasets/username/dataset_name/resolve/commit/hash/path/to/video.mp4"}

since videos are stored on the hub as files in 99% cases :)

(otherwise the back-ends store videos in the assets on S3 as usual (e.g. if they come from parquet or webdataset data or zipped data) but this is NOT recommended)

In particular, the pinned datasets implements the Video type with decord and does NOT embed video bytes in Parquet files (HF URL only) when the file is on HF when preparing Parquet files for /rows.

Note that I also disable video decoding in get_rows() to not have to download the video data in /first-rows (HF URL only as well)

cc @AndreaFrancis for viz

@severo
Copy link
Collaborator

severo commented Oct 25, 2024

I remember you mentioned at one point that some video datasets have one video, and each row refers to a range [start, end], which would be accessed as "media fragments" in HTML: https://developer.mozilla.org/en-US/docs/Web/Media/Audio_and_video_delivery#specifying_playback_range. Is it still a thing, or do we just have one row = one video?

@lhoestq
Copy link
Member Author

lhoestq commented Oct 27, 2024

one row = one video (we'll see later if we need to support other cases)

@lhoestq lhoestq marked this pull request as ready for review October 28, 2024 16:48
@lhoestq lhoestq merged commit 342e415 into main Oct 28, 2024
26 of 27 checks passed
@lhoestq lhoestq deleted the video branch October 28, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants