class MultimediaParadise::ConvertAudioToVideoWithImage
Public Class Methods
[](i = '')
click to toggle source
new( audio_file = nil, image_file = nil, run_already = true ) { || ... }
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/multimedia_paradise/multimedia/convert_audio_to_video_with_image.rb, line 31 def initialize( audio_file = nil, image_file = nil, run_already = true ) reset set_use_this_audio_file(audio_file) set_use_this_image_file(image_file) if block_given? yielded = yield case yielded # === :to_mp4 when :to_mp4 do_store_as_mp4_file end end run if run_already end
Public Instance Methods
audio_file?()
click to toggle source
do_store_as_mp4_file()
click to toggle source
do_the_conversion()
click to toggle source
#¶ ↑
do_the_conversion
¶ ↑
This is the method that does the actual conversion-step.
#¶ ↑
# File lib/multimedia_paradise/multimedia/convert_audio_to_video_with_image.rb, line 103 def do_the_conversion image_file = image_file? e "The image `#{sfile(image_file)}` will be used." output_file_name = audio_file?.dup. sub(/\.mp3$/,'')+ '.'+ @use_this_as_file_extension_for_the_output # ======================================================================= # # _ = 'ffmpeg -loop 1 -r 1 -i '+image_file+ # ' -i '+audio_file?+' '\ # '-c:a copy -shortest '+ # output_file_name # ======================================================================= # # The next one was added as of 17.05.2020. # # Example: # # ffmpeg -i pic-0.png -i slide1_audio.mp3 -acodec copy -vcodec libx264 final.mp4 # # ======================================================================= # _ = 'ffmpeg'\ ' -i '+image_file+ ' -i '+audio_file?+ ' -acodec copy'+ ' -vcodec libx264'+ ' '+output_file_name esystem _ end
image_file?()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
MultimediaParadise::Base#reset
# File lib/multimedia_paradise/multimedia/convert_audio_to_video_with_image.rb, line 53 def reset super() # ======================================================================= # # === @use_this_as_file_extension_for_the_output # ======================================================================= # @use_this_as_file_extension_for_the_output = 'avi' end
run()
click to toggle source
set_use_this_audio_file(i)
click to toggle source