Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
ee69b4c
feat(beh): add audio and video recording support
bendichter Oct 25, 2025
ea2e5d1
fix(metadata): remove invalid enum reference for DatasetType
bendichter Oct 25, 2025
e1d95e8
Merge branch 'master' into audio-video-clean
bendichter Oct 25, 2025
ffccafc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 25, 2025
4707a33
Apply suggestion from @bendichter
bendichter Oct 25, 2025
38310aa
Apply suggestion from @bendichter
bendichter Oct 25, 2025
fa98d09
Apply suggestion from @bendichter
bendichter Oct 25, 2025
8884985
Apply suggestion from @bendichter
bendichter Oct 25, 2025
827e7d9
refactor(beh): update title to 'Behavioral recordings' and use filetr…
bendichter Oct 26, 2025
7cacffd
fix(docs): update link to BIDS examples repository for behavioral dat…
bendichter Oct 26, 2025
9b262a3
refactor(beh): streamline description of behavioral recordings in doc…
bendichter Oct 26, 2025
7bc990a
Merge branch 'master' into audio-video-clean
bendichter Oct 27, 2025
e8a8bf3
Merge branch 'master' into audio-video-clean
effigies Oct 28, 2025
3ee2c6c
Update src/modality-specific-files/behavioral-experiments.md
bendichter Oct 28, 2025
826e25a
Apply suggestion from @bendichter
bendichter Oct 28, 2025
00e3e26
Apply suggestion from @bendichter
bendichter Oct 28, 2025
25f65e1
Add FLAC audio file extension support for behavioral recordings
bendichter Oct 28, 2025
bf00bc6
Add StartTime field for audio/video metadata in BIDS schema
bendichter Oct 28, 2025
540a1e7
Revert "Add StartTime field for audio/video metadata in BIDS schema"
bendichter Oct 28, 2025
fc019ae
Clarify behavioral recordings section by adding details on simultaneo…
bendichter Oct 28, 2025
d7b1270
correct acquisition entity
bendichter Oct 29, 2025
1c06c08
Merge branch 'master' into audio-video-clean
bendichter Oct 29, 2025
e7a2332
Merge branch 'master' into audio-video-clean
bendichter Oct 31, 2025
0b2d464
Merge branch 'master' into audio-video-clean
bendichter Nov 3, 2025
4245b5d
feat: add support for Ogg Vorbis audio format in behavioral recordings
bendichter Nov 3, 2025
aead0a4
Apply suggestion from @bendichter
bendichter Nov 3, 2025
3756616
change example height value
bendichter Dec 3, 2025
272516c
change example width value
bendichter Dec 3, 2025
8e50668
Merge branch 'master' into audio-video-clean
bendichter Dec 3, 2025
0704e4a
swap example height and width
bendichter Dec 3, 2025
5df5916
Merge branch 'master' into audio-video-clean
bendichter Dec 15, 2025
b11d981
feat(schema): add audio bit depth and camera position metadata
bendichter Dec 15, 2025
ff8c605
Merge branch 'master' into audio-video-clean
bendichter Dec 29, 2025
83d3208
Merge branch 'master' into audio-video-clean
bendichter Jan 6, 2026
2f3d1d4
Merge branch 'master' into audio-video-clean
bendichter Jan 8, 2026
98eea5e
Merge branch 'master' into audio-video-clean
bendichter Jan 9, 2026
bddeb17
feat(beh): add `_audiovideo` suffix for combined audio-video recordings
bendichter Jan 10, 2026
7bb98a9
feat(beh): add support for still image recordings in behavioral exper…
bendichter Jan 10, 2026
877beeb
feat(beh): add optional License field for audio/video/image recordings
bendichter Jan 10, 2026
cc41d49
fix(schema): rename behimage suffix to image for consistency
bendichter Jan 12, 2026
1b1da59
Merge branch 'master' into audio-video-clean
bendichter Feb 9, 2026
029deac
Merge branch 'master' into audio-video-clean
bendichter Mar 16, 2026
e9500ed
Add common media file definitions (suffixes, extensions, metadata, si…
yarikoptic Mar 18, 2026
bd55318
Fix table separator padding for remark-lint compliance
yarikoptic Mar 19, 2026
0a9addd
Reuse existing RecordingDuration instead of introducing Duration
yarikoptic Mar 21, 2026
4faad34
Document AudioSampleRate vs SamplingFrequency distinction
yarikoptic Mar 21, 2026
56be0f6
Include .tif alongside .tiff in image formats table
yarikoptic Mar 21, 2026
8381389
Document relationship between media files and existing photo suffix
yarikoptic Mar 21, 2026
311e335
Render media metadata tables from schema using macros
yarikoptic Mar 23, 2026
4267efe
Render media suffix definitions from schema using macro
yarikoptic Mar 23, 2026
96dca84
Add make_extension_table macro and use it for media format tables
yarikoptic Mar 23, 2026
933b390
Add test for make_extension_table macro
yarikoptic Mar 24, 2026
be841b7
Remove overspecification for "photo" and clarify on variable rate
yarikoptic Jun 3, 2026
aba8721
Clarify Width/Height and add PixelFormat
yarikoptic Jun 3, 2026
a5b7aea
Add VideoFrameCount; prefix-align FrameRate, Width, Height
yarikoptic Jun 3, 2026
e576fea
Rename PixelFormat to ImagePixelFormat and move to MediaImageProperties
yarikoptic Jun 3, 2026
399713d
Minor wording tune up on the choices
yarikoptic Jun 3, 2026
c29ed8b
Add ImageBitDepth (OPTIONAL) under MediaImageProperties
yarikoptic Jun 3, 2026
6bf8f12
Merge branch 'master' into mediafiles
yarikoptic Jun 3, 2026
8bab3d5
Merge PR #2231 (BEP047 audio/video) into PR #2367 (common media file …
bendichter Jun 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ nav:
- Coordinate systems: appendices/coordinate-systems.md
- Quantitative MRI: appendices/qmri.md
- Arterial Spin Labeling: appendices/arterial-spin-labeling.md
- Media files: appendices/media-files.md
- Cross modality correspondence: appendices/cross-modality-correspondence.md
- Changelog: CHANGES.md
- The BIDS Website:
Expand Down
165 changes: 165 additions & 0 deletions src/appendices/media-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Media Files

## Introduction

Several BIDS datatypes make use of media files — audio recordings, video recordings,
combined audio-video recordings, and still images.
This appendix defines the common file formats, metadata conventions,
and codec identification schemes shared across all datatypes that use media files.

The following media suffixes are defined:

{{ MACROS___make_suffix_table(["audio", "video", "audiovideo", "image"]) }}

Datatypes that incorporate media files (for example, behavioral recordings or stimuli)
define their own file-naming rules, directory placement, and datatype-specific metadata.
The conventions described here apply uniformly to all such datatypes.

### Relationship to the `photo` suffix

The media file definitions introduced here generalize the concept of all media in BIDS.
The existing `photo` suffix (used for photographs of anatomical landmarks,
head localization coils, and tissue samples) predates this framework and covers
a narrower use case — still images in specific electrophysiology and microscopy datatypes.

The media suffixes (`audio`, `video`, `audiovideo`, `image`) are intended as the
general-purpose mechanism for all media content in BIDS.
The media file framework should be generally adopted for new datatypes,
and a future proposal may deprecate the `photo` suffix in favor of the broader `image`
suffix with appropriate migration tooling
(see [bids-utils](https://github.com/bids-standard/bids-utils)).

## Supported Formats

### Audio formats

{{ MACROS___make_extension_table(["wav", "mp3", "aac", "ogg"]) }}

### Video container formats

{{ MACROS___make_extension_table(["mp4", "avi", "mkv", "webm"]) }}

### Image formats

{{ MACROS___make_extension_table(["jpg", "png", "svg", "webp", "tif", "tiff"]) }}

When choosing a format, consider the trade-off between file size, data fidelity, openness and prevalence of the format in the domain of application.
Uncompressed or lossless formats (WAV, PNG, TIFF) preserve full quality
but produce larger files.
Lossy formats (MP3, AAC, JPEG) significantly reduce file size
at the cost of some data loss.

## Media Stream Metadata

Media files SHOULD be accompanied by a JSON sidecar file
containing technical metadata about the media streams.
The following metadata fields are defined for media files.

### Duration

Applies to suffixes: `audio`, `video`, `audiovideo`.

{{ MACROS___make_sidecar_table("media.MediaDuration") }}

`RecordingDuration` reuses the existing BIDS metadata field already defined for
electrophysiology recordings (EEG, iEEG, MEG, and others).

### Audio stream properties

Applies to suffixes: `audio`, `audiovideo`.

{{ MACROS___make_sidecar_table("media.MediaAudioProperties") }}

Note: `AudioSampleRate` is used instead of the existing `SamplingFrequency` field
because audio-video files require distinguishing the audio sampling rate from the
video frame rate. The `Audio` prefix makes this unambiguous in multi-stream containers.

### Image properties

Applies to suffixes: `video`, `audiovideo`, `image`.

{{ MACROS___make_sidecar_table("media.MediaImageProperties") }}

### Video stream properties

Applies to suffixes: `video`, `audiovideo`.

{{ MACROS___make_sidecar_table("media.MediaVideoProperties") }}

## Codec Identification

Codec identification uses two complementary naming systems:

### FFmpeg codec names (RECOMMENDED)

The `AudioCodec` and `VideoCodec` fields use
[FFmpeg codec names](https://www.ffmpeg.org/ffmpeg-codecs.html) as the RECOMMENDED
convention. These names are the de facto standard in scientific computing and can be
auto-extracted from media files using:

```bash
ffprobe -v quiet -print_format json -show_streams <file>
```

### RFC 6381 codec strings (OPTIONAL)

The `AudioCodecRFC6381` and `VideoCodecRFC6381` fields use
[RFC 6381](https://datatracker.ietf.org/doc/html/rfc6381) codec strings.
These provide precise codec profile and level information useful for
web and broadcast interoperability.

### Common codec reference

| Codec | FFmpeg Name | RFC 6381 String | Notes |
| -------------- | ----------- | ------------------ | ----------------------- |
| H.264 / AVC | `h264` | `avc1.640028` | Most widely supported |
| H.265 / HEVC | `hevc` | `hev1.1.6.L93.B0` | High efficiency |
| VP9 | `vp9` | `vp09.00.10.08` | Open, royalty-free |
| AV1 | `av1` | `av01.0.01M.08` | Next-gen open codec |
| AAC-LC | `aac` | `mp4a.40.2` | Default audio for MP4 |
| MP3 | `mp3` | `mp4a.6B` | Legacy lossy audio |
| Opus | `opus` | `Opus` | Open, low-latency audio |
| FLAC | `flac` | `fLaC` | Open lossless audio |
| PCM 16-bit LE | `pcm_s16le` | — | Uncompressed (WAV) |

The FFmpeg name column shows the value to use for `VideoCodec` or `AudioCodec`.
The RFC 6381 column shows the value for `VideoCodecRFC6381` or `AudioCodecRFC6381`.
RFC 6381 strings vary by profile and level;
the values shown are representative examples.

## Privacy Considerations

Media files — particularly audio and video recordings — may contain
personally identifiable information (PII), including but not limited to:

- Voices and speech content
- Facial features and other physical characteristics
- Background environments that could identify locations
- Metadata embedded in file headers (for example, GPS coordinates, device identifiers)

Researchers MUST ensure that sharing of media files complies with the
informed consent obtained from participants and with applicable privacy regulations.
De-identification techniques (for example, voice distortion, face blurring,
metadata stripping) SHOULD be applied where appropriate before data sharing.

## Example

A complete sidecar JSON file for an audio-video recording:

```json
{
"RecordingDuration": 312.5,
"VideoCodec": "h264",
"VideoCodecRFC6381": "avc1.640028",
"VideoFrameRate": 30,
"VideoFrameCount": 9375,
"ImageWidth": 1920,
"ImageHeight": 1080,
"ImagePixelFormat": "yuv420p",
"ImageBitDepth": 8,
"AudioCodec": "aac",
"AudioCodecRFC6381": "mp4a.40.2",
"AudioSampleRate": 48000,
"AudioChannelCount": 2
}
```
Loading
Loading