media-toc-player is a media player with a table of contents which allows seeking to a given chapter and optionally looping on current chapter.
media-toc-player is a simplication of media-toc, an application to create and edit a table of contents from a media file. It is primarily developed in Rust on Linux, it runs on Windows and should also work on macOS.
- Play any media supported by the installed GStreamer plugins.
- Select the video / audio stream to play.
- Show the chapters list for the media.
- Move to a chapter by clicking on its entry the list.
- Loop on current chapter.
- Switch to full screen mode.
- Display subtitles.
- Make timeline foldable.
- Finalize flatpak and deal with potential license issues with plugins.
The following functions are bound to one or multiple key accelerators:
Function | keys |
---|---|
Open media dialog | <Ctrl> + O |
Quit the application | <Ctrl> + Q |
Play/Pause (and open media dialog when no media is loaded) | Space or Play key |
Step forward | Right |
Step back | Left |
Go to next chapter | Down or Next key |
Go to the beginning of current chapter or previous chapter | Up or Prev key |
Close the info bar | Escape |
Toggle show/hide chapters list | L |
Toggle repeat current chapter | R |
Show the Display perspective | F5 |
Show the Streams perspective | F6 |
Open the about dialog | <Ctrl> + A |
media-toc-player is developed in Rust and uses the following technologies:
- GTK-3 (official documentation, Rust binding) and Glade.
- GStreamer (official documentation, Rust binding).
$ curl https://sh.rustup.rs -sSf | sh
Select the stable toolchain. See the full documentation here.
Rust dependencies are handled by Cargo. You will also need the following packages installed on your OS:
sudo dnf install gtk3-devel glib2-devel gstreamer1-devel \
gstreamer1-plugins-base-devel gstreamer1-plugins-{good,bad-free,ugly-free} \
gstreamer1-libav
sudo apt-get install libgtk-3-dev libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-{good,bad,ugly} \
gstreamer1.0-libav
brew install gtk+3 gstreamer
brew install --with-libvorbis --with-opus --with-theora gst-plugins-base
brew install --with-flac --with-gtk+3 --with-libpng --with-taglib gst-plugins-good
brew install --with-srt gst-plugins-bad
brew install --with-libmpeg2 --with-x264 gst-plugins-ugly
The package adwaita-icon-theme
might allow installing the missing icons, but
it fails while compiling the Rust compiler (which is used to compile librsvg
).
I'll try to configure the formula so that it uses the installed compiler when I
get time.
Use the following command to build and generate locales:
PATH="/usr/local/opt/gettext/bin:$PATH" cargo build --release
- MSYS2: follow this guide.
- Install the development toolchain, GTK and GStreamer
Note: for a 32bits system, usemingw-w64-i686-...
pacman --noconfirm -S gettext-devel mingw-w64-x86_64-gtk3 mingw-w64-x86_64-gstreamer
pacman --noconfirm -S mingw-w64-x86_64-gst-plugins-{base,good,bad,ugly} mingw-w64-x86_64-gst-libav
- Launch the rustup installer.
When asked for the default host triple, select
x86_64-pc-windows-gnu
(ori686-pc-windows-gnu
for a 32bits system), then selectstable
. - From a MSYS2 mingw shell
- add cargo to the
PATH
:
echo 'PATH=$PATH:/c/Users/'$USER'/.cargo/bin' >> /home/$USER/.bashrc
- Restart the MSYS2 shell before using
cargo
.
- add cargo to the
Use Cargo (from the root of the project directory):
$ cargo run --release
media-toc-player is currently available in English and French. The user's locale should be automatically detected. If you want to use the English version or if you want to submit logs, you can discard the translations using the following command:
LC_MESSAGES=C cargo run --release