Médiathèque

User guide · version 0.3.2

Using Médiathèque

Everything the app does, in the order you are likely to meet it. Press F1 or choose Help in the app to open this guide at the page you are on.

Getting started

Médiathèque works on the folders you already have. It reads them, remembers what it found in its own index, and never rearranges anything unless you ask.

First launch

The first time it runs, a short setup walks through five pages: a welcome, your library folders, the video encoder (it can install ab-av1 and a suitable ffmpeg for you), a couple of preferences, and a summary. You can run it again later from Settings › Library › Run first-time setup again…

The first-run setup on its Library folders page, with two folders added.
The setup's Library folders page.

How your folders are read

  • A library folder is any folder you add. You can add as many as you like, on any drive. The + beside MEDIA TREE adds another at any time.
  • Each folder directly inside a library folder becomes a collection, and shows as a card in the Library.
  • Files sitting directly in a library folder are its Loose files.
  • Deeper folders stay folders in the Media Tree, and their names become tags on the files inside them.
  • Hidden folders, and system folders such as $RECYCLE.BIN, System Volume Information and lost+found, are skipped.

Indexing

The first scan lists every file quickly, then reads them in the background: a hash for each picture, a fingerprint for each video, and a thumbnail for both. The Status Bar shows how far it has got. Files changed in the last ten minutes are left alone until they settle, so a copy or download in progress is not read half-finished.

While Watch library folders is on, new and removed files are picked up as they happen. A full rescan also runs every hour; both are in Settings.

The window

The same frame surrounds everything. These names are used throughout the guide.

The main window with numbered markers on its eight areas. 1 2 3 4 5 6 7 8
  1. 1
    Media Libraries

    Library (everything), Protected and Unreadable (each shown only while it holds something), your own libraries, and New library…

  2. 2
    Media Tree

    Library folders, collections, folders and files, as they are on disk.

  3. 3
    Media Tree filter

    Type part of a name to see only matching folders and files.

  4. 4
    Media Browser

    Where media is shown: the Library, a collection, an album, or a tool page.

  5. 5
    Tag Bar

    The tags of the selected files. Click one to select it in the Tag Explorer.

  6. 6
    Tag Explorer

    Every tag in the current view with a count. Choose tags to filter.

  7. 7
    Control Bar

    Duplicates, Compress, Trash, Activity, Settings and Help.

  8. 8
    Status Bar

    A summary of the view, then the scanner, thumbnails, encoder and version.

One rule to remember

Folders happen in the Media Tree, files happen where you see them. Rename, move, protect or trash a folder from the Media Tree. Everything you can do to a file is on the file itself, wherever it is shown.

Closing the window keeps Médiathèque running in the system tray, so it can keep watching your folders. Exit in the tray menu, or Ctrl+Q, quits. You can turn this off in Settings.

The Library

The Library shows every collection as a card with a cover, its file counts and its size. A badge on the card counts the duplicates found in it. The Loose files of every library folder share one card.

The Library grid of collection cards.
Search collections by name, sort them by name, recently changed, oldest, size or file count, and narrow the grid to one library folder with the menu at the top right.

Right-click a card for:

  • Open, Show in Media Tree and Show in file manager.
  • Change cover art… Pick any picture or video frame from the collection and frame it. Covers are chosen automatically until you do.
  • Compress videos now, and Compress new videos automatically to queue every new video that arrives in this collection.
  • Rescan this collection.
The cover picker showing a grid of candidate pictures.
Choose the picture…
The cover framing step with a crop window over the chosen picture and a zoom slider.
…then drag and zoom to frame it.

Browsing a collection

Open a collection from its card or the Media Tree. Tabs split it by kind, with counts: All, Images, Videos and Audio (a kind with no files hides its tab), then Duplicates, and AKA when any file has one.

  • Filter by name (Ctrl+F) matches file names, tags and AKAs.
  • Sort by name, date, size, duration or resolution. The arrow beside it flips the direction.
  • The slider sets the tile size. Settings decides whether file names sit below the tiles, on them, or not at all.
  • Select turns on the selection bar: Select all, Select none, Protect, Compress and Move to trash act on everything selected.
  • Compress queues every video in the collection. The ⋯ menu holds Change cover art…, Show in Media Tree, Open in file manager and Rescan this collection.

