mediafs

package module
v0.0.0-...-f0a6964 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

README

mediafs

WARNING: Early prototype version!

MediaFS is a file format to manage collections of media files.

This allows to have a single file for a collection of media files, for example an audio CD.

All the media files are stored in a single file where you can open and play them directly, exactly like a phisical CD, but using any modern audio/video encoding and allowing to add metadata, but maintaining the convenience of a phisical media.

In theory this format could also work with actual phisical media, if any device will ever support it. :)

How to use

ATM MediaFS is at an experimental stage and all interactions with it are done through a single command line tool.

Dependencies

To simplify this early stage development, the command line uses external tools to handle media file operations. To work correctly you need:

  • ffmpeg (for media file conversion)
  • ffplay (for media playback)
  • ffprobe (for media file metadata extraction) Note: [Implementation pending]

Build

Just run make to build the project. The binary will be placed in the bin directory. You can move it to a directory in your PATH to make it available globally (if you are brave enough).

Usage

Create your MediaFS Collection!

First you will need to create your own MediaFS container collection, by adding media files to it. To do that run:

mediafs add --name "Collection Name" --output your.mediafs file1.flac file2.ogg file4.mp3 [...]
Inspect your new MediaFS!

To see the contents of your MediaFS collection, run:

mediafs read your.mediafs
Play your music from the MediaFS collection!

To play your MediaFS collection, run:

mediafs play --idx=tracknum your.mediafs

That's all folks!

TODO

A LOT. Bigger buggers:

  • All metadata info is still not handled in the MediaFS index file. It will still be present in the underlying media files but not exposed through the MediaFS interface.
  • No Video support yet!
  • No clean playback api or integration with standard media players (or gvfs/gstreamer) or any other media player framework.
  • Conquer the world! :)

Documentation

Index

Constants

View Source
const (
	Quit action = iota
	Next
	Prev
)
View Source
const (
	DefaultFileMode = 0644
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMediaFS

type CreateMediaFS struct {
	// contains filtered or unexported fields
}

func NewCreateMediaFS

func NewCreateMediaFS() *CreateMediaFS

func (*CreateMediaFS) AddItem

func (c *CreateMediaFS) AddItem(path string, external bool)

func (*CreateMediaFS) AddItems

func (c *CreateMediaFS) AddItems(items *[]string)

func (*CreateMediaFS) CreateEmpty

func (c *CreateMediaFS) CreateEmpty(name string)

func (*CreateMediaFS) Save

func (c *CreateMediaFS) Save(path string)

type MediaFSFile

type MediaFSFile struct {
	// contains filtered or unexported fields
}

func NewMediaFSFile

func NewMediaFSFile(path string) *MediaFSFile

func (*MediaFSFile) Close

func (f *MediaFSFile) Close() error

func (*MediaFSFile) Items

func (f *MediaFSFile) Items() []*pb.Item

func (*MediaFSFile) Name

func (f *MediaFSFile) Name() string

func (*MediaFSFile) ReadItem

func (f *MediaFSFile) ReadItem(item *pb.Item) (io.Reader, error)

type Player

type Player struct {
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(mfs *MediaFSFile) *Player

func (*Player) Play

func (p *Player) Play()

func (*Player) PlayTrack

func (p *Player) PlayTrack(tracknum int)

Directories

Path Synopsis
cmd
mediafs command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL