kakra-rvideo 0.9.6.7 → 0.9.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -384,23 +384,23 @@ module RVideo # :nodoc:
384
384
 
385
385
  def pixel_aspect_ratio
386
386
  return nil unless video?
387
- video_match[7]
387
+ video_match[9]
388
388
  end
389
389
 
390
390
  def display_aspect_ratio
391
391
  return nil unless video?
392
- video_match[8]
392
+ video_match[10]
393
393
  end
394
394
 
395
395
  # The portion of the overall bitrate the video is responsible for.
396
396
  def video_bit_rate
397
397
  return nil unless video?
398
- video_match[9]
398
+ video_match[7] || video_match[11]
399
399
  end
400
400
 
401
401
  def video_bit_rate_units
402
402
  return nil unless video?
403
- video_match[10]
403
+ video_match[8] || video_match[12]
404
404
  end
405
405
 
406
406
  # The frame rate of the video in frames per second
@@ -411,18 +411,18 @@ module RVideo # :nodoc:
411
411
  #
412
412
  def fps
413
413
  return nil unless video?
414
- video_match[2] or video_match[11]
414
+ video_match[2] or video_match[13]
415
415
  end
416
416
  alias_method :framerate, :fps
417
417
 
418
418
  def time_base
419
419
  return nil unless video?
420
- video_match[12]
420
+ video_match[14]
421
421
  end
422
422
 
423
423
  def codec_time_base
424
424
  return nil unless video?
425
- video_match[13]
425
+ video_match[15]
426
426
  end
427
427
 
428
428
  private
@@ -457,22 +457,23 @@ module RVideo # :nodoc:
457
457
 
458
458
  FPS = 'fps(?:\(r\))?'
459
459
 
460
- # FIXME tbn/tbc may need braced alternatives, too: tb(n) / tb(c) - not tested
461
- # not fixing as of yet because it renumbers backrefs
462
460
  VIDEO_MATCH_PATTERN = /
463
- Stream\s*(\#[\d.]+)(?:[\(\[].+?[\)\]])?\s* # stream id
464
- [,:]\s*
465
- (?:#{RATE}\s*#{FPS}[,:]\s*)? # frame rate, older builds
466
- Video:\s*
467
- #{VAL}#{SEP} # codec
468
- (?:#{VAL}#{SEP})? # color space
469
- (\d+)x(\d+)#{SEP}? # resolution
470
- (?:\s*\[?(?:PAR\s*(\d+:\d+))?\s*(?:DAR\s*(\d+:\d+))?\]?)? # pixel and display aspect ratios
471
- #{SEP}?
472
- (?:#{RATE}\s*(kb\/s)#{SEP}?)? # video bit rate
473
- (?:#{RATE}\s*(?:tb\(?r\)?|#{FPS})#{SEP}?)? # frame rate
474
- (?:#{RATE}\s*tb\(?n\)?#{SEP}?)? # time base
475
- (?:#{RATE}\s*tb\(?c\)?#{SEP}?)? # codec time base
461
+ Stream\s*(\#[\d.]+)(?:[\(\[].+?[\)\]])?\s* # stream id (1)
462
+ [,:]\s*
463
+ (?:#{RATE}\s*#{FPS}[,:]\s*)? # frame rate, older builds (2)
464
+ Video:\s*
465
+ #{VAL}#{SEP} # codec (3)
466
+ (?:#{VAL}#{SEP})? # color space (4)
467
+ (\d+)x(\d+)#{SEP}? # resolution (5,6)
468
+ (?:#{RATE}\s*(kb\/s)#{SEP}?)? # video bit rate (7,8)
469
+ (?:\s*\[?
470
+ (?:PAR\s*(\d+:\d+))?\s* # pixel aspect ratio (9)
471
+ (?:DAR\s*(\d+:\d+))?\s* # display aspect ratio (10)
472
+ \]?)?#{SEP}?
473
+ (?:#{RATE}\s*(kb\/s)#{SEP}?)? # video bit rate (11,12)
474
+ (?:#{RATE}\s*(?:tb\(?r\)?|#{FPS})#{SEP}?)? # frame rate (13)
475
+ (?:#{RATE}\s*tb\(?n\)?#{SEP}?)? # time base (14)
476
+ (?:#{RATE}\s*tb\(?c\)?#{SEP}?)? # codec time base (15)
476
477
  /x
477
478
 
478
479
  def video_match
data/rvideo.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rvideo}
5
- s.version = "0.9.6.7"
5
+ s.version = "0.9.6.8"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Peter Boling, Jonathan Dahl (Slantwise Design), Seth Thomas Rasmussen, Kai Krakow"]
@@ -109,4 +109,34 @@ module RVideo
109
109
  assert_equal "11:9", @i.display_aspect_ratio
110
110
  end
111
111
  end
112
+
113
+ describe Inspector, "with elrellano-pilot.txt (ffmpeg 0.5 output)" do
114
+ before :each do
115
+ @i = Inspector.new :raw_response => File.open(spec_file("elrellano-pilot.txt")).read
116
+ end
117
+
118
+ it "knows the video bitrate" do
119
+ assert_equal "400", @i.video_bit_rate
120
+ end
121
+
122
+ it "knows the video bitrate units" do
123
+ assert_equal "kb/s", @i.video_bit_rate_units
124
+ end
125
+
126
+ it "knows the resolution" do
127
+ assert_equal "320x240", @i.resolution
128
+ end
129
+
130
+ it "knows the frame rate" do
131
+ assert_equal "25", @i.framerate
132
+ end
133
+
134
+ it "knows the pixel aspect ratio" do
135
+ assert_equal "1:1", @i.pixel_aspect_ratio
136
+ end
137
+
138
+ it "knows the display aspect ratio" do
139
+ assert_equal "4:3", @i.display_aspect_ratio
140
+ end
141
+ end
112
142
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kakra-rvideo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6.7
4
+ version: 0.9.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling, Jonathan Dahl (Slantwise Design), Seth Thomas Rasmussen, Kai Krakow