Difference between revisions of "Documentation:Modules/subsdelay"

From VideoLAN Wiki
Jump to navigation Jump to search
(+{{GPL}}, format)
Line 1: Line 1:
{{Module
+
{{Module|name=subsdelay|type=Video sub-filter|first_version=1.2.0|description=Change [[subtitles]] delay}}
|name=subsdelay
 
|type=Video subfilter
 
|first_version=1.2.0
 
|description=Change subtitles delay}}  
 
  
The subsdelay filter can help slow readers to keep up with the subtitles.
+
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 &gt; Subtitles/OSD &gt; Subsdelay).
+
The subtitles duration factor is configurable through the synchronization dialog. Other options can be set through the preferences (under Video Subtitles/OSD Subsdelay).
  
 
== Options ==
 
== Options ==
Calculation parameters:
+
=== Calculation parameters ===
 
{{Option
 
{{Option
|name=mode
+
|name=subsdelay-mode<span id="subsdelay-mode"></span>
|value=0,1,2
+
|value=integer
 +
|select=[[#appendix_subsdelay-mode|{ 0, 1, 2 }]]
 
|default=1
 
|default=1
 
|description=Delay calculation mode
 
|description=Delay calculation mode
 
}}
 
}}
 
{{Option
 
|name=mode 0
 
|description=Absolute delay - add an absolute delay to each subtitle.<br>
 
:<i>new_delay = original_delay + factor</i><br>
 
:In this mode the factor represents seconds
 
}}
 
 
{{Option
 
|name=mode 1
 
|description=Relative to source delay - multiply subtitles delay.<br>
 
:<i>new_delay = original_delay * factor</i>
 
}}
 
 
{{Option
 
|name=mode 2
 
|description=Relative to source content - determine subtitles delay from its content.<br>
 
:The delay calculation is based on the number and length of the words in the subtitle.<br>
 
:<i>new_delay = f(original_text, factor)</i><br>
 
: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
 
}}
 
 
 
{{Option
 
{{Option
|name=factor
+
|name=subsdelay-factor
|value=0.0-20.0
+
|value=float
 +
|min=0.0
 +
|max=20.0
 
|default=2.0
 
|default=2.0
 
|description=The delay calculation parameter
 
|description=The delay calculation parameter
 
}}
 
}}
  
 
+
=== Display parameters ===
Display parameters:
 
 
{{Option
 
{{Option
|name=overlap
+
|name=subsdelay-overlap
|value=1-4
+
|value=integer
 +
|min=1
 +
|max=4
 
|default=3
 
|default=3
 
|description=Maximum number of subtitles allowed at the same time
 
|description=Maximum number of subtitles allowed at the same time
 
}}
 
}}
 
 
{{Option
 
{{Option
|name=min-alpha
+
|name=subsdelay-min-alpha
|value=0-255
+
|value=integer
 +
|min=0
 +
|max=255
 
|default=125
 
|default=125
 
|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
 
}}
 
}}
  
 
+
=== Overlap fix ===
Overlap fix:<br>
 
 
These rules help fixing some "flickering" effects caused by the overlapping. They are applied after the initial delay is calculated in the following order:
 
These rules help fixing some "flickering" effects caused by the overlapping. They are applied after the initial delay is calculated in the following order:
 
 
{{Option
 
{{Option
|name=min-stops
+
|name=subsdelay-min-stops
 
|value=integer
 
|value=integer
 
|default=1000
 
|default=1000
 
|description=Minimum time (in milliseconds) that a subtitle should stay after its predecessor has disappeared (subtitle delay will be extended to meet this requirement)
 
|description=Minimum time (in milliseconds) that a subtitle should stay after its predecessor has disappeared (subtitle delay will be extended to meet this requirement)
 
}}
 
}}
 
 
{{Option
 
{{Option
|name=min-stop-start
+
|name=subsdelay-min-stop-start
 
|value=integer
 
|value=integer
 
|default=1000
 
|default=1000
 
|description=Minimum time (in milliseconds) between subtitle disappearance and a newer subtitle appearance (earlier subtitle delay will be extended to fill the gap)
 
|description=Minimum time (in milliseconds) between subtitle disappearance and a newer subtitle appearance (earlier subtitle delay will be extended to fill the gap)
 
}}
 
}}
 
 
{{Option
 
{{Option
|name=min-start-stop
+
|name=subsdelay-min-start-stop
 
|value=integer
 
|value=integer
 
|default=1000
 
|default=1000
Line 88: Line 63:
 
}}
 
}}
  
== Examples ==
+
== Examples ==
 
+
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 could be overlapped at a given time.
Line 97: Line 70:
 
  % '''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 overlaps if exist.<br>
 +
 +
== Appendix ==
 +
<span id="appendix_subsdelay-mode"></span>
 +
For option --[[#subsdelay-mode|subsdelay-mode]]:
 +
;0:<code>new_delay = original_delay + factor</code><br>Absolute delay - add an absolute delay to each subtitle.<br>In this mode the factor represents seconds
 +
;1:<code>new_delay = original_delay * factor</code><br>Relative to source delay - multiply subtitles delay.
 +
;2:<code>new_delay = f(original_text, factor)</code><br>Relative to source content - determine subtitles delay from its content.<br>The delay calculation is based on the number and length of the words in the subtitle.<br>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
 +
 +
{{Documentation}}
  
 
[[Category:Subtitles]]
 
[[Category:Subtitles]]

Revision as of 05:36, 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 (under Video → Subtitles/OSD → Subsdelay).

Options

Calculation parameters

  • 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

Display parameters

  • 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: 125

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 could 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 overlaps if exist.

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.