video2gif 0.0.22 → 0.0.23

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f906c9980bbe4a0dacb015c1a6b0a1af786d1f82b252ea8963d71ff46a53acc9
4
- data.tar.gz: 6d948e892703ff81ecce6395074efc6486a97f7348c3378369c2712476d8fb35
3
+ metadata.gz: 2ae887ec3dbdd0ead6c363292ab6b90ee975646d053e130a17e36899f778446a
4
+ data.tar.gz: 1c35d1d4f1694faeb8e9cbdd692b4819002172aaa20d60a17382577ab9a145b7
5
5
  SHA512:
6
- metadata.gz: f83e62d9f5ee2f592d1bf9e5ea6b5ea93bf1e5fea7ad004399f611312985ba540c63fd1ee9e29d7b3e74017140cb55630f4f66aa2c4833de091d231b40c2ebce
7
- data.tar.gz: c36ffa22c9fa87c45f318210eff0603d02d4be084d29d0f141c8e49fcdcf9e2e20db73edfd76984da3434dafe923beb586b38ac8653ae47f2d04ca28814b7dae
6
+ metadata.gz: 25c4b8b6d9bd4063dd192ff74b1223f6795ea55dbc4796f79fcd76b2c04270046ef71bf37d8f361876cff06c42fb1c4a9c1d0158a26b5eb83127d69aeca1e3eb
7
+ data.tar.gz: 036d26b295bd119b9dd5f8fb202b3a2cee1799175f5cc378a006b11e500ff549e3b817ce85f264547c93c5782575faf6ded923fd7da7b0832180995592b67673
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- video2gif (0.0.22)
4
+ video2gif (0.0.23)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/video2gif/cli.rb CHANGED
@@ -10,12 +10,12 @@ module Video2gif
10
10
  module CLI
11
11
  def self.start
12
12
  logger = Logger.new(STDOUT)
13
- options = Video2gif::Options.parse(ARGV)
13
+ options = Options.parse(ARGV)
14
14
 
15
15
  if options[:subtitles]
16
16
  lines = []
17
17
 
18
- Open3.popen2e(*Video2gif::FFmpeg.ffprobe_command(options, logger)) do |stdin, stdout_stderr, thread|
18
+ Open3.popen2e(*FFmpeg.ffprobe_command(options, logger)) do |stdin, stdout_stderr, thread|
19
19
  stdin.close
20
20
  stdout_stderr.each do |line|
21
21
  logger.info(line.chomp) if options[:verbose] unless options[:quiet]
@@ -39,12 +39,12 @@ module Video2gif
39
39
  end
40
40
 
41
41
  if options[:autocrop]
42
- Open3.popen2e(*Video2gif::FFmpeg.cropdetect_command(options, logger)) do |stdin, stdout_stderr, thread|
42
+ Open3.popen2e(*FFmpeg.cropdetect_command(options, logger)) do |stdin, stdout_stderr, thread|
43
43
  stdin.close
44
44
  stdout_stderr.each do |line|
45
45
  logger.info(line.chomp) if options[:verbose] unless options[:quiet]
46
46
  if line.include?('Parsed_cropdetect')
47
- options[:autocrop] = line.match(Video2Gif::FFmpeg::CROP_REGEX)
47
+ options[:autocrop] = line.match(FFmpeg::CROP_REGEX)
48
48
  end
49
49
  end
50
50
  stdout_stderr.close
@@ -56,7 +56,7 @@ module Video2gif
56
56
  end
57
57
  end
58
58
 
59
- Open3.popen2e(*Video2gif::FFmpeg.gif_command(options, logger)) do |stdin, stdout_stderr, thread|
59
+ Open3.popen2e(*FFmpeg.gif_command(options, logger)) do |stdin, stdout_stderr, thread|
60
60
  stdin.close
61
61
  stdout_stderr.each do |line|
62
62
  logger.info(line.chomp) if options[:verbose] unless options[:quiet]
@@ -14,11 +14,11 @@ module Video2gif
14
14
  video_info = options[:probe_infos][:streams].find { |s| s[:codec_type] == 'video' }
15
15
  subtitle_info = options[:probe_infos][:streams].find_all { |s| s[:codec_type] == 'subtitle' }[options[:subtitle_index]]
16
16
 
17
- if Video2gif::FFmpeg::Subtitles::KNOWN_TEXT_FORMATS.include?(subtitle_info[:codec_name])
18
- filtergraph << "setpts=PTS+#{Video2gif::Utils.duration_to_seconds(options[:seek])}/TB"
17
+ if Subtitles::KNOWN_TEXT_FORMATS.include?(subtitle_info[:codec_name])
18
+ filtergraph << "setpts=PTS+#{Utils.duration_to_seconds(options[:seek])}/TB"
19
19
  filtergraph << "subtitles='#{options[:input_filename]}':si=#{options[:subtitle_index]}"
20
20
  filtergraph << 'setpts=PTS-STARTPTS'
21
- elsif Video2gif::FFmpeg::Subtitles::KNOWN_BITMAP_FORMATS.include?(subtitle_info[:codec_name])
21
+ elsif Subtitles::KNOWN_BITMAP_FORMATS.include?(subtitle_info[:codec_name])
22
22
  filtergraph << "[0:s:#{options[:subtitle_index]}]scale=" + %W[
23
23
  flags=lanczos
24
24
  sws_dither=none
@@ -146,7 +146,7 @@ module Video2gif
146
146
  command = [executable]
147
147
  command << '-y'
148
148
  command << '-hide_banner'
149
- command << '-analyzeduration' << '2147483647' << '-probesize' << '2147483647'
149
+ # command << '-analyzeduration' << '2147483647' << '-probesize' << '2147483647'
150
150
  command << '-loglevel' << 'verbose'
151
151
  command << '-ss' << options[:seek] if options[:seek]
152
152
  command << '-t' << options[:time] if options[:time]
@@ -154,7 +154,7 @@ module Video2gif
154
154
  'resulting GIF. Takes an optional integer value to',
155
155
  'choose the subtitle stream (defaults to the first',
156
156
  'subtitle stream, index 0)') do |s|
157
- unless Video2gif::Utils.is_executable?('ffprobe')
157
+ unless Utils.is_executable?('ffprobe')
158
158
  puts 'ERROR: Requires FFmpeg utils to be installed (for ffprobe)!'
159
159
  exit 1
160
160
  end
@@ -242,7 +242,7 @@ module Video2gif
242
242
 
243
243
  parser.parse!
244
244
 
245
- unless Video2gif::Utils.is_executable?('ffmpeg')
245
+ unless Utils.is_executable?('ffmpeg')
246
246
  puts 'ERROR: Requires FFmpeg to be installed!'
247
247
  exit 1
248
248
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Video2gif
4
- VERSION = '0.0.22'
4
+ VERSION = '0.0.23'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: video2gif
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emily St.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-27 00:00:00.000000000 Z
11
+ date: 2019-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler