Difference between revisions of "Documentation:Modules/time"

From VideoLAN Wiki
Jump to navigation Jump to search
 
m (Tweaks, change 268435456 to -268435456)
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Module|name=time|type=Video subfilter|last_version=0.8.6|description=Overlays date and time on the video}}
+
{{Historical|This filter has been merged with the [[Documentation:Modules/marq|marq]] filter in version 0.9.0.}}
 +
{{Module|name=time|type=Video sub-filter|first_version=0.8.0|last_version=0.8.6|description=Overlays date and time on the video|sc=time}}
 +
Allows overlaying date and time information on the video.
  
Allows overlaying date and time information on the video. This filter has been merged with the [[Documentation:Modules/marq|marq]] filter in version 0.9.0.
+
== Options ==
 +
The option for the time picture subfilter in version 0.8.6 are the following:
 +
{{Option|name=time-format|value=string|default="%Y-%m-%d  %H:%M:%S"|description=[[Special:PermanentLink/5790#Time|Time format string]] (%Y%m%d %H%M%S)}}
 +
{{Option|name=time-x|value=integer|default=-1|description=X offset}}
 +
{{Option|name=time-y|value=integer|default=0|description=Y offset}}
 +
{{Option|name=time-position<span id="time-position"></span>|value=integer|default=9|select=[[#appendix_time-position|{ 0, 1, 2, 4, 8, 5, 6, 9, 10 }]]|description=Position}}
 +
{{Option|name=time-opacity|value=integer|min=0|max=255|default=255|description=Opacity}}
 +
{{Option|name=time-color<span id="time-color"></span>|value=integer|default=16777215|select={ -268435456, 0, 8421504, 12632256, 16777215, 8388608, 16711680, 16711935, 16776960, 8421376, 32768, 32896, 65280, 8388736, 128, 255, 65535 }|description=Colour<sup>('''[[#appendix_time-color|key]]''')</sup>}}
 +
{{Option|name=time-size|value=integer|default=-1|description=Font size, pixels}}
  
{{Stub}}
+
== Usage ==
 +
There are two ways to use the time module: over screen output or display; and over transcoded output.
 +
 
 +
=== Screen output or display ===
 +
To overlay the current time over vlc screen output or display, use the --time-? options (where ? means "format," "x", "y" etc; i.e. --time-format). 
 +
 
 +
In this example, the time will be displayed in white on the lower right hand corner of the viewable output of a transcoded stream and sent to a multicast IP address with the associated SAP announce.
 +
 
 +
% '''vlc input_stream --sub-filter=time --time-format %Y-%m-%d,%H:%M:%S --time-position 9 --time-color 16777215 --time-size 12 --sout "#transcode{venc=ffmpeg,vcodec=mp4v}:duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}}"'''
 +
 
 +
In this example, the time will be displayed as 2007-6-19,10:09:33. In addition, the time will only be displayed on the visual display of the input_stream.  It will not be part of the transcoded output.
 +
 +
=== Transcoded output ===
 +
To overlay the current time over the transcoded output, enable the transcode module subpicture filter or sfilter option.
 +
 
 +
In this example, the time will be displayed in white on the lower right only in the transcoded output.
 +
 
 +
% '''vlc input_stream --time-format %Y-%m-%d,%H:%M:%S --time-position 9 --time-color 16777215 --time-size 12 --sout "#transcode{venc=ffmpeg,vcodec=mp4v,sfilter=time}:duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}}"'''
 +
 
 +
Note that this is accomplished by removing the --sub-filter=time command line option and adding the sfilter transcode module option.  If the --sub-filter=time is included vlc will overlay the time over the overlay transcode time, essentially overlapping it.
 +
 
 +
Also note that the --time-? command line options are "global;" i.e., they affect the way the time overlays both the display and the transcoded output.
 +
 
 +
== Source code ==
 +
* {{VLCSourceFile|p=vlc/vlc-0.8.git|modules/video_filter/time.c}}
 +
 
 +
== Appendix ==
 +
<div class="plainlist">
 +
*^ --[[#time-position|time-position]]<span id="appendix_time-position"></span>
 +
*^ --[[#time-color|time-color]]<span id="appendix_time-color"></span>
 +
</div>
 +
{{Alignment mapping}}
 +
{| class="mw-datatable sortable"
 +
|+ Colour key
 +
! scope="col" | Sample !! scope="col" | Integer code !! scope="col" | Colour
 +
|-
 +
| || <code>-268435456</code> || Default
 +
|-
 +
|style="background-color:black;"| || <code>0</code> || Black
 +
|-
 +
|style="background-color:gray;"| || <code>8421504</code> || Gray
 +
|-
 +
|style="background-color:silver;"| || <code>12632256</code> || Silver
 +
|-
 +
|style="background-color:white;"| || <code>16777215</code> || White
 +
|-
 +
|style="background-color:maroon;"| || <code>8388608</code> || Maroon
 +
|-
 +
|style="background-color:red;"| || <code>16711680</code> || Red
 +
|-
 +
|style="background-color:fuchsia;"| || <code>16711935</code> || Fuchsia
 +
|-
 +
|style="background-color:yellow;"| || <code>16776960</code> || Yellow
 +
|-
 +
|style="background-color:olive;"| || <code>8421376</code> || Olive
 +
|-
 +
|style="background-color:green;"| || <code>32768</code> || Green
 +
|-
 +
|style="background-color:teal;"| || <code>32896</code> || Teal
 +
|-
 +
|style="background-color:lime;"| || <code>65280</code> || Lime
 +
|-
 +
|style="background-color:purple;"| || <code>8388736</code> || Purple
 +
|-
 +
|style="background-color:navy;"| || <code>128</code> || Navy
 +
|-
 +
|style="background-color:blue;"| || <code>255</code> || Blue
 +
|-
 +
|style="background-color:aqua;"| || <code>65535</code> || Aqua
 +
|}
 +
 
 +
{{Documentation}}

Latest revision as of 04:15, 2 June 2019

This page is obsolete and kept only for historical interest. It may document features that are obsolete, superseded, or irrelevant. Do not rely on the information here being up-to-date.
Additional information: This filter has been merged with the marq filter in version 0.9.0.
Module: time
Type Video sub-filter
First VLC version 0.8.0
Last VLC version 0.8.6
Operating system(s) all
Description Overlays date and time on the video
Shortcut(s) time

Allows overlaying date and time information on the video.

Options

The option for the time picture subfilter in version 0.8.6 are the following:

  • time-format <string> : Time format string (%Y%m%d %H%M%S) default value: "%Y-%m-%d %H:%M:%S"
  • time-x <integer> : X offset default value: -1
  • time-y <integer> : Y offset default value: 0
  • time-position <integer> { 0, 1, 2, 4, 8, 5, 6, 9, 10 } : Position default value: 9
  • time-opacity <integer [0 .. 255]> : Opacity default value: 255
  • time-color <integer> { -268435456, 0, 8421504, 12632256, 16777215, 8388608, 16711680, 16711935, 16776960, 8421376, 32768, 32896, 65280, 8388736, 128, 255, 65535 } : Colour(key) default value: 16777215
  • time-size <integer> : Font size, pixels default value: -1

Usage

There are two ways to use the time module: over screen output or display; and over transcoded output.

Screen output or display

To overlay the current time over vlc screen output or display, use the --time-? options (where ? means "format," "x", "y" etc; i.e. --time-format).

In this example, the time will be displayed in white on the lower right hand corner of the viewable output of a transcoded stream and sent to a multicast IP address with the associated SAP announce.

% vlc input_stream --sub-filter=time --time-format %Y-%m-%d,%H:%M:%S --time-position 9 --time-color 16777215 --time-size 12 --sout "#transcode{venc=ffmpeg,vcodec=mp4v}:duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}}"

In this example, the time will be displayed as 2007-6-19,10:09:33. In addition, the time will only be displayed on the visual display of the input_stream. It will not be part of the transcoded output.

Transcoded output

To overlay the current time over the transcoded output, enable the transcode module subpicture filter or sfilter option.

In this example, the time will be displayed in white on the lower right only in the transcoded output.

% vlc input_stream --time-format %Y-%m-%d,%H:%M:%S --time-position 9 --time-color 16777215 --time-size 12 --sout "#transcode{venc=ffmpeg,vcodec=mp4v,sfilter=time}:duplicate{dst=display,dst=rtp{mux=ts,dst=239.255.12.42,sdp=sap,name="TestStream"}}"

Note that this is accomplished by removing the --sub-filter=time command line option and adding the sfilter transcode module option. If the --sub-filter=time is included vlc will overlay the time over the overlay transcode time, essentially overlapping it.

Also note that the --time-? command line options are "global;" i.e., they affect the way the time overlays both the display and the transcoded output.

Source code

Appendix

Integer alignment mapping
Integer Alignment Comment
0 Center
1 Left
2 Right
4 Top
8 Bottom
5 Top-Left 4 + 1
6 Top-Right 4 + 2
9 Bottom-Left 8 + 1
10 Bottom-Right 8 + 2
3 n/a contradictory
7 n/a contradictory
Colour key
Sample Integer code Colour
-268435456 Default
0 Black
8421504 Gray
12632256 Silver
16777215 White
8388608 Maroon
16711680 Red
16711935 Fuchsia
16776960 Yellow
8421376 Olive
32768 Green
32896 Teal
65280 Lime
8388736 Purple
128 Navy
255 Blue
65535 Aqua
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.