diff --git a/.idea/qubar.site.iml b/.idea/qubar.site.iml
index 6e666d03..9deb5706 100644
--- a/.idea/qubar.site.iml
+++ b/.idea/qubar.site.iml
@@ -27,7 +27,7 @@
-
+
@@ -78,7 +78,7 @@
-
+
diff --git a/.travis.yml b/.travis.yml
index c6e52615..fe7568f9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,5 @@
language: ruby
+bundler_args: --without development
rvm:
- 1.9.3
# - 1.9.2
@@ -17,7 +18,6 @@ before_script:
script:
- ls -la
- RAILS_ENV=test bundle exec rake --trace db:migrate
- - bundle exec rake --trace db:test:prepare
- - bundle exec rake --trace
+ - RAILS_ENV=test bundle exec rake --trace
notifications:
webhooks: http://build.ecosounds.org/build
\ No newline at end of file
diff --git a/app/controllers/media_controller.rb b/app/controllers/media_controller.rb
index 45a9b86f..75fd918e 100644
--- a/app/controllers/media_controller.rb
+++ b/app/controllers/media_controller.rb
@@ -11,7 +11,14 @@ def item
# use params to get query string or parsed route parameters
# get the path for the file matching the request
- @file_path = Cache::calculate_target_path(params)
+ file_name = Cache::cached_spectrogram_file(params)
+ #file_name = Cache::cached_audio_file(params)
+ #file_name = Cache::original_audio_file({ :id => '21EC2020-3AEA-1069-A2DD-08002B30309D', :date => '20121026', :time => '132600', :format => 'wav'})
+
+ #@file_path = Cache::possible_paths(file_name)
+ #@file_path = Cache::existing_paths(Cache::cached_spectrogram_storage_paths,file_name)
+ #@file_path = QubarSite::Application.config.media_file_config.cached_spectrogram_paths
+ @file_path = Cache::possible_paths(Cache::cached_spectrogram_storage_paths,file_name)
# see if the requested file exists
diff --git a/lib/modules/audio.rb b/lib/modules/audio.rb
index 1ac7ea69..b6ebf97e 100644
--- a/lib/modules/audio.rb
+++ b/lib/modules/audio.rb
@@ -1,145 +1,24 @@
-require 'OS'
-
module Audio
-
- @ffmpeg_path = if OS.windows? then "./vendor/bin/ffmpeg/windows/ffmpeg.exe" else "ffmpeg" end
- @ffprobe_path = if OS.windows? then "./vendor/bin/ffmpeg/windows/ffprobe.exe" else "ffprobe" end
- @sox_path = if OS.windows? then "./vendor/bin/sox/windows/sox.exe" else "sox" end
- @wvunpack_path = if OS.windows? then "./vendor/bin/wavpack/windows/wvunpack.exe" else "wvunpack" end
- @mp3splt_path = if OS.windows? then "./vendor/bin/mp3splt/windows/mp3splt.exe" else "mp3splt" end
-
- @@my_logger ||= Logger.new("#{Rails.root}/log/my.log")
-
- # public methods
- public
-
+ include AudioSox, AudioMp3splt, AudioWavpack, AudioFfmpeg
+
# Provides information about an audio file.
def self.info(source)
info = []
error = []
-
- sox_info source, info, error
- ffprobe_info source, info, error
- wvunpack_info source, info, error
-
+
+ info_sox source, info, error
+ info_ffmpeg source, info, error
+ info_wavpack source, info, error
+
# return the packaged info array
[ info, error ]
end
-
+
# Creates a new audio file from source path in target path, modified according to the
# parameters in modify_parameters
def self.modify(source, target, modify_parameters)
- wvunpack(source, target, modify_parameters)
+ modify_wavpack(source, target, modify_parameters)
end
-
- # private methods
- private
-
- def self.sox_info(source, info, error)
- sox_arguments_info = "--info"
- sox_command = "#{@sox_path} #{sox_arguments_info} \"#{source}\"" # commands to get info from audio file
- sox_stdout_str, sox_stderr_str, sox_status = Open3.capture3(sox_command) # run the commands and wait for the result
-
- if sox_status.exitstatus == 0
- # sox std out contains info (separate on first colon(:))
- sox_stdout_str.strip.split(/\r?\n|\r/).each { |line| info.push [ 'SOX ' + line[0,line.index(':')].strip, line[line.index(':')+1,line.length].strip ] }
- # sox_stderr_str is empty
- else
- Rails.logger.debug "Sox info error. Return status #{sox_status.exitstatus}. Command: #{sox_command}"
- error.push ['SOX ERROR',sox_stderr_str]
- end
- end
-
- def self.ffprobe_info(source, info, error)
- ffprobe_arguments_info = "-sexagesimal -print_format default -show_error -show_streams -show_format"
- ffprobe_command = "#{@ffprobe_path} #{ffprobe_arguments_info} \"#{source}\""
- ffprobe_stdout_str, ffprobe_stderr_str, ffprobe_status = Open3.capture3(ffprobe_command)
-
- Rails.logger.debug "Ffprobe info return status #{ffprobe_status.exitstatus}. Command: #{ffprobe_command}"
-
- if ffprobe_status.exitstatus == 0
- # ffprobe std out contains info (separate on first equals(=))
- # ffprobe_stderr_str contains progress info and human-formatted info
- ffprobe_current_block_name = ''
- ffprobe_stdout_str.strip.split(/\r?\n|\r/).each do |line|
- line.strip!
- if line[0] == '['
- # this chomp reverse stuff is due to the lack of a proper 'trim'
- ffprobe_current_block_name = line.chomp(']').reverse.chomp('[').reverse
- else
- current_key = line[0,line.index('=')].strip
- current_value = line[line.index('=')+1,line.length].strip
- info.push [ 'FFPROBE ' + ffprobe_current_block_name + ' ' + current_key, current_value ]
- end
- end
- else
- Rails.logger.debug "Ffprobe info error. Return status #{ffprobe_status.exitstatus}. Command: #{ffprobe_command}"
- # ffprobe std err contains info (separate on first equals(=))
- ffprobe_current_block_name = ''
- ffprobe_stdout_str.strip.split(/\r?\n|\r/).each do |line|
- line.strip!
- if line[0] == '['
- # this chomp reverse stuff is due to the lack of a proper 'trim'
- ffprobe_current_block_name = line.chomp(']').reverse.chomp('[').reverse
- else
- current_key = line[0,line.index('=')].strip
- current_value = line[line.index('=')+1,line.length].strip
- error.push [ 'FFPROBE ' + ffprobe_current_block_name + ' ' + current_key, current_value ]
- end
- end
- end
- end
-
- def self.wvunpack_info(source, info, error)
- wvunpack_arguments_info = "-s"
- wvunpack_command = "#{@wvunpack_path} #{wvunpack_arguments_info} \"#{source}\"" # commands to get info from audio file
- wvunpack_stdout_str, wvunpack_stderr_str, wvunpack_status = Open3.capture3(wvunpack_command) # run the commands and wait for the result
-
- Rails.logger.debug "Wavpack info return status #{wvunpack_status.exitstatus}. Command: #{wvunpack_command}"
-
- if wvunpack_status.exitstatus == 0
- # wvunpack std out contains info (separate on first colon(:))
- wvunpack_stdout_str.strip.split(/\r?\n|\r/).each do |line|
- line.strip!
- current_key = line[0,line.index(':')].strip
- current_value = line[line.index(':')+1,line.length].strip
- info.push [ 'WVUNPACK ' + current_key, current_value ]
- end
-
- # wvunpack_stderr_str contains human-formatted info and errors
- else
- info.push [ 'WVUNPACK ERROR', wvunpack_stderr_str.strip!.split(/\r?\n|\r/).last ]
- end
- end
-
- # wvunpack converts .wv files to .wav, optionally segmenting them
- # target should be calculated based on modify_parameters by cache module
- # modify_parameters can contain start_offset (fractions of seconds from start) and/or end_offset (fractions of seconds from start)
- def self.wvunpack(source, target, modify_parameters = {})
- raise ArgumentError, "Source is not a wavpack file: #{File.basename(source)}" unless source.match(/\.wv$/)
- raise ArgumentError, "Target is not a wav file: : #{File.basename(target)}" unless target.match(/\.wav$/)
- raise ArgumentError, "Source does not exist: #{File.basename(source)}" unless File.exists? source
- raise ArgumentError, "Target exists: #{File.basename(target)}" unless !File.exists? source
-
- # formatted time: hh:mm:ss.ss
- arguments = '-t -q'
- if modify_parameters.include? :start_offset
- start_offset_formatted = Time.at(modify_parameters[:start_offset]).utc.strftime('%H:%M:%S.%2N')
- arguments += ' --skip=#{start_offset_formatted}'
- end
-
- if modify_parameters.include? :end_offset
- end_offset_formatted = Time.at(modify_parameters[:start_offset]).utc.strftime('%H:%M:%S.%2N')
- arguments += ' --until=#{end_offset_formatted}'
- end
-
- wvunpack_command = "#{@wvunpack_path} #{arguments} \"#{source}\" \"#{target}\"" # commands to get info from audio file
- wvunpack_stdout_str, wvunpack_stderr_str, wvunpack_status = Open3.capture3(wvunpack_command) # run the commands and wait for the result
-
- if wvunpack_status.exitstatus == 0
- raise "Wvunpack exited with an error: #{wvunpack_stderr_str}"
- end
- end
-
+
end
\ No newline at end of file
diff --git a/lib/modules/audio_ffmpeg.rb b/lib/modules/audio_ffmpeg.rb
new file mode 100644
index 00000000..60f84f8b
--- /dev/null
+++ b/lib/modules/audio_ffmpeg.rb
@@ -0,0 +1,61 @@
+module AudioFfmpeg
+ include OS
+ @ffmpeg_path = if OS.windows? then "./vendor/bin/ffmpeg/windows/ffmpeg.exe" else "ffmpeg" end
+ @ffprobe_path = if OS.windows? then "./vendor/bin/ffmpeg/windows/ffprobe.exe" else "ffprobe" end
+
+ # public methods
+ public
+
+
+ def self.info_ffmpeg(source)
+ info = []
+ error = []
+ ffprobe_arguments_info = "-sexagesimal -print_format default -show_error -show_streams -show_format"
+ ffprobe_command = "#{@ffprobe_path.to_s} #{ffprobe_arguments_info} \"#{source}\""
+ ffprobe_stdout_str, ffprobe_stderr_str, ffprobe_status = Open3.capture3(ffprobe_command)
+
+ Rails.logger.debug "Ffprobe info return status #{ffprobe_status.exitstatus}. Command: #{ffprobe_command}"
+
+ if ffprobe_status.exitstatus == 0
+ # ffprobe std out contains info (separate on first equals(=))
+ # ffprobe_stderr_str contains progress info and human-formatted info
+ ffprobe_current_block_name = ''
+ ffprobe_stdout_str.strip.split(/\r?\n|\r/).each do |line|
+ line.strip!
+ if line[0] == '['
+ # this chomp reverse stuff is due to the lack of a proper 'trim'
+ ffprobe_current_block_name = line.chomp(']').reverse.chomp('[').reverse
+ else
+ current_key = line[0,line.index('=')].strip
+ current_value = line[line.index('=')+1,line.length].strip
+ info.push [ 'FFPROBE ' + ffprobe_current_block_name + ' ' + current_key, current_value ]
+ end
+ end
+ else
+ Rails.logger.debug "Ffprobe info error. Return status #{ffprobe_status.exitstatus}. Command: #{ffprobe_command}"
+ # ffprobe std err contains info (separate on first equals(=))
+ ffprobe_current_block_name = ''
+ ffprobe_stdout_str.strip.split(/\r?\n|\r/).each do |line|
+ line.strip!
+ if line[0] == '['
+ # this chomp reverse stuff is due to the lack of a proper 'trim'
+ ffprobe_current_block_name = line.chomp(']').reverse.chomp('[').reverse
+ else
+ current_key = line[0,line.index('=')].strip
+ current_value = line[line.index('=')+1,line.length].strip
+ error.push [ 'FFPROBE ' + ffprobe_current_block_name + ' ' + current_key, current_value ]
+ end
+ end
+ end
+
+ [ info, error ]
+ end
+
+ def self.modify_ffmpeg(source, target, modify_parameters = {})
+ info = []
+ error = []
+ ffprobe_arguments_info = "-sexagesimal -print_format default -show_error -show_streams -show_format"
+ ffprobe_command = "#{@ffprobe_path.to_s} #{ffprobe_arguments_info} \"#{source}\""
+ ffprobe_stdout_str, ffprobe_stderr_str, ffprobe_status = Open3.capture3(ffprobe_command)
+ end
+end
\ No newline at end of file
diff --git a/lib/modules/audio_mp3splt.rb b/lib/modules/audio_mp3splt.rb
new file mode 100644
index 00000000..04bd5d82
--- /dev/null
+++ b/lib/modules/audio_mp3splt.rb
@@ -0,0 +1,23 @@
+module AudioMp3splt
+ include OS
+ @mp3splt_path = if OS.windows? then "./vendor/bin/mp3splt/windows/mp3splt.exe" else "mp3splt" end
+
+ # public methods
+ public
+
+ def self.info_mp3splt(source)
+ [ [], [] ]
+ end
+
+ # @param [file path] source
+ # @param [file path] target
+ # @param [hash] modify_parameters
+ def self.modify_mp3splt(source, target, modify_parameters = {})
+ raise ArgumentError, "Source is not a mp3 file: #{File.basename(source)}" unless source.match(/\.mp3$/)
+ raise ArgumentError, "Target is not a mp3 file: : #{File.basename(target)}" unless target.match(/\.mp3$/)
+ raise ArgumentError, "Source does not exist: #{File.basename(source)}" unless File.exists? source
+ raise ArgumentError, "Target exists: #{File.basename(target)}" unless !File.exists? source
+
+
+ end
+end
\ No newline at end of file
diff --git a/lib/modules/audio_sox.rb b/lib/modules/audio_sox.rb
new file mode 100644
index 00000000..e47d39b3
--- /dev/null
+++ b/lib/modules/audio_sox.rb
@@ -0,0 +1,46 @@
+module AudioSox
+ include OS
+ @sox_path = if OS.windows? then "./vendor/bin/sox/windows/sox.exe" else "sox" end
+
+ # public methods
+ public
+
+ def self.info_sox(source)
+ info = []
+ error = []
+
+ sox_arguments_info = "--info"
+ sox_command = "#{@sox_path.to_s} #{sox_arguments_info} \"#{source}\"" # commands to get info from audio file
+ sox_stdout_str, sox_stderr_str, sox_status = Open3.capture3(sox_command) # run the commands and wait for the result
+
+ if sox_status.exitstatus == 0
+ # sox std out contains info (separate on first colon(:))
+ sox_stdout_str.strip.split(/\r?\n|\r/).each { |line| info.push [ 'SOX ' + line[0,line.index(':')].strip, line[line.index(':')+1,line.length].strip ] }
+ # sox_stderr_str is empty
+ else
+ Rails.logger.debug "Sox info error. Return status #{sox_status.exitstatus}. Command: #{sox_command}"
+ error.push ['SOX ERROR',sox_stderr_str]
+ end
+
+ [ info, error ]
+ end
+
+ def self.modify_sox(source, target, modify_parameters = {})
+
+ info = []
+ error = []
+
+ sox_arguments_info = "--info"
+ sox_command = "#{@sox_path.to_s} #{sox_arguments_info} \"#{source}\"" # commands to get info from audio file
+ sox_stdout_str, sox_stderr_str, sox_status = Open3.capture3(sox_command) # run the commands and wait for the result
+
+ if sox_status.exitstatus == 0 && File.exists?(target)
+
+ else
+
+ end
+
+ [info, error]
+ end
+
+end
\ No newline at end of file
diff --git a/lib/modules/audio_wavpack.rb b/lib/modules/audio_wavpack.rb
new file mode 100644
index 00000000..a07ec0cf
--- /dev/null
+++ b/lib/modules/audio_wavpack.rb
@@ -0,0 +1,69 @@
+module AudioWavpack
+ include OS
+ @wvunpack_path = if OS.windows? then "./vendor/bin/wavpack/windows/wvunpack.exe" else "wvunpack" end
+
+ # public methods
+ public
+
+ # @return [array] contains info and error arrays
+ def self.info_wavpack(source)
+ info = []
+ error = []
+
+ wvunpack_arguments_info = "-s"
+ wvunpack_command = "#{@wvunpack_path.to_s} #{wvunpack_arguments_info} \"#{source}\"" # commands to get info from audio file
+ wvunpack_stdout_str, wvunpack_stderr_str, wvunpack_status = Open3.capture3(wvunpack_command) # run the commands and wait for the result
+
+ Rails.logger.debug "Wavpack info return status #{wvunpack_status.exitstatus}. Command: #{wvunpack_command}"
+
+ if wvunpack_status.exitstatus == 0
+ # wvunpack std out contains info (separate on first colon(:))
+ wvunpack_stdout_str.strip.split(/\r?\n|\r/).each do |line|
+ line.strip!
+ current_key = line[0,line.index(':')].strip
+ current_value = line[line.index(':')+1,line.length].strip
+ info.push [ 'WVUNPACK ' + current_key, current_value ]
+ end
+
+ # wvunpack_stderr_str contains human-formatted info and errors
+ else
+ info.push [ 'WVUNPACK ERROR', wvunpack_stderr_str.strip!.split(/\r?\n|\r/).last ]
+ end
+
+ [info, error]
+ end
+
+ # wvunpack converts .wv files to .wav, optionally segmenting them
+ # target should be calculated based on modify_parameters by cache module
+ # modify_parameters can contain start_offset (fractions of seconds from start) and/or end_offset (fractions of seconds from start)
+ def self.modify_wavpack(source, target, modify_parameters = {})
+ raise ArgumentError, "Source is not a wavpack file: #{File.basename(source)}" unless source.match(/\.wv$/)
+ raise ArgumentError, "Target is not a wav file: : #{File.basename(target)}" unless target.match(/\.wav$/)
+ raise ArgumentError, "Source does not exist: #{File.basename(source)}" unless File.exists? source
+ raise ArgumentError, "Target exists: #{File.basename(target)}" unless !File.exists? source
+
+ info = []
+ error = []
+
+ # formatted time: hh:mm:ss.ss
+ arguments = '-t -q'
+ if modify_parameters.include? :start_offset
+ start_offset_formatted = Time.at(modify_parameters[:start_offset]).utc.strftime('%H:%M:%S.%2N')
+ arguments += " --skip=#{start_offset_formatted}"
+ end
+
+ if modify_parameters.include? :end_offset
+ end_offset_formatted = Time.at(modify_parameters[:start_offset]).utc.strftime('%H:%M:%S.%2N')
+ arguments += " --until=#{end_offset_formatted}"
+ end
+
+ wvunpack_command = "#{@wvunpack_path.to_s} #{arguments} \"#{source}\" \"#{target}\"" # commands to get info from audio file
+ wvunpack_stdout_str, wvunpack_stderr_str, wvunpack_status = Open3.capture3(wvunpack_command) # run the commands and wait for the result
+
+ if wvunpack_status.exitstatus == 0
+ raise "Wvunpack exited with an error: #{wvunpack_stderr_str}"
+ end
+
+ [info, error]
+ end
+end
diff --git a/lib/modules/cache.rb b/lib/modules/cache.rb
index 9bd036f9..abc8d36e 100644
--- a/lib/modules/cache.rb
+++ b/lib/modules/cache.rb
@@ -1,17 +1,119 @@
+require 'String'
+
+# Determines file names for cached and original files.
module Cache
+ @parameter_file_name_separator = '_'
+
public
- # calculate the target file name and path based on the modification parameters
- def self.calculate_target_path(modify_parameters = {})
- #Mime::Type.lookup_by_extension(
- #QubarSite::Application.config.media_file_config
+ #original audio
+
+ # get the file name for an original audio file
+ def self.original_audio_file(modify_parameters = {})
+ file_name = self.build_parameters [ :id, :date, :time, :format ], modify_parameters
+ file_name
+ end
+
+ # get all the storage paths for original audio
+ def self.original_audio_storage_paths()
+ storage_paths = QubarSite::Application.config.media_file_config.original_audio_paths
+ storage_paths
+ end
+
+ # cached audio
+
+ # get the file name for a cached audio file
+ def self.cached_audio_file(modify_parameters = {})
+ file_name = self.build_parameters [ :id, :start_offset, :end_offset, :channel, :sample_rate, :format ], modify_parameters
+ file_name
+ end
+
+ # get all the storage paths for cached audio
+ def self.cached_audio_storage_paths()
+ storage_paths = QubarSite::Application.config.media_file_config.cached_audio_paths
+ storage_paths
+ end
+
+ def self. cached_audio_defaults()
+ cache_defaults = QubarSite::Application.config.media_file_config.cached_audio_defaults
+ cache_defaults
+ end
+
+ def self. cached_spectrogram_defaults()
+ cache_defaults = QubarSite::Application.config.media_file_config.cached_spectrogram_defaults
+ cache_defaults
end
- # check to see if a target file exists
- def self.exists(source, modify_parameters = {})
- File.exists? calculate_target_path(source, modify_parameters)
+ # cached spectrograms
+
+ # get the file name for a cached spectrogram
+ def self.cached_spectrogram_file(modify_parameters = {})
+ file_name = self.build_parameters [ :id, :start_offset, :end_offset, :channel, :sample_rate, :window, :colour, :format ], modify_parameters
+ file_name
+ end
+
+ # get all the storage paths for cached spectrograms
+ def self.cached_spectrogram_storage_paths()
+ storage_paths = QubarSite::Application.config.media_file_config.cached_spectrogram_paths
+ storage_paths
+ end
+
+ # get all possible full paths for a file
+ def self.possible_paths(storage_paths, file_name)
+ possible_paths = storage_paths.collect { |path| File.join(path,file_name) }
+ possible_paths
+ end
+
+ # get the full paths for all existing files that match a file name
+ def self.existing_paths(storage_paths, file_name)
+ existing_paths = possible_paths(storage_paths, file_name).find_all {|file| File.exists? file }
+ existing_paths
end
private
+
+ def self.build_parameters(parameter_names = {}, modify_parameters = {})
+ file_name = ''
+
+ parameter_names.each do |param|
+ if param == :id
+ file_name += get_parameter(:id, modify_parameters, false)
+ elsif param == :format
+ file_name += '.'+get_parameter(:format, modify_parameters, false)
+ else
+ file_name += get_parameter(param, modify_parameters)
+ end
+ end
+
+ file_name
+ end
+
+ def self.get_parameter(parameter, modify_parameters, include_separator = true)
+ # need to cater for the situation where modify_parameters contains strings (we want symbols)
+ modify_parameters.keys.each do |key|
+ modify_parameters[(key.to_sym rescue key) || key] = modify_parameters.delete(key)
+ end
+
+ # need to cater for the situation where parameter is a string (we want a symbol)
+ parameter = parameter.to_s.to_sym
+
+ raise ArgumentError, "Parameters must include #{parameter}." unless modify_parameters.include? parameter
+ result_name = ''
+
+ if modify_parameters.include? parameter
+ result_name = modify_parameters[parameter]
+
+ if parameter == :format
+ result_name = result_name.trim '.', ''
+ end
+
+ if include_separator
+ result_name = @parameter_file_name_separator+result_name
+ end
+ end
+
+ result_name
+ end
+
end
\ No newline at end of file
diff --git a/lib/modules/string.rb b/lib/modules/string.rb
index 6e3d071b..2734c553 100644
--- a/lib/modules/string.rb
+++ b/lib/modules/string.rb
@@ -1,5 +1,5 @@
class String
- def trim(replace_chars, substitute_chars)
- "#{self}".gsub(/^[#{substitute_chars}]+|[#{substitute_chars}]+$/, replace_chars)
+ def trim(chars_to_replace, char_to_insert)
+ "#{self}".gsub(/^[#{chars_to_replace}]+|[#{chars_to_replace}]+$/, char_to_insert)
end
end
\ No newline at end of file
diff --git a/public/tests/TorresianCrow.wav b/public/tests/TorresianCrow.wav
new file mode 100644
index 00000000..c916b6c3
Binary files /dev/null and b/public/tests/TorresianCrow.wav differ
diff --git a/vendor/bin/ffmpeg/windows/ffprobe-help.txt b/vendor/bin/ffmpeg/windows/ffprobe-help.txt
new file mode 100644
index 00000000..0a7b2232
--- /dev/null
+++ b/vendor/bin/ffmpeg/windows/ffprobe-help.txt
@@ -0,0 +1,481 @@
+Simple multimedia streams analyzer
+usage: ffprobe [OPTIONS] [INPUT_FILE]
+
+Main options:
+-L show license
+-h topic show help
+-? topic show help
+-help topic show help
+--help topic show help
+-version show version
+-formats show available formats
+-codecs show available codecs
+-decoders show available decoders
+-encoders show available encoders
+-bsfs show available bit stream filters
+-protocols show available protocols
+-filters show available filters
+-pix_fmts show available pixel formats
+-layouts show standard channel layouts
+-sample_fmts show available audio sample formats
+-loglevel loglevel set libav* logging level
+-v loglevel set libav* logging level
+-debug flags set debug flags
+-fdebug flags set debug flags
+-report generate a report
+-max_alloc bytes set maximum size of a single allocated block
+-cpuflags flags force specific cpu flags
+-f format force format
+-unit show unit of the displayed values
+-prefix use SI prefixes for the displayed values
+-byte_binary_prefix use binary prefixes for byte units
+-sexagesimal use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units
+-pretty prettify the format of displayed values, make it more human readable
+-print_format format set the output printing format (available formats are: default, compact, csv, flat, ini, json, xml)
+-of format alias for -print_format
+-select_streams stream_specifier select the specified streams
+-show_data show packets data
+-show_error show probing error
+-show_format show format/container info
+-show_frames show frames info
+-show_format_entry entry show a particular entry from the format/container info
+-show_packets show packets info
+-show_streams show streams info
+-count_frames count the number of frames per stream
+-count_packets count the number of packets per stream
+-show_program_version show ffprobe version
+-show_library_versions show library versions
+-show_versions show program and library versions
+-show_private_data show private data
+-private same as show_private_data
+-bitexact force bitexact output
+-default generic catch all option
+-i input_file read specified file
+
+
+AVFormatContext AVOptions:
+-avioflags ED....
+ direct ED.... reduce buffering
+-probesize .D.... set probing size
+-fflags ED....
+ ignidx .D.... ignore index
+ genpts .D.... generate pts
+ nofillin .D.... do not fill in missing values that can be exactly calculated
+ noparse .D.... disable AVParsers, this needs nofillin too
+ igndts .D.... ignore dts
+ discardcorrupt .D.... discard corrupted frames
+ sortdts .D.... try to interleave outputted packets by dts
+ keepside .D.... dont merge side data
+ nobuffer .D.... reduce the latency introduced by optional buffering
+-analyzeduration .D.... how many microseconds are analyzed to estimate duration
+-cryptokey .D.... decryption key
+-indexmem .D.... max memory used for timestamp index (per stream)
+-rtbufsize .D.... max memory used for buffering real-time frames
+-fdebug ED.... print specific debug info
+ ts ED....
+-max_delay ED.... maximum muxing or demuxing delay in microseconds
+-fpsprobesize .D.... number of frames used to probe fps
+-f_err_detect .D.... set error detection flags (deprecated; use err_detect, save via avconv)
+ crccheck .D.... verify embedded CRCs
+ bitstream .D.... detect bitstream specification deviations
+ buffer .D.... detect improper bitstream length
+ explode .D.... abort decoding on minor error detection
+ careful .D.... consider things that violate the spec and have not been seen in the wild as errors
+ compliant .D.... consider all spec non compliancies as errors
+ aggressive .D.... consider things that a sane encoder shouldnt do as an error
+-err_detect .D.... set error detection flags
+ crccheck .D.... verify embedded CRCs
+ bitstream .D.... detect bitstream specification deviations
+ buffer .D.... detect improper bitstream length
+ explode .D.... abort decoding on minor error detection
+ careful .D.... consider things that violate the spec and have not been seen in the wild as errors
+ compliant .D.... consider all spec non compliancies as errors
+ aggressive .D.... consider things that a sane encoder shouldnt do as an error
+-use_wallclock_as_timestamps .D.... use wallclock as timestamps
+
+AVIOContext AVOptions:
+
+URLContext AVOptions:
+
+crypto AVOptions:
+-key .D.... AES decryption key
+-iv .D.... AES decryption initialization vector
+
+file AVOptions:
+
+http AVOptions:
+-seekable .D.... Control seekability of connection
+-headers ED.... custom HTTP headers, can override built in default headers
+-user-agent .D.... override User-Agent header
+-multiple_requests ED.... use persistent connections
+-post_data ED.... custom HTTP post data
+-timeout ED.... timeout of socket i/o operations
+
+tcp AVOptions:
+-listen ED.... listen on port instead of connecting
+-timeout ED.... timeout of socket i/o operations
+-listen_timeout ED.... connection awaiting timeout
+
+udp AVOptions:
+-buffer_size ED.... Socket buffer size in bytes
+-localport ED.... Set local port to bind to
+-localaddr ED.... Choose local IP address
+-pkt_size ED.... Set size of UDP packets
+-reuse ED.... Explicitly allow or disallow reusing UDP sockets
+-connect ED.... Should connect() be called on socket
+-fifo_size .D.... Set the UDP receiving circular buffer size, expressed as a number of packets with size of 188 bytes
+-overrun_nonfatal .D.... Survive in case of UDP receiving circular buffer overrun
+-timeout .D.... In read mode: if no data arrived in more than this time interval, raise error
+
+librtmp protocol AVOptions:
+-rtmp_app ED.... Name of application to connect to on the RTMP server
+-rtmp_playpath ED.... Stream identifier to play or to publish
+
+librtmpe protocol AVOptions:
+-rtmp_app ED.... Name of application to connect to on the RTMP server
+-rtmp_playpath ED.... Stream identifier to play or to publish
+
+librtmps protocol AVOptions:
+-rtmp_app ED.... Name of application to connect to on the RTMP server
+-rtmp_playpath ED.... Stream identifier to play or to publish
+
+librtmpt protocol AVOptions:
+-rtmp_app ED.... Name of application to connect to on the RTMP server
+-rtmp_playpath ED.... Stream identifier to play or to publish
+
+librtmpte protocol AVOptions:
+-rtmp_app ED.... Name of application to connect to on the RTMP server
+-rtmp_playpath ED.... Stream identifier to play or to publish
+
+Artworx Data Format demuxer AVOptions:
+-linespeed .D.... set simulated line speed (bytes per second)
+-video_size .D.... set video size, such as 640x480 or hd720.
+-framerate .D.... set framerate (frames per second)
+
+asf demuxer AVOptions:
+-no_resync_search .D.... Don't try to resynchronize by looking for a certain optional start code
+
+avi AVOptions:
+-use_odml .D.... use odml index
+
+Binary text demuxer AVOptions:
+-linespeed .D.... set simulated line speed (bytes per second)
+-video_size .D.... set video size, such as 640x480 or hd720.
+-framerate .D.... set framerate (frames per second)
+
+cavsvideo demuxer AVOptions:
+-framerate .D....
+
+CDXL demuxer AVOptions:
+-sample_rate .D....
+-framerate .D....
+
+dirac demuxer AVOptions:
+-framerate .D....
+
+dnxhd demuxer AVOptions:
+-framerate .D....
+
+flvdec AVOptions:
+-flv_metadata .D.V.. Allocate streams according the onMetaData array
+
+g729 demuxer AVOptions:
+-bit_rate .D....
+
+gsm demuxer AVOptions:
+-sample_rate .D....
+
+h261 demuxer AVOptions:
+-framerate .D....
+
+h263 demuxer AVOptions:
+-framerate .D....
+
+h264 demuxer AVOptions:
+-framerate .D....
+
+iCE Draw File demuxer AVOptions:
+-linespeed .D.... set simulated line speed (bytes per second)
+-video_size .D.... set video size, such as 640x480 or hd720.
+-framerate .D.... set framerate (frames per second)
+
+image2 demuxer AVOptions:
+-framerate .D.... set the video framerate
+-loop .D.... force loop over input file sequence
+-pattern_type .D.... set pattern type
+ glob_sequence .D.... glob/sequence pattern type
+ glob .D.... glob pattern type
+ sequence .D.... glob pattern type
+-pixel_format .D.... set video pixel format
+-start_number .D.... set first number in the sequence
+-start_number_range .D.... set range for looking at the first sequence number
+-video_size .D.... set video size
+
+image2pipe demuxer AVOptions:
+-framerate .D.... set the video framerate
+-loop .D.... force loop over input file sequence
+-pattern_type .D.... set pattern type
+ glob_sequence .D.... glob/sequence pattern type
+ glob .D.... glob pattern type
+ sequence .D.... glob pattern type
+-pixel_format .D.... set video pixel format
+-start_number .D.... set first number in the sequence
+-start_number_range .D.... set range for looking at the first sequence number
+-video_size .D.... set video size
+
+ingenient demuxer AVOptions:
+-framerate .D....
+
+m4v demuxer AVOptions:
+-framerate .D....
+
+mjpeg demuxer AVOptions:
+-framerate .D....
+
+mov,mp4,m4a,3gp,3g2,mj2 AVOptions:
+-use_absolute_path .D.V.. allow using absolute path when opening alias, this is a possible security issue
+-ignore_editlist .D.V..
+
+mpegtsraw demuxer AVOptions:
+-compute_pcr .D.... Compute exact PCR for each transport stream packet.
+
+mpegvideo demuxer AVOptions:
+-framerate .D....
+
+alaw demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+mulaw demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+f64be demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+f64le demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+f32be demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+f32le demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+s32be demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+s32le demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+s24be demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+s24le demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+s16be demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+s16le demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+s8 demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+u32be demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+u32le demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+u24be demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+u24le demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+u16be demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+u16le demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+u8 demuxer AVOptions:
+-sample_rate .D....
+-channels .D....
+
+rawvideo demuxer AVOptions:
+-video_size .D.... A string describing frame size, such as 640x480 or hd720.
+-pixel_format .D....
+-framerate .D....
+
+RTP demuxer AVOptions:
+-rtp_flags .D.... RTP flags
+ filter_src .D.... Only receive packets from the negotiated peer IP
+ listen .D.... Wait for incoming connections
+-reorder_queue_size .D.... Number of packets to buffer for handling of reordered packets
+
+RTSP demuxer AVOptions:
+-initial_pause .D.... Don't start playing the stream immediately
+-rtsp_transport ED.... RTSP transport protocols
+ udp ED.... UDP
+ tcp ED.... TCP
+ udp_multicast .D.... UDP multicast
+ http .D.... HTTP tunneling
+-rtsp_flags .D.... RTSP flags
+ filter_src .D.... Only receive packets from the negotiated peer IP
+ listen .D.... Wait for incoming connections
+-allowed_media_types .D.... Media types to accept from the server
+ video .D.... Video
+ audio .D.... Audio
+ data .D.... Data
+-min_port ED.... Minimum local UDP port
+-max_port ED.... Maximum local UDP port
+-timeout .D.... Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies flag listen
+-reorder_queue_size .D.... Number of packets to buffer for handling of reordered packets
+
+sbg_demuxer AVOptions:
+-sample_rate .D....
+-frame_size .D....
+-max_file_size .D....
+
+SDP demuxer AVOptions:
+-sdp_flags .D.... SDP flags
+ filter_src .D.... Only receive packets from the negotiated peer IP
+ listen .D.... Wait for incoming connections
+-allowed_media_types .D.... Media types to accept from the server
+ video .D.... Video
+ audio .D.... Audio
+ data .D.... Data
+-reorder_queue_size .D.... Number of packets to buffer for handling of reordered packets
+
+TTY demuxer AVOptions:
+-chars_per_frame .D....
+-video_size .D.... A string describing frame size, such as 640x480 or hd720.
+-framerate .D....
+
+vc1 demuxer AVOptions:
+-framerate .D....
+
+WAV demuxer AVOptions:
+-ignore_length .D.... Ignore length
+
+eXtended BINary text (XBIN) demuxer AVOptions:
+-linespeed .D.... set simulated line speed (bytes per second)
+-video_size .D.... set video size, such as 640x480 or hd720.
+-framerate .D.... set framerate (frames per second)
+
+DirectShow indev AVOptions:
+-video_size .D.... set video size given a string such as 640x480 or hd720.
+-pixel_format .D.... set video pixel format
+-framerate .D.... set video frame rate
+-sample_rate .D.... set audio sample rate
+-sample_size .D.... set audio sample size
+-channels .D.... set number of audio channels, such as 1 or 2
+-list_devices .D.... list available devices
+ true .D....
+ false .D....
+-list_options .D.... list available options for specified device
+ true .D....
+ false .D....
+-video_device_number .D.... set video device number for devices with same name (starts at 0)
+-audio_device_number .D.... set audio device number for devices with same name (starts at 0)
+-audio_buffer_size .D.... set audio device buffer latency size in milliseconds (default is the device's default)
+
+lavfi indev AVOptions:
+-graph .D.... set libavfilter graph
+-dumpgraph .D.... dump graph to stderr
+
+VFW indev AVOptions:
+-video_size .D.... A string describing frame size, such as 640x480 or hd720.
+-framerate .D....
+
+f4v muxer AVOptions:
+
+GIF muxer AVOptions:
+
+image2 muxer AVOptions:
+
+ipod muxer AVOptions:
+
+ismv muxer AVOptions:
+
+LATM/LOAS muxer AVOptions:
+
+mov muxer AVOptions:
+
+MP3 muxer AVOptions:
+
+mp4 muxer AVOptions:
+
+mpeg muxer AVOptions:
+
+vcd muxer AVOptions:
+
+dvd muxer AVOptions:
+
+svcd muxer AVOptions:
+
+vob muxer AVOptions:
+
+MPEGTS muxer AVOptions:
+
+Ogg muxer AVOptions:
+
+psp muxer AVOptions:
+
+RTP muxer AVOptions:
+
+RTSP muxer AVOptions:
+-initial_pause .D.... Don't start playing the stream immediately
+-rtsp_transport ED.... RTSP transport protocols
+ udp ED.... UDP
+ tcp ED.... TCP
+ udp_multicast .D.... UDP multicast
+ http .D.... HTTP tunneling
+-rtsp_flags .D.... RTSP flags
+ filter_src .D.... Only receive packets from the negotiated peer IP
+ listen .D.... Wait for incoming connections
+-allowed_media_types .D.... Media types to accept from the server
+ video .D.... Video
+ audio .D.... Audio
+ data .D.... Data
+-min_port ED.... Minimum local UDP port
+-max_port ED.... Maximum local UDP port
+-timeout .D.... Maximum timeout (in seconds) to wait for incoming connections. -1 is infinite. Implies flag listen
+-reorder_queue_size .D.... Number of packets to buffer for handling of reordered packets
+
+segment muxer AVOptions:
+
+stream_segment muxer AVOptions:
+
+smooth streaming muxer AVOptions:
+
+spdif AVOptions:
+
+tg2 muxer AVOptions:
+
+tgp muxer AVOptions:
+
+WAV muxer AVOptions:
+
+sdl outdev AVOptions:
+