kitone / subtitleeditor

Subtitle Editor is a GTK+3 tool to create or edit subtitles for GNU/Linux/*BSD.
http://kitone.github.io/subtitleeditor/
GNU General Public License v3.0
99 stars 15 forks source link

change mplayer #56

Open Fr-Dae opened 2 years ago

Fr-Dae commented 2 years ago

hello could you detaing how to sed mpv or vlc by default please ?

EngelPika32 commented 2 years ago

Hi, this might help: (In the menu at the top) Extensions → external video player → settings: Insert your own command.

For mpv you can use mpv "#video_file" --sub-file="#subtitle_file" --start="#time" --length=5 --sub-file Specify subtitle file --start=<relative time> Seek to given time position. --length=<relative time> Stop after a given time relative to the start time. --fs fullscreen playback And ofc. any other mpv option you'd like to use (man mpv).

Same for vlc or any other video player ofc.^ (Unfortunately, you can't specify multiple players right now…)

ZacharyTalis commented 9 months ago

Here's our own little script for launching mpv from Subtitle Editor.

Recommended offset in ms: 500

Command:

bash [script-path] "#video_file" "#subtitle_file" "#time"

The actual script:

#!/usr/bin/env bash

LENGTH_MS=10000

pkill mpv

END="$(date -d @"$(date -d "$3" +"%s%3N + $LENGTH_MS" | bc | awk ' { print substr( $0, 0, length($0)-3 ) } ')" +"%H:%M:%S.$(echo "$3" | awk ' { print substr( $0, length($0)-2, length($0) ) } ')")"

mpv "$1" --sub-file="$2" --start="$3" --ab-loop-a="$3" --ab-loop-b="$END" --force-window="yes" --sub-scale="0.35" --sub-pos="65" --sub-back-color="0.0/0.0/0.0/1.0" --osd-level="2" --osd-fractions="yes" --osd-font-size="16" --osd-margin-x="154" --osd-margin-y="475" --title="%NOFOCUS%%SCREEN2%"

(The --title parameter coordinates with our personal KDE Window Rules configuration. Prevent window focus; display on Monitor 2.)