mediainfo-native 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ext/mediainfo_native/MediaInfoDLL.h +618 -0
- data/ext/mediainfo_native/basestream.cpp +88 -0
- data/ext/mediainfo_native/basestream.h +34 -0
- data/ext/mediainfo_native/extconf.rb +9 -0
- data/ext/mediainfo_native/mediainfo_native.cpp +16 -0
- data/ext/mediainfo_native/mediainfo_wrapper.cpp +184 -0
- data/ext/mediainfo_native/mediainfo_wrapper.h +40 -0
- data/lib/mediainfo-native/attr_readers.rb +83 -0
- data/lib/mediainfo-native/base_stream.rb +15 -0
- data/lib/mediainfo-native/mediainfo.rb +45 -0
- data/lib/mediainfo-native/streams/audio.rb +39 -0
- data/lib/mediainfo-native/streams/general.rb +22 -0
- data/lib/mediainfo-native/streams/image.rb +13 -0
- data/lib/mediainfo-native/streams/menu.rb +8 -0
- data/lib/mediainfo-native/streams/other.rb +6 -0
- data/lib/mediainfo-native/streams/text.rb +8 -0
- data/lib/mediainfo-native/streams/video.rb +94 -0
- data/lib/mediainfo-native/version.rb +3 -0
- data/lib/mediainfo-native.rb +16 -0
- metadata +91 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
module MediaInfoNative
|
2
|
+
class VideoStream < BaseStream
|
3
|
+
mediainfo_attr_reader :stream_id, 'ID'
|
4
|
+
|
5
|
+
mediainfo_duration_reader :duration, 'Duration'
|
6
|
+
|
7
|
+
mediainfo_attr_reader :stream_size, 'StreamSize'
|
8
|
+
mediainfo_attr_reader :bit_rate, 'BitRate'
|
9
|
+
mediainfo_attr_reader :nominal_bit_rate, 'BitRate_Nominal'
|
10
|
+
|
11
|
+
mediainfo_attr_reader :bit_rate_mode, 'BitRate_Mode'
|
12
|
+
def cbr?
|
13
|
+
video? && 'Constant' == bit_rate_mode
|
14
|
+
end
|
15
|
+
|
16
|
+
def vbr?
|
17
|
+
video? && !cbr?
|
18
|
+
end
|
19
|
+
|
20
|
+
mediainfo_attr_reader :scan_order, 'ScanOrder'
|
21
|
+
mediainfo_attr_reader :scan_type, 'ScanType'
|
22
|
+
def interlaced?
|
23
|
+
video? && 'Interlaced' == scan_type
|
24
|
+
end
|
25
|
+
|
26
|
+
def progressive?
|
27
|
+
video? && !interlaced?
|
28
|
+
end
|
29
|
+
|
30
|
+
mediainfo_int_reader :bitdepth, 'BitDepth'
|
31
|
+
|
32
|
+
mediainfo_int_reader :resolution, 'Resolution'
|
33
|
+
|
34
|
+
mediainfo_attr_reader :colorimetry, 'Colorimetry'
|
35
|
+
mediainfo_attr_reader :colorspace, 'ColorSpace'
|
36
|
+
alias_method :color_space, :colorspace
|
37
|
+
|
38
|
+
mediainfo_attr_reader :format, 'Format'
|
39
|
+
mediainfo_attr_reader :format_info, 'Format_Info'
|
40
|
+
mediainfo_attr_reader :format_profile, 'Format_Profile'
|
41
|
+
mediainfo_attr_reader :format_version, 'Format_Version'
|
42
|
+
mediainfo_attr_reader :format_settings_cabac, 'Format_Settings_CABAC'
|
43
|
+
mediainfo_attr_reader :format_settings_reframes, 'Format_Settings_ReFrames'
|
44
|
+
mediainfo_attr_reader :format_settings_matrix, 'Format_Settings_Matrix'
|
45
|
+
mediainfo_attr_reader :format_settings_gop, 'Format_Settings_GOP'
|
46
|
+
|
47
|
+
mediainfo_attr_reader :colour_primaries, 'colour_primaries'
|
48
|
+
alias_method :color_primaries, :colour_primaries
|
49
|
+
|
50
|
+
mediainfo_attr_reader :transfer_characteristics, 'transfer_characteristics'
|
51
|
+
mediainfo_attr_reader :matrix_coefficients, 'matrix_coefficients'
|
52
|
+
|
53
|
+
mediainfo_attr_reader :codec_id, 'CodecID'
|
54
|
+
mediainfo_attr_reader :codec_info, 'CodecID/Info'
|
55
|
+
mediainfo_attr_reader :codec, 'Codec'
|
56
|
+
alias_method :codec_id_info, :codec_info
|
57
|
+
|
58
|
+
mediainfo_attr_reader :frame_rate, 'FrameRate'
|
59
|
+
def fps
|
60
|
+
frame_rate[/[\d.]+/].to_f if frame_rate
|
61
|
+
end
|
62
|
+
alias_method :framerate, :fps
|
63
|
+
|
64
|
+
mediainfo_attr_reader :minimum_frame_rate, 'FrameRate_Minimum'
|
65
|
+
def min_fps
|
66
|
+
minimum_frame_rate[/[\d.]+/].to_f if video?
|
67
|
+
end
|
68
|
+
alias_method :min_framerate, :min_fps
|
69
|
+
|
70
|
+
mediainfo_attr_reader :maximum_frame_rate, 'FrameRate_Maximum'
|
71
|
+
def max_fps
|
72
|
+
maximum_frame_rate[/[\d.]+/].to_f if video?
|
73
|
+
end
|
74
|
+
alias_method :max_framerate, :max_fps
|
75
|
+
|
76
|
+
mediainfo_attr_reader :frame_rate_mode, 'FrameRate_Mode'
|
77
|
+
|
78
|
+
mediainfo_attr_reader :display_aspect_ratio, 'DisplayAspectRatio'
|
79
|
+
|
80
|
+
mediainfo_attr_reader :bits_pixel_frame, "Bits-(Pixel*Frame)"
|
81
|
+
|
82
|
+
mediainfo_int_reader :width, 'Width'
|
83
|
+
mediainfo_int_reader :height, 'Height'
|
84
|
+
|
85
|
+
def frame_size
|
86
|
+
"#{width}x#{height}" if width && height
|
87
|
+
end
|
88
|
+
|
89
|
+
mediainfo_date_reader :encoded_date, 'Encoded_Date'
|
90
|
+
mediainfo_date_reader :tagged_date, 'Tagged_Date'
|
91
|
+
|
92
|
+
mediainfo_attr_reader :standard, 'Standard'
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'mediainfo_native.so'
|
2
|
+
|
3
|
+
require 'mediainfo-native/attr_readers'
|
4
|
+
require 'mediainfo-native/base_stream'
|
5
|
+
require 'mediainfo-native/streams/audio'
|
6
|
+
require 'mediainfo-native/streams/general'
|
7
|
+
require 'mediainfo-native/streams/image'
|
8
|
+
require 'mediainfo-native/streams/menu'
|
9
|
+
require 'mediainfo-native/streams/other'
|
10
|
+
require 'mediainfo-native/streams/text'
|
11
|
+
require 'mediainfo-native/streams/video'
|
12
|
+
require 'mediainfo-native/mediainfo'
|
13
|
+
require 'mediainfo-native/version'
|
14
|
+
|
15
|
+
module MediaInfoNative
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mediainfo-native
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- FlavourSys Technology GmbH
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake-compiler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Extracts metadata from media files with mediainfo shared library
|
42
|
+
email: technology@flavoursys.com
|
43
|
+
executables: []
|
44
|
+
extensions:
|
45
|
+
- ext/mediainfo_native/extconf.rb
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- lib/mediainfo-native.rb
|
49
|
+
- lib/mediainfo-native/attr_readers.rb
|
50
|
+
- lib/mediainfo-native/base_stream.rb
|
51
|
+
- lib/mediainfo-native/version.rb
|
52
|
+
- lib/mediainfo-native/streams/other.rb
|
53
|
+
- lib/mediainfo-native/streams/image.rb
|
54
|
+
- lib/mediainfo-native/streams/menu.rb
|
55
|
+
- lib/mediainfo-native/streams/audio.rb
|
56
|
+
- lib/mediainfo-native/streams/video.rb
|
57
|
+
- lib/mediainfo-native/streams/text.rb
|
58
|
+
- lib/mediainfo-native/streams/general.rb
|
59
|
+
- lib/mediainfo-native/mediainfo.rb
|
60
|
+
- ext/mediainfo_native/MediaInfoDLL.h
|
61
|
+
- ext/mediainfo_native/extconf.rb
|
62
|
+
- ext/mediainfo_native/mediainfo_wrapper.cpp
|
63
|
+
- ext/mediainfo_native/basestream.h
|
64
|
+
- ext/mediainfo_native/mediainfo_wrapper.h
|
65
|
+
- ext/mediainfo_native/mediainfo_native.cpp
|
66
|
+
- ext/mediainfo_native/basestream.cpp
|
67
|
+
homepage: http://github.com/flavoursys/mediainfo-native
|
68
|
+
licenses:
|
69
|
+
- MIT
|
70
|
+
metadata: {}
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - '>='
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
requirements: []
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 2.0.14
|
88
|
+
signing_key:
|
89
|
+
specification_version: 4
|
90
|
+
summary: Native bindings for mediainfo
|
91
|
+
test_files: []
|