Skip to main content

Media

This page outlines how media like images and videos are handled within the backend application.

Here is the updated markdown table including the format names as a second column:

Supported Formats

Supported Image Formats

FormatNameMIME Type
.bmpBitmap Imageimage/bmp
.jpegJPEG Imageimage/jpeg
.pngPortable Network Graphicsimage/png
.tiffTagged Image File Formatimage/tiff
.gifGraphics Interchange Formatimage/gif
.icoIcon Formatimage/vnd.microsoft.icon

Supported Audio Formats

FormatNameMIME Type
.mp3MPEG Audioaudio/mpeg
.wavWaveform Audioaudio/wav
.oggOgg Vorbisaudio/ogg
.aacAdvanced Audio Codecaudio/aac
.flacFree Lossless Audio Codecaudio/flac
.wmaWindows Media Audioaudio/x-ms-wma
.amrAdaptive Multi-Rateaudio/amr
.mp4MPEG-4 Audioaudio/mp4

Supported Video Formats

FormatNameMIME Type
.mp4MPEG-4 Videovideo/mp4
.aviAudio Video Interleavevideo/x-msvideo
.movQuickTimevideo/quicktime
.wmvWindows Media Videovideo/x-ms-wmv
.flvFlash Videovideo/x-flv
.mkvMatroska Videovideo/x-matroska
.webmWebM Videovideo/webm
.mpegMPEG Videovideo/mpeg
.3gp3GPP Multimedia Filevideo/3gpp

Media Persistence

GameVault stores media either by persisting them to the filesystem using the media directory (by default /media) or by saving a link to an external URL.

Media that is stored on the filesystem

  • game_metadata.cover: Game Box Arts
  • game_metadata.background: Game Background Images
  • gamevault_user.avatar: User Avatars
  • gamevault_user.background: User Background Images

Media that is stored as an external resource

  • game_metadata.url_screenshots: Game Screenshots
  • game_metadata.url_trailers: Game Trailers
  • game_metadata.url_gameplays: Gameplay Videos
note

Note the url_ prefix.

Duplicate Media

GameVault stores each media resource referenced in the database as one-to-one, with no media reuse. So it's normal to see duplicates.

Media Garbage Collection

Potential data loss

Garbage collection can result in data loss, as it will delete any files inside the media folder without an association in the database. For example if you set up a new, empty database. It is advisable to regularly back up your media just to be safe. If you don't want to lose any data, you can disable garbage collection by setting the MEDIA_GC_DISABLED environment variable to true.

GameVault regularly cleans up its media in the database and filesystem to keep things tidy. We call this process garbage collection.

You can control how often the garbage colletion happens by changing the value of MEDIA_GC_INTERVAL_IN_MINUTES.

During cleanup, GameVault first gets rid of all media in the database that aren't used. Afterwards, it deletes all media files in the media folder that don't match any database entries. So please don't put any files in the media folder that you don't want to be deleted.

Turning off Garbage Collection

If you want to turn off this feature, you can disableit by setting the MEDIA_GC_DISABLED environment variable to true.