wco_models 3.1.0.235 → 3.1.0.237

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 +19 -19
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a14425dae992bad569a34beb628e5d815a252e925287185ffcb1b0db179ebb1
4
- data.tar.gz: f6b8396519e0b1f5bd0c19d42f577d49e60a6a277a61e664baa4b6f6fab7aa31
3
+ metadata.gz: dd733884cdbcf11f2a0568574dbf7fa468477677bb7b28d6eaf7fff4da56b3d2
4
+ data.tar.gz: bdf8b710817375a21bfcdc33118704ef00fa0936e9de3749ee93aa20033f7d22
5
5
  SHA512:
6
- metadata.gz: 4f0e75bb1369186758aad268775aba3d63c4f478784f604b7c02552a3665d7c3a3357276df555520c20c58effd1e6c6fb0cb8728f67e159b3cdc0d1ed0091cd5
7
- data.tar.gz: 453c5ae2c9454f042b75ad1e044cd65de15904b48d9247bd9ae979241a4b33fe265c640f237e1987b41ecb953ff5fd9a314d530b39331cb13516014bf17b0eeb
6
+ metadata.gz: 8327730ee92b5289cd149a167d6623f87fa1df5434a87b2271af76f601fe1dc42e24245e45c4cb91147ea947d6adc8f1bf28be2358fc18224e2f826051513a8e
7
+ data.tar.gz: dc43b7eedc87e566c52f6a99bc66bd7315bfb494b9fcb1a1ecb58c26ccf7264fac9ca30bcfed591903f9d541037ccb864cb444a9e94a7f16148b035aab67b9b5
@@ -53,25 +53,13 @@ class Wco::Newsvideo
53
53
  def generate
54
54
  @newsvideo = self
55
55
 
56
- ## put together config
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
- cmd = "#{cmd} ffmpeg -i newspartial_#{idx}.webm newspartial_#{idx}.mp4 ; "
62
- end
63
- puts "+++ cmd:"
64
- puts cmd
65
- out = `#{cmd}`
66
- puts! out, 'out'
67
-
68
56
  ## get base files locally
69
57
  cmd = "cd #{Rails.root.join('tmp', @newsvideo.id)} ; "
70
58
  @newsvideo.newspartials.each_with_index do |part, idx|
71
59
  cmd = "#{cmd} wget -nc -O newspartial_#{idx}.webm #{part.video.video.url} ; "
72
60
  cmd = "#{cmd} wget -nc -O newspartial_#{idx}.wav #{part.audio.url} ; "
73
61
  end
74
- puts "+++ cmd:"
62
+ puts "+++ base files cmd:"
75
63
  puts cmd
76
64
  out = `#{cmd}`
77
65
  puts! out, 'out'
@@ -81,7 +69,19 @@ class Wco::Newsvideo
81
69
  @newsvideo.newsoverlays.each_with_index do |overlay, idx|
82
70
  cmd = "#{cmd} wget -nc -O overlay_#{idx}.mp4 #{overlay.video.video.url} ; "
83
71
  end
84
- puts "+++ cmd:"
72
+ puts "+++ overlays cmd:"
73
+ puts cmd
74
+ out = `#{cmd}`
75
+ puts! out, 'out'
76
+
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
85
  puts cmd
86
86
  out = `#{cmd}`
87
87
  puts! out, 'out'
@@ -92,7 +92,7 @@ class Wco::Newsvideo
92
92
  rm -f video_concat.mp4 ;
93
93
  ffmpeg -f concat -safe 0 -i videolist.txt -c copy video_concat.mp4 ;
94
94
  AOL
95
- puts "+++ cmd:"
95
+ puts "+++ video concat cmd:"
96
96
  puts cmd
97
97
  out = `#{cmd}`
98
98
  puts! out, 'out'
@@ -104,7 +104,7 @@ AOL
104
104
  rm -f audio_concat.wav ;
105
105
  ffmpeg -f concat -safe 0 -i audiolist.txt -c copy audio_concat.wav ;
106
106
  AOL
107
- puts "+++ cmd:"
107
+ puts "+++ audio concat cmd:"
108
108
  puts cmd
109
109
  out = `#{cmd}`
110
110
  puts! out, 'out'
@@ -115,7 +115,7 @@ AOL
115
115
  rm -f output.mp4 ;
116
116
  ffmpeg -i video_concat.mp4 -i audio_concat.wav -c:v copy -c:a aac combined_base.mp4 ;
117
117
  AOL
118
- puts "+++ cmd:"
118
+ puts "+++ combine base cmd:"
119
119
  puts cmd
120
120
  out = `#{cmd}`
121
121
  puts! out, 'out'
@@ -137,7 +137,7 @@ AOL
137
137
  n = nil
138
138
  nn.each_with_index do |ms, idx|
139
139
  n = idx+1
140
- ffmpeg_cmd.push "[#{curr_s}][v#{n}]overlay=0:0:eof_action=pass[tmp#{n}]; \\"
140
+ ffmpeg_cmd.push "[#{curr_s}][v#{n}]overlay=0:0:eof_action=pass[tmp#{n}]#{idx+1<nn.length ? ';' : ''} \\"
141
141
  curr_s = "tmp#{n}"
142
142
  end
143
143
  ffmpeg_cmd.push " \" -map \"[#{curr_s}]\" -map 0:a? -c:v libx264 -c:a copy combined_fin.mp4 "
@@ -151,7 +151,7 @@ AOL
151
151
  rm -f combined_fin.mp4 ;
152
152
  #{ffmpeg_cmd} ;
153
153
  AOL
154
- puts "+++ cmd:"
154
+ puts "+++ ffmpeg cmd 2:"
155
155
  puts cmd
156
156
  out = `#{cmd}`
157
157
  puts! out, 'out'
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.235
4
+ version: 3.1.0.237
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev