Difference between revisions of "Documentation:Modules/subsdelay"

From VideoLAN Wiki
Jump to navigation Jump to search
(Dummy edit: For last 3 edits I meant "+GPL" not "+{{GPL}}". I changed {{Documentation footer}} to {{Documentation}} for the GPL category)
(Factual, misc.)
 
Line 1: Line 1:
 
{{Module|name=subsdelay|type=Video sub-filter|first_version=1.2.0|description=Change [[subtitles]] delay}}
 
{{Module|name=subsdelay|type=Video sub-filter|first_version=1.2.0|description=Change [[subtitles]] delay}}
<!--Dummy edit-->
+
 
 
The subsdelay filter can help slow readers to keep up with the subtitles.<br>
 
The subsdelay filter can help slow readers to keep up with the subtitles.<br>
 
It extends the subtitles duration without changing their original appearance time, so the subtitles are piled up on the video. To help keep track of the appearance order, existing subtitles gets more transparent as new subtitles arrive.
 
It extends the subtitles duration without changing their original appearance time, so the subtitles are piled up on the video. To help keep track of the appearance order, existing subtitles gets more transparent as new subtitles arrive.
  
The subtitles duration factor is configurable through the synchronization dialog. Other options can be set through the preferences (under Video → Subtitles/OSD → Subsdelay).
+
The subtitles duration factor [[VLC HowTo/Adjust subtitle delay|is configurable through the synchronization dialog]]. Other options can be set through the [[preferences]] (''show all settings'' → Video → Subtitles/OSD → Subsdelay).
  
 
== Options ==
 
== Options ==
=== Calculation parameters ===
 
 
{{Option
 
{{Option
 
|name=subsdelay-mode<span id="subsdelay-mode"></span>
 
|name=subsdelay-mode<span id="subsdelay-mode"></span>
Line 23: Line 22:
 
|description=The delay calculation parameter
 
|description=The delay calculation parameter
 
}}
 
}}
 
=== Display parameters ===
 
 
{{Option
 
{{Option
 
|name=subsdelay-overlap
 
|name=subsdelay-overlap
Line 38: Line 35:
 
|min=0
 
|min=0
 
|max=255
 
|max=255
|default=125
+
|default=70
 
|description=Alpha value of the earliest subtitle, where 0 is fully transparent and 255 is fully opaque.<br>Subtitles alpha is somewhere between fully opaque and this value according to the appearance order and the maximum overlapping allowed
 
|description=Alpha value of the earliest subtitle, where 0 is fully transparent and 255 is fully opaque.<br>Subtitles alpha is somewhere between fully opaque and this value according to the appearance order and the maximum overlapping allowed
 
}}
 
}}
Line 66: Line 63:
 
Example command line use '''(VLC 1.2.0 and above)''' :
 
Example command line use '''(VLC 1.2.0 and above)''' :
 
  % '''vlc --sub-filter subsdelay --subsdelay-mode 1 --subsdelay-factor 2 --subsdelay-overlap 3'''
 
  % '''vlc --sub-filter subsdelay --subsdelay-mode 1 --subsdelay-factor 2 --subsdelay-overlap 3'''
:Multiply subtitles duration by 2, up to 3 subtitles could be overlapped at a given time.
+
:Multiply subtitles duration by 2, up to 3 subtitles can be overlapped at a given time.
  
 
  % '''vlc --sub-filter subsdelay --subsdelay-mode 0 --subsdelay-factor 0 --subsdelay-overlap 1 --subsdelay-min-stop-start 0'''
 
  % '''vlc --sub-filter subsdelay --subsdelay-mode 0 --subsdelay-factor 0 --subsdelay-overlap 1 --subsdelay-min-stop-start 0'''
:Don't change subtitles duration but fix overlaps if exist.<br>
+
:Don't change subtitles duration but fix any existing overlaps.
 +
 
 +
== Source code ==
 +
* {{VLCSourceFile|modules/spu/subsdelay.c}}
  
 
== Appendix ==
 
== Appendix ==

Latest revision as of 06:10, 23 May 2019

Module: subsdelay
Type Video sub-filter
First VLC version 1.2.0
Last VLC version -
Operating system(s) all
Description Change subtitles delay
Shortcut(s) -

The subsdelay filter can help slow readers to keep up with the subtitles.
It extends the subtitles duration without changing their original appearance time, so the subtitles are piled up on the video. To help keep track of the appearance order, existing subtitles gets more transparent as new subtitles arrive.

The subtitles duration factor is configurable through the synchronization dialog. Other options can be set through the preferences (show all settings → Video → Subtitles/OSD → Subsdelay).

Options

  • subsdelay-mode <integer> { 0, 1, 2 } : Delay calculation mode default value: 1
  • subsdelay-factor <float [0.0 .. 20.0]> : The delay calculation parameter default value: 2.0
  • subsdelay-overlap <integer [1 .. 4]> : Maximum number of subtitles allowed at the same time default value: 3
  • subsdelay-min-alpha <integer [0 .. 255]> : Alpha value of the earliest subtitle, where 0 is fully transparent and 255 is fully opaque.
    Subtitles alpha is somewhere between fully opaque and this value according to the appearance order and the maximum overlapping allowed default value: 70

Overlap fix

These rules help fixing some "flickering" effects caused by the overlapping. They are applied after the initial delay is calculated in the following order:

  • subsdelay-min-stops <integer> : Minimum time (in milliseconds) that a subtitle should stay after its predecessor has disappeared (subtitle delay will be extended to meet this requirement) default value: 1000
  • subsdelay-min-stop-start <integer> : Minimum time (in milliseconds) between subtitle disappearance and a newer subtitle appearance (earlier subtitle delay will be extended to fill the gap) default value: 1000
  • subsdelay-min-start-stop <integer> : Minimum time (in milliseconds) that a subtitle should stay after a newer subtitle has appeared (earlier subtitle delay will be shortened to avoid the overlap) default value: 1000

Examples

Example command line use (VLC 1.2.0 and above) :

% vlc --sub-filter subsdelay --subsdelay-mode 1 --subsdelay-factor 2 --subsdelay-overlap 3
Multiply subtitles duration by 2, up to 3 subtitles can be overlapped at a given time.
% vlc --sub-filter subsdelay --subsdelay-mode 0 --subsdelay-factor 0 --subsdelay-overlap 1 --subsdelay-min-stop-start 0
Don't change subtitles duration but fix any existing overlaps.

Source code

Appendix

For option --subsdelay-mode:

0
new_delay = original_delay + factor
Absolute delay - add an absolute delay to each subtitle.
In this mode the factor represents seconds
1
new_delay = original_delay * factor
Relative to source delay - multiply subtitles delay.
2
new_delay = f(original_text, factor)
Relative to source content - determine subtitles delay from its content.
The delay calculation is based on the number and length of the words in the subtitle.
This mode could only work for plain subtitles sources (like SubRip, MicroDVD, etc), for other formats the "relative to source delay" mode is used instead
This page is part of official VLC media player Documentation (User GuideStreaming HowToHacker GuideModules)
Please read the Documentation Editing Guidelines before you edit the documentation
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.