跳转至

13.4 视频

13.4 Movies

本小节描述的功能已过时,不再推荐使用。它们已被13.2“多媒体”中描述的一般多媒体框架所取代。

PDF 应通过电影(Movie)注释在文档中嵌入电影(参见 12.5.6.17,“电影注释”)。尽管名称为“电影”,但电影对象可能仅包含声音而没有任何可显示在屏幕上的可见图像。电影注释字典中的 Movie(电影)和 A(激活)条目应分别引用 电影字典表 295),该字典描述电影的静态特征,以及 电影激活字典表 296),该字典指定电影的播放方式。

表 295 – 电影字典中的条目
键(Key) 类型(Type) 值(Value)
F 文件规范 (必需)用于标识自描述电影文件的文件规范。
注意   自描述电影文件的格式应为...
Aspect 数组 (可选)电影边界框的宽度和高度,以像素为单位,格式为 [宽度 高度]。如果电影仅包含声音而无可见图像,则应省略此条目。
Rotate 整数 (可选)电影相对于页面应顺时针旋转的角度。该值应为 90 的倍数。默认值:0。
Poster 布尔值或流 (可选)指定是否以及如何显示代表电影的海报图像的标志或流。如果该值为流,则应包含要显示为海报的图像 XObject(参见 8.9,“图像”)。如果为布尔值 true,则海报图像应从电影文件中获取;如果为 false,则不显示海报。默认值:false

表 296 – 电影激活字典中的条目
键(Key) 类型(Type) 值(Value)
Start (多种) (可选)要播放的电影片段的起始时间。电影时间值应以基于时间尺度的时间单位表示,该时间尺度定义了每秒的单位数。默认时间尺度应在电影数据中定义。起始时间通常应为非负 64 位整数,格式如下:
  • 如果可以表示为整数(受附录 C 描述的整数实现限制约束),则应按整数指定。
  • 如果无法表示为整数,则应指定为 8 字节字符串,表示 64 位二补数整数,最高有效字节优先。
  • 如果以与电影本身不同的时间尺度表示,则应表示为包含两个值的数组:一个整数或字节字符串表示起始时间,后跟一个整数,指定时间尺度(每秒的单位数)。
如果省略此条目,则电影应从头开始播放。
Duration (多种) (可选)要播放的电影片段的持续时间,应与 Start 采用相同格式。如果省略此条目,则电影应播放至结束。
Rate 数值 (可选)电影的初始播放速度。如果此条目值为负,则电影应相对于 StartDuration 反向播放。默认值:1.0。
Volume 数值 (可选)电影的初始音量,范围为 -1.0 到 1.0。较大值表示更高音量;负值表示静音。默认值:1.0。
ShowControls 布尔值 (可选)指定在播放电影时是否显示电影控制栏的标志。默认值:false
Mode 名称 (可选)电影的播放模式:
Once   播放一次后停止。
Open   播放后保持电影控制栏打开。
Repeat   从头到尾重复播放,直到停止。
Palindrome   持续正向和反向播放,直到停止。
默认值:Once
Synchronous 布尔值 (可选)指定电影是否同步播放的标志。如果该值为 true,则电影播放器应保持控制权,直到电影播放完毕或被用户关闭。如果该值为 false,则播放器应在开始播放电影后立即将控制权返回给符合规范的阅读器。默认值:false
FWScale 数组 (可选)指定电影的放大(缩放)比例。该条目的存在意味着电影应在浮动窗口中播放。如果此条目不存在,则电影应在注释矩形内播放。
该条目的值应为包含两个正整数的数组 [分子 分母],表示电影的有理数放大比例。最终窗口大小(以像素为单位)计算公式如下:
(分子 ÷ 分母) × Aspect
其中,Aspect 的值应取自电影字典(参见 表 295)。
FWPosition 数组 (可选)对于浮动播放窗口,指定窗口在屏幕上的相对位置。值应为包含两个数值的数组 [水平位置 垂直位置],每个值范围为 0.0 到 1.0,表示电影窗口相对于屏幕的水平和垂直相对位置。
示例   值 [0.5 0.5] 使窗口居中于屏幕。
默认值:[0.5 0.5]。