Tags

Every file carries the names of the folders it sits in below the collection, plus any tags you give it yourself (Tags… on a file or a selection). The Tag Explorer on the right lists every tag in the view, most used first or by name. Choose one or more to show only files carrying any of them. Right-click a tag to rename it, remove it from the files shown, or delete it everywhere. Folder tags follow the folders, so they change only when the folder does.

Acting on files

Double-click a file to open it in the viewer. Right-click it for Open, Tags…, Add to album…, Show in Media Tree, Show in file manager, Rename… (F2), Protect, Compress and Move to trash (Delete). To move files, drag them onto a folder in the Media Tree.

The viewer

Pictures open fitted to the window; videos and audio play with a slider you can seek anywhere on. The arrow keys step through whatever view you opened it from. Info shows the file's details along the bottom.

The viewer showing a lake landscape full size with the info line along the bottom.
KeyWhat it does
← →Previous or next file (PgUp and PgDn too)
SpacePlay or pause; on a picture, the next file
J LBack or forward 10 seconds
MMute
0 1Fit to the window, or actual size
+ −Zoom in or out
IShow or hide the info line
PProtect or unprotect
F2Rename
OShow in the file manager
DeleteMove to the trash
FFull screen
EscClose the viewer

If you would rather use your desktop's own player or image viewer, Settings › Viewer can hand videos, pictures or audio to them instead.

The Media Tree

The Media Tree is your folders as they really are, and the place for anything that changes them.

  • Click a library folder to see its collections, a collection to open it, or a folder to open its collection filtered to that folder. Click a file to highlight it in the Media Browser, or double-click it to open it.
  • Select several items with Ctrl or Shift to see everything they contain together.
  • Drag files or folders onto another folder to move them. Moves to another drive show their progress.
  • Drag library folders above or below each other to reorder them.
  • Right-click for New folder…, Rename…, Protect folder, Move to trash, Show in file manager, and on a library folder, Rescan library folder and Remove from library…
The sidebar with the Media Tree filtered to names containing 'lake'.
The filter under the Media Tree, here showing everything named “lake”. Clearing it brings back the folders you had open.

Remove from library… only stops Médiathèque from tracking that folder. Nothing on disk is deleted, and its tags and album places are kept in case you add it back.

Duplicates

Médiathèque groups copies of the same picture or video, picks the one to keep, and lets you review every decision before anything moves.

What counts as a duplicate

  • Pictures are duplicates when their bytes are identical.
  • Videos are compared by fingerprint: a frame at 25%, 50% and 75% of the length, each reduced to 64 bits, 192 in all. Two videos within 12 bits of each other, with lengths that agree within 5% or one second, are the same video. That catches re-encodes, resized copies and different containers.

Which copy stays

In each group, the copy to keep is chosen in this order:

  1. A protected file always stays.
  2. The app's own work: a compressed video (or one already in AV1 or HEVC) beats an uncompressed one, even a larger one.
  3. The highest resolution.
  4. The largest file.
  5. Finally the shortest path, then the oldest, so the choice never flips between runs.

The Duplicates page

Duplicates in the Control Bar shows every group in your library. The totals at the top show what has been reclaimed so far, what is still reclaimable, and how many groups there are. The scope menu picks all groups, groups within one collection, or groups that span collections.

The Duplicates page with a group of identical photos, one protected and the others marked for removal.
  • Each copy is a card with its size, resolution, library folder, collection and folder. Copies marked for removal have a red border; Mark to keep changes that.
  • Click a card to see the group at full size in the viewer.
  • Click a copy's collection or folder to open it in your file manager, or its file name to see the file in its folder.
  • Not duplicates separates a group for good.
  • Remove marked in group acts on one group; Remove marked, Remove image dupes and Remove video dupes act on the groups shown.
  • Remove all duplicates takes every group, including those beyond the largest ones shown on the page.

The page opens on the last grouping, which is made after every scan, so it appears at once. Find duplicates groups again from scratch.

A collection's Duplicates tab

Each collection has its own Duplicates tab with the groups that involve it. A switch at the top says what this folder is for:

  • This folder holds the originals (the default): one copy of each group stays here, and the extra copies go, wherever they are.
  • This folder holds the duplicates: any copy here that also exists elsewhere leaves, and the copy elsewhere stays.

