Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change mplayer #56

Open
Fr-Dae opened this issue Feb 21, 2022 · 2 comments
Open

change mplayer #56

Fr-Dae opened this issue Feb 21, 2022 · 2 comments

Comments

@Fr-Dae
Copy link

Fr-Dae commented Feb 21, 2022

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

@EngelPika32
Copy link

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
Copy link

ZacharyTalis commented Sep 29, 2023

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

  • Terminates any mpv already running
  • Loops 10 seconds (LENGTH_MS)
  • Includes timestamp OSD

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants