Class: Bagel::Video::FFMPEG::ConcatFile

Inherits:
Object
  • Object
show all
Defined in:
lib/bagel/video/ffmpeg/concat_file.rb

Constant Summary collapse

MP4_PATTERN =
'*.mp4'
FFMPEG_FILE_DIRECTIVE_PREFIX =
'file' + ' '

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ ConcatFile

Returns a new instance of ConcatFile.



12
13
14
# File 'lib/bagel/video/ffmpeg/concat_file.rb', line 12

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



6
7
8
# File 'lib/bagel/video/ffmpeg/concat_file.rb', line 6

def source
  @source
end

Class Method Details

.create(source, &block) ⇒ Object



8
9
10
# File 'lib/bagel/video/ffmpeg/concat_file.rb', line 8

def self.create(source, &block)
  new(source).create(&block)
end

Instance Method Details

#createObject



16
17
18
19
20
21
22
# File 'lib/bagel/video/ffmpeg/concat_file.rb', line 16

def create
  Tempfile.create do |file|
    file.write(contents)
    file.flush
    yield(file.path)
  end
end