The choice is remembered per folder, so an “Official” folder can always be the original and an “Extras” folder always the duplicate. Protection outranks both.

A collection's Duplicates tab with the folder role switch and the groups involving that collection.

Merging folders

When two folders overlap, such as an old folder and its update, Merge folders… makes them one. It appears on a group whose copies sit in different folders, and in the Media Tree when you select two or more folders.

  • Choose the folder to keep. The preview shows what each folder holds, how many of its files have a duplicate in the others, and exactly what will happen before anything moves.
  • Duplicates between the folders go to the trash, keeping the best copy of each, even when that copy is in another folder: it moves into the one you keep.
  • Every other file moves in too, subfolders and all. Nothing is overwritten: if a name is taken, the file arrives as “name (1)”, and a video's subtitles get the same number.
  • Moved files are tagged with the name of the folder they came from. You can remove that tag like any other.
  • The emptied folders go to the trash.

A merge won't start while any file in the folders is still being read or has changed since the last scan, when one folder is inside another, or when a folder to be emptied is protected.

What happens when you remove

  • Removed copies go to the trash, not away.
  • Just before each removal the index and the disk are checked again. If a file changed since the grouping, that removal is refused.
  • The copy that stays inherits the removed copies' tags and folder names, and their file names become its AKAs.
  • If a removed copy sat in a manual album, the kept copy takes its place there.
  • Folders left empty by a removal can go to the trash too (Settings › Duplicates).

Automatic removal

Settings › Duplicates can remove duplicates within a collection after each scan. It is off by default, and groups that span collections always wait for you.

Compression

Compression re-encodes video to save space at a quality you choose. It needs the encoder tools, which the first-run setup installs; Settings › Compression can verify them.

The Compress page after a run, with one video done, three kept, and the log below.

Adding videos

Queue videos with Compress on a file, a selection, or a collection page, or with Compress videos now on a collection card. Compress new videos automatically on a card queues every new video that arrives in that collection.

The queue

The Compress page shows the file being encoded with its progress, totals for this queue and for all time, the queue itself, a log, and the space saved per collection. Pause after current, Cancel current, Retry failed and Clear finished control it.

OutcomeMeaning
doneThe smaller file replaced the original.
keptNo encode met the quality target at a smaller size, so the original stays untouched. This is not an error.
skippedShorter than the minimum length, already in the chosen codec, or otherwise not worth it.
failedSomething went wrong; the original is untouched and the log says why.

Settings that matter

  • Encoder: ab-av1 searches for the smallest AV1 file that meets the VMAF target (95 by default). NVENC, VA-API and plain CPU encoders are faster, with larger files and no quality search. Codec picks AV1 or HEVC for those.
  • Resize caps the smaller side at 480p, 720p (the default) or 1080p, or never resizes. Nothing is ever upscaled.
  • Skip videos shorter than 60 seconds by default, where the quality search costs more than it saves.

Your original is safe

The new file is written beside the original and swapped in only after the original is proven unchanged since the encode began. The compressed file keeps the original's fingerprint, so it still finds its duplicates, and it wins those groups.

Protection

Protect a file (Protect on the file, or P in the viewer), a folder (in the Media Tree), or a whole library folder (in the Media Tree or Settings). A protected file cannot be moved to the trash anywhere in the app, and it always wins its duplicate group. Protected files and folders are marked in gold.

The Protected library listing a protected folder and a protected file.
The Protected library appears under Media Libraries while anything is protected. It lists files protected on their own, and protected folders as tiles that open them.

The trash

Médiathèque keeps its own trash, separate from your desktop's. Each library folder has a hidden .mediatheque-trash folder on the same drive, so moving a file there is a rename rather than a copy, however large the file.

The Trash page with trashed files and a trashed folder.
  • The rail on the left groups the trash by collection. Right-click a group to restore or delete all of it.
  • Trashed folders show as one tile with their file count. Double-click one to see its contents.
  • Restore selected puts files back where they were. If something new now has that name, the restored file gets .restored added rather than replacing it.
  • Delete selected, Delete this collection's trash and Empty trash delete for good, after asking.

Settings › Trash can empty the trash automatically after a number of days. It keeps everything by default.

Libraries and albums

Your own libraries sit under Media Libraries. Choose New library… to make one; each holds albums. Nothing you do in an album moves, renames or deletes a file.

