Skip to content

Commit f874060

Browse files
Quick hack for Audio Stream Count
1 parent 9d3d737 commit f874060

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ffmpeg/movie.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module FFMPEG
44
class Movie
55
attr_reader :path, :duration, :time, :bitrate, :rotation, :creation_time
66
attr_reader :video_stream, :video_codec, :video_bitrate, :colorspace, :resolution, :sar, :dar
7-
attr_reader :audio_stream, :audio_codec, :audio_bitrate, :audio_sample_rate
7+
attr_reader :audio_stream, :audio_codec, :audio_bitrate, :audio_sample_rate, :audio_stream_count
88
attr_reader :container
99

1010
def initialize(path)
@@ -45,6 +45,8 @@ def initialize(path)
4545
output[/Audio:\ (.*)/]
4646
@audio_stream = $1
4747

48+
@audio_stream_count = output.scan(/Audio:\ (.*)/).size
49+
4850
if video_stream
4951
commas_except_in_parenthesis = /(?:\([^()]*\)|[^,])+/ # regexp to handle "yuv420p(tv, bt709)" colorspace etc from http://goo.gl/6oi645
5052
@video_codec, @colorspace, resolution, video_bitrate = video_stream.scan(commas_except_in_parenthesis).map(&:strip)

0 commit comments

Comments
 (0)