File: Theora.pm

package info (click to toggle)
libimage-exiftool-perl 11.16-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 24,024 kB
  • sloc: perl: 245,177; xml: 120; makefile: 9
file content (145 lines) | stat: -rw-r--r-- 3,497 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#------------------------------------------------------------------------------
# File:         Theora.pm
#
# Description:  Read Theora video meta information
#
# Revisions:    2011/07/13 - P. Harvey Created
#
# References:   1) http://www.theora.org/doc/Theora.pdf
#------------------------------------------------------------------------------

package Image::ExifTool::Theora;

use strict;
use vars qw($VERSION);
use Image::ExifTool qw(:DataAccess :Utils);

$VERSION = '1.00';

# Theora header types
%Image::ExifTool::Theora::Main = (
    NOTES => q{
        Information extracted from Ogg Theora video files.  See
        L<http://www.theora.org/doc/Theora.pdf> for the Theora specification.
    },
    0x80 => {
        Name => 'Identification',
        SubDirectory => {
            TagTable => 'Image::ExifTool::Theora::Identification',
            ByteOrder => 'BigEndian',
        },
    },
    0x81 => {
        Name => 'Comments',
        SubDirectory => {
            TagTable => 'Image::ExifTool::Vorbis::Comments',
        },
    },
    # 0x82 - Setup
);

# tags extracted from Theora Idenfication header
%Image::ExifTool::Theora::Identification = (
    PROCESS_PROC => \&Image::ExifTool::ProcessBinaryData,
    GROUPS => { 2 => 'Video' },
    NOTES => 'Tags extracted from the Theora identification header.',
    0 => {
        Name => 'TheoraVersion',
        Format => 'int8u[3]',
        PrintConv => '$val =~ tr/ /./; $val',
    },
    7 => {
        Name => 'ImageWidth',
        Format => 'int32u',
        ValueConv => '$val >> 8',
    },
    10 => {
        Name => 'ImageHeight',
        Format => 'int32u',
        ValueConv => '$val >> 8',
    },
    13 => 'XOffset',
    14 => 'YOffset',
    15 => {
        Name => 'FrameRate',
        Format => 'rational64u',
        PrintConv => 'int($val * 1000 + 0.5) / 1000',
    },
    23 => {
        Name => 'PixelAspectRatio',
        Format => 'int16u[3]',
        ValueConv => 'my @a=split(" ",$val); (($a[0]<<8)+($a[1]>>8)) / ((($a[1]&0xff)<<8)+$a[2])',
        PrintConv => 'int($val * 1000 + 0.5) / 1000',
    },
    29 => {
        Name => 'ColorSpace',
        PrintConv => {
            0 => 'Undefined',
            1 => 'Rec. 470M',
            2 => 'Rec. 470BG',
        },
    },
    30 => {
        Name => 'NominalVideoBitrate',
        Format => 'int32u',
        ValueConv => '$val >> 8',
        PrintConv => {
            0 => 'Unspecified',
            OTHER => \&Image::ExifTool::ConvertBitrate,
        },
    },
    33 => {
        Name => 'Quality',
        ValueConv => '$val >> 2',
    },
    34 => {
        Name => 'PixelFormat',
        ValueConv => '($val >> 3) & 0x3',
        PrintConv => {
            0 => '4:2:0',
            2 => '4:2:2',
            3 => '4:4:4',
        },
    },
);

1;  # end

__END__

=head1 NAME

Image::ExifTool::Theora - Read Theora video meta information

=head1 SYNOPSIS

This module is used by Image::ExifTool

=head1 DESCRIPTION

This module contains definitions required by Image::ExifTool to extract meta
information from Theora video streams.

=head1 AUTHOR

Copyright 2003-2018, Phil Harvey (phil at owl.phy.queensu.ca)

This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=head1 REFERENCES

=over 4

=item L<http://www.theora.org/doc/Theora.pdf>

=back

=head1 SEE ALSO

L<Image::ExifTool::TagNames/Theora Tags>,
L<Image::ExifTool::TagNames/Ogg Tags>,
L<Image::ExifTool(3pm)|Image::ExifTool>

=cut