A custom library with smart and manual album cards.
  • Manual albums hold the files you drop on them, from any grid or the Media Tree, or add with Add to album…. Remove from album takes a file out.
  • Smart albums follow a folder: drop a folder or collection from the Media Tree onto a library. New files in that folder appear, trashed ones vanish, and renames and moves follow. A smart album's card has a ring and a gear in orange. To leave a file out, use Exclude from album; the Excluded tab brings it back.
  • In an album, files show a name rather than a file name. Rename in album… sets it without touching the file.
  • Folder names arrive as tags. Renaming or removing one inside an album affects that album only.
  • Albums have covers, chosen and framed like a collection's.
A smart album that follows the Alpine Trip folder, with folder tags in the Tag Explorer.

AKAs

When a duplicate is removed, its file name is saved on the copy that stays as an AKA, “also known as”. A descriptive name like “Emerald lake at sunrise” survives even when the camera's DSC_4410.jpg is the copy kept. Camera-style names such as IMG_1432, date stamps and plain numbers are not saved.

The AKA tab showing camera-named files with the descriptive names they inherited.

A collection or album with any AKAs gets an AKA tab. Each file shows its AKAs with Rename to this, a button to forget one, and Add AKA…. In a collection, renaming renames the file; in an album it sets the album name only. The name filter matches AKAs too.

Unreadable files

Some files cannot be read: a video with no usable stream, a picture that will not decode, a download that never finished. They cannot be compared for duplicates and show only as placeholders, so they get a library of their own under Media Libraries, shown only while there are some.

The Unreadable library listing an incomplete video download.

Every file action works here, so you can select them all and move them to the trash. Files changed in the last day are left out, since a download in progress looks exactly the same; once it finishes, it is read and drops off the list by itself.

Activity

The Activity page shows what Médiathèque is doing in the background: scanning, fingerprinting, thumbnails, duplicate grouping and encoding, with the processor time it is using and a list of recent events. Open log file opens the full log.

The Activity page with background task status and recent activity.

Settings

Settings in the Control Bar, or Ctrl+,, opens seven tabs.

The Settings dialog on its Library tab.
TabWhat is there
LibraryLibrary folders (add, remove, enable, rescan, protect), watching folders, closing to the tray, file names on tiles, the rescan interval, hashing threads, how long to leave recently changed files, and how gently background work runs.
ThumbnailsWhere a video's thumbnail frame comes from: the default, a number of seconds in, or a percentage of the way through.
DuplicatesAutomatic removal within collections, confirming bulk removals, trashing folders left empty, and the video match threshold (12 is the tested value).
CompressionEncoder, codec, SVT-AV1 preset, resize cap, minimum length, VMAF target, audio bitrate, priority, stall timeout, and Verify toolchain.
TrashKeep forever or empty after a number of days, and whether to confirm before moving to the trash.
ViewerHanding files to your desktop's own apps, autoplay, loop, start muted, and what the mouse wheel does on videos and pictures.
AppearanceThe colours for selection, protection and smart albums.

Keyboard shortcuts

KeyAnywhere in the window
Ctrl+1Library
Ctrl+2Duplicates
Ctrl+3Compress
Ctrl+4Trash
Ctrl+5Activity
Ctrl+,Settings
F1This guide, at the page you are on
F11Full screen
Ctrl+QQuit
KeyIn a grid of files
Ctrl+FFilter by name
Ctrl+ASelect all
F2Rename the current file
DeleteMove the selection to the trash (Backspace too)
EnterOpen the current file

The viewer's keys are listed with the viewer.

Where things live

These are the locations on Linux.

WhatWhere
Index and settings~/.local/share/mediatheque/mediatheque.sqlite
Encoder tools~/.local/share/mediatheque/tools/
Log~/.local/share/mediatheque/mediatheque.log
Thumbnails~/.cache/mediatheque/thumbs/ (safe to delete; they are made again)
Encoding work~/.cache/mediatheque/encode/
Trash<library folder>/.mediatheque-trash/, one per library folder

Command line

A few things work without the window, which is handy on a server or over SSH:

mediatheque-cli add-root /path/to/photos
mediatheque-cli scan
mediatheque-cli dupes --scope within
mediatheque-cli status
mediatheque-cli tools