The features described in this sub-clause are obsolescent and their use is no longer recommended. They are superseded by the general multimedia framework described in 13.2, “Multimedia.”

PDF shall embed movies within a document by means of movie annotations (see 12.5.6.17, “Movie Annotations”). Despite the name, a movie may consist entirely of sound with no visible images to be displayed on the screen. The Movie and A (activation) entries in the movie annotation dictionary shall refer, respectively, to a movie dictionary (Table 295) that shall describe the static characteristics of the movie and a movie activation dictionary (Table 296) that shall specify how it shall be presented.

Table 295 – Entries in a movie dictionary
Key Type Value
F file specification (Required) A file specification identifying a self-describing movie file.
NOTE   The format of a self-describing movie file shall be
Aspect array (Optional) The width and height of the movie’s bounding box, in pixels, and shall be specified as [ width height ]. This entry should be omitted for a movie consisting entirely of sound with no visible images.
Rotate integer (Optional) The number of degrees by which the movie shall be rotated clockwise relative to the page. The value shall be a multiple of 90. Default value: 0.
Poster boolean or stream (Optional) A flag or stream specifying whether and how a poster image representing the movie shall be displayed. If this value is a stream, it shall contain an image XObject (see 8.9, “Images”) to be displayed as the poster. If it is the boolean value true, the poster image shall be retrieved from the movie file; if it is false, no poster shall be displayed. Default value: false.

Table 296 – Entries in a movie activation dictionary
Key Type Value
Start (various) (Optional) The starting time of the movie segment to be played. Movie time values shall be expressed in units of time based on a time scale, which defines the number of units per second. The default time scale shall be defined in the movie data. The starting time shall be nominally a non-negative 64-bit integer, specified as follows:
  • If it is representable as an integer (subject to the implementation limit for integers, as described in Annex C), it shall be specified as such.
  • If it is not representable as an integer, it shall be specified as an 8-byte string representing a 64-bit twos-complement integer, most significant byte first.
  • If it is expressed in a time scale different from that of the movie itself, it shall be represented as an array of two values: an integer or byte string denoting the starting time, followed by an integer specifying the time scale in units per second.
If this entry is omitted, the movie shall be played from the beginning.
Duration (various) (Optional) The duration of the movie segment to be played, that shall be specified in the same form as Start. If this entry is omitted, the movie shall be played to the end.
Rate number (Optional) The initial speed at which to play the movie. If the value of this entry is negative, the movie shall be played backward with respect to Start and Duration. Default value: 1.0.
Volume number (Optional) The initial sound volume at which to play the movie, in the range −1.0 to 1.0. Higher values shall denote greater volume; negative values shall mute the sound. Default value: 1.0.
ShowControls boolean (Optional) A flag specifying whether to display a movie controller bar while playing the movie. Default value: false.
Mode name (Optional) The play mode for playing the movie:
Once   Play once and stop.
Open   Play and leave the movie controller bar open.
Repeat   Play repeatedly from beginning to end until stopped.
Palindrome   Play continuously forward and backward until stopped.
Default value: Once.
Synchronous boolean (Optional) A flag specifying whether to play the movie synchronously or asynchronously. If this value is true, the movie player shall retain control until the movie is completed or dismissed by the user. If the value is false, the player shall return control to the conforming reader immediately after starting the movie. Default value: false.
FWScale array (Optional) The magnification (zoom) factor at which the movie shall be played. The presence of this entry implies that the movie shall be played in a floating window. If the entry is absent, the movie shall be played in the annotation rectangle.
The value of the entry shall be an array of two positive integers, [ numerator denominator ], denoting a rational magnification factor for the movie. The final window size, in pixels, shall be
(numerator ÷ denominator) × Aspect
where the value of Aspect shall be taken from the movie dictionary (see Table 295).
FWPosition array (Optional) For floating play windows, the relative position of the window on the screen. The value shall be an array of two numbers
[ horiz vert ]
each in the range 0.0 to 1.0, denoting the relative horizontal and vertical position of the movie window with respect to the screen.
EXAMPLE   The value [ 0.5 0.5 ] centers the window on the screen.
Default value: [ 0.5 0.5 ].