Documentation:Modules/time

From VideoLAN Wiki
Jump to navigation Jump to search
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.