wco_models 3.1.0.237 → 3.1.0.238

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/wco/newsvideo.rb +12 -12
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd733884cdbcf11f2a0568574dbf7fa468477677bb7b28d6eaf7fff4da56b3d2
4
- data.tar.gz: bdf8b710817375a21bfcdc33118704ef00fa0936e9de3749ee93aa20033f7d22
3
+ metadata.gz: 9a1be09f93b71a5f3d7b0ba3a06100f2760f376d706f373ec6afe0d808e6e2ce
4
+ data.tar.gz: 99efeb5ef454a43bde04d353e13b9252bcde62ecf9cb317c1f29f9e4b9de3566
5
5
  SHA512:
6
- metadata.gz: 8327730ee92b5289cd149a167d6623f87fa1df5434a87b2271af76f601fe1dc42e24245e45c4cb91147ea947d6adc8f1bf28be2358fc18224e2f826051513a8e
7
- data.tar.gz: dc43b7eedc87e566c52f6a99bc66bd7315bfb494b9fcb1a1ecb58c26ccf7264fac9ca30bcfed591903f9d541037ccb864cb444a9e94a7f16148b035aab67b9b5
6
+ metadata.gz: 84336980f1dd413188e331bd89eac8be7c8e691719970c9719c2a0ef32d69cc178308133a754429b31756111fda361e6059564542222a3e03ca284beaa97f7b1
7
+ data.tar.gz: 07e0e432ccce8ad65fa6060a9bc0284f3e27541b4738ce18788062e57f3bb60f108c8e5d21a46b2a5310a399e82ec6897c193ca259c3e028c5fbf04acffb8f89
@@ -53,10 +53,22 @@ class Wco::Newsvideo
53
53
  def generate
54
54
  @newsvideo = self
55
55
 
56
+ ## put together config, first thing
57
+ cmd = "cd #{Rails.root.join('tmp')} ; mkdir -p #{@newsvideo.id} ; cd #{@newsvideo.id} ; rm -f videolist.txt audiolist.txt ; "
58
+ @newsvideo.newspartials.each_with_index do |part, idx|
59
+ cmd = "#{cmd} echo \"file 'newspartial_#{idx}.mp4' \" >> videolist.txt ; "
60
+ cmd = "#{cmd} echo \"file 'newspartial_#{idx}.wav' \" >> audiolist.txt ; "
61
+ end
62
+ puts "+++ config cmd:"
63
+ puts cmd
64
+ out = `#{cmd}`
65
+ puts! out, 'out'
66
+
56
67
  ## get base files locally
57
68
  cmd = "cd #{Rails.root.join('tmp', @newsvideo.id)} ; "
58
69
  @newsvideo.newspartials.each_with_index do |part, idx|
59
70
  cmd = "#{cmd} wget -nc -O newspartial_#{idx}.webm #{part.video.video.url} ; "
71
+ cmd = "#{cmd} [ -f newspartial_#{idx}.mp4 ] || ffmpeg -i newspartial_#{idx}.webm newspartial_#{idx}.mp4 ; "
60
72
  cmd = "#{cmd} wget -nc -O newspartial_#{idx}.wav #{part.audio.url} ; "
61
73
  end
62
74
  puts "+++ base files cmd:"
@@ -74,18 +86,6 @@ class Wco::Newsvideo
74
86
  out = `#{cmd}`
75
87
  puts! out, 'out'
76
88
 
77
- ## put together config
78
- cmd = "cd #{Rails.root.join('tmp')} ; mkdir -p #{@newsvideo.id} ; cd #{@newsvideo.id} ; rm -f videolist.txt audiolist.txt ; "
79
- @newsvideo.newspartials.each_with_index do |part, idx|
80
- cmd = "#{cmd} echo \"file 'newspartial_#{idx}.mp4' \" >> videolist.txt ; "
81
- cmd = "#{cmd} echo \"file 'newspartial_#{idx}.wav' \" >> audiolist.txt ; "
82
- cmd = "#{cmd} ffmpeg -i newspartial_#{idx}.webm newspartial_#{idx}.mp4 ; "
83
- end
84
- puts "+++ config cmd:"
85
- puts cmd
86
- out = `#{cmd}`
87
- puts! out, 'out'
88
-
89
89
  ## video concat
90
90
  cmd = <<AOL
91
91
  cd #{Rails.root.join('tmp', @newsvideo.id)} ;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.237
4
+ version: 3.1.0.238
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev