1 | #------------------------------------------------------------------------------
|
---|
2 | # File: Theora.pm
|
---|
3 | #
|
---|
4 | # Description: Read Theora video meta information
|
---|
5 | #
|
---|
6 | # Revisions: 2011/07/13 - P. Harvey Created
|
---|
7 | #
|
---|
8 | # References: 1) http://www.theora.org/doc/Theora.pdf
|
---|
9 | #------------------------------------------------------------------------------
|
---|
10 |
|
---|
11 | package Image::ExifTool::Theora;
|
---|
12 |
|
---|
13 | use strict;
|
---|
14 | use vars qw($VERSION);
|
---|
15 | use Image::ExifTool qw(:DataAccess :Utils);
|
---|
16 |
|
---|
17 | $VERSION = '1.00';
|
---|
18 |
|
---|
19 | # Theora header types
|
---|
20 | %Image::ExifTool::Theora::Main = (
|
---|
21 | NOTES => q{
|
---|
22 | Information extracted from Ogg Theora video files. See
|
---|
23 | L<http://www.theora.org/doc/Theora.pdf> for the Theora specification.
|
---|
24 | },
|
---|
25 | 0x80 => {
|
---|
26 | Name => 'Identification',
|
---|
27 | SubDirectory => {
|
---|
28 | TagTable => 'Image::ExifTool::Theora::Identification',
|
---|
29 | ByteOrder => 'BigEndian',
|
---|
30 | },
|
---|
31 | },
|
---|
32 | 0x81 => {
|
---|
33 | Name => 'Comments',
|
---|
34 | SubDirectory => {
|
---|
35 | TagTable => 'Image::ExifTool::Vorbis::Comments',
|
---|
36 | },
|
---|
37 | },
|
---|
38 | # 0x82 - Setup
|
---|
39 | );
|
---|
40 |
|
---|
41 | # tags extracted from Theora Idenfication header
|
---|
42 | %Image::ExifTool::Theora::Identification = (
|
---|
43 | PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
|
---|
44 | GROUPS => { 2 => 'Video' },
|
---|
45 | NOTES => 'Tags extracted from the Theora identification header.',
|
---|
46 | 0 => {
|
---|
47 | Name => 'TheoraVersion',
|
---|
48 | Format => 'int8u[3]',
|
---|
49 | PrintConv => '$val =~ tr/ /./; $val',
|
---|
50 | },
|
---|
51 | 7 => {
|
---|
52 | Name => 'ImageWidth',
|
---|
53 | Format => 'int32u',
|
---|
54 | ValueConv => '$val >> 8',
|
---|
55 | },
|
---|
56 | 10 => {
|
---|
57 | Name => 'ImageHeight',
|
---|
58 | Format => 'int32u',
|
---|
59 | ValueConv => '$val >> 8',
|
---|
60 | },
|
---|
61 | 13 => 'XOffset',
|
---|
62 | 14 => 'YOffset',
|
---|
63 | 15 => {
|
---|
64 | Name => 'FrameRate',
|
---|
65 | Format => 'rational64u',
|
---|
66 | PrintConv => 'int($val * 1000 + 0.5) / 1000',
|
---|
67 | },
|
---|
68 | 23 => {
|
---|
69 | Name => 'PixelAspectRatio',
|
---|
70 | Format => 'int16u[3]',
|
---|
71 | ValueConv => 'my @a=split(" ",$val); (($a[0]<<8)+($a[1]>>8)) / ((($a[1]&0xff)<<8)+$a[2])',
|
---|
72 | PrintConv => 'int($val * 1000 + 0.5) / 1000',
|
---|
73 | },
|
---|
74 | 29 => {
|
---|
75 | Name => 'ColorSpace',
|
---|
76 | PrintConv => {
|
---|
77 | 0 => 'Undefined',
|
---|
78 | 1 => 'Rec. 470M',
|
---|
79 | 2 => 'Rec. 470BG',
|
---|
80 | },
|
---|
81 | },
|
---|
82 | 30 => {
|
---|
83 | Name => 'NominalVideoBitrate',
|
---|
84 | Format => 'int32u',
|
---|
85 | ValueConv => '$val >> 8',
|
---|
86 | PrintConv => {
|
---|
87 | 0 => 'Unspecified',
|
---|
88 | OTHER => \&Image::ExifTool::ConvertBitrate,
|
---|
89 | },
|
---|
90 | },
|
---|
91 | 33 => {
|
---|
92 | Name => 'Quality',
|
---|
93 | ValueConv => '$val >> 2',
|
---|
94 | },
|
---|
95 | 34 => {
|
---|
96 | Name => 'PixelFormat',
|
---|
97 | ValueConv => '($val >> 3) & 0x3',
|
---|
98 | PrintConv => {
|
---|
99 | 0 => '4:2:0',
|
---|
100 | 2 => '4:2:2',
|
---|
101 | 3 => '4:4:4',
|
---|
102 | },
|
---|
103 | },
|
---|
104 | );
|
---|
105 |
|
---|
106 | 1; # end
|
---|
107 |
|
---|
108 | __END__
|
---|
109 |
|
---|
110 | =head1 NAME
|
---|
111 |
|
---|
112 | Image::ExifTool::Theora - Read Theora video meta information
|
---|
113 |
|
---|
114 | =head1 SYNOPSIS
|
---|
115 |
|
---|
116 | This module is used by Image::ExifTool
|
---|
117 |
|
---|
118 | =head1 DESCRIPTION
|
---|
119 |
|
---|
120 | This module contains definitions required by Image::ExifTool to extract meta
|
---|
121 | information from Theora video streams.
|
---|
122 |
|
---|
123 | =head1 AUTHOR
|
---|
124 |
|
---|
125 | Copyright 2003-2021, Phil Harvey (philharvey66 at gmail.com)
|
---|
126 |
|
---|
127 | This library is free software; you can redistribute it and/or modify it
|
---|
128 | under the same terms as Perl itself.
|
---|
129 |
|
---|
130 | =head1 REFERENCES
|
---|
131 |
|
---|
132 | =over 4
|
---|
133 |
|
---|
134 | =item L<http://www.theora.org/doc/Theora.pdf>
|
---|
135 |
|
---|
136 | =back
|
---|
137 |
|
---|
138 | =head1 SEE ALSO
|
---|
139 |
|
---|
140 | L<Image::ExifTool::TagNames/Theora Tags>,
|
---|
141 | L<Image::ExifTool::TagNames/Ogg Tags>,
|
---|
142 | L<Image::ExifTool(3pm)|Image::ExifTool>
|
---|
143 |
|
---|
144 | =cut
|
---|
145 |
|
---|