wco_models 3.1.0.236 → 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.
- checksums.yaml +4 -4
- data/app/models/wco/newsvideo.rb +9 -9
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a1be09f93b71a5f3d7b0ba3a06100f2760f376d706f373ec6afe0d808e6e2ce
|
|
4
|
+
data.tar.gz: 99efeb5ef454a43bde04d353e13b9252bcde62ecf9cb317c1f29f9e4b9de3566
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 84336980f1dd413188e331bd89eac8be7c8e691719970c9719c2a0ef32d69cc178308133a754429b31756111fda361e6059564542222a3e03ca284beaa97f7b1
|
|
7
|
+
data.tar.gz: 07e0e432ccce8ad65fa6060a9bc0284f3e27541b4738ce18788062e57f3bb60f108c8e5d21a46b2a5310a399e82ec6897c193ca259c3e028c5fbf04acffb8f89
|
data/app/models/wco/newsvideo.rb
CHANGED
|
@@ -53,14 +53,13 @@ class Wco::Newsvideo
|
|
|
53
53
|
def generate
|
|
54
54
|
@newsvideo = self
|
|
55
55
|
|
|
56
|
-
## put together config
|
|
56
|
+
## put together config, first thing
|
|
57
57
|
cmd = "cd #{Rails.root.join('tmp')} ; mkdir -p #{@newsvideo.id} ; cd #{@newsvideo.id} ; rm -f videolist.txt audiolist.txt ; "
|
|
58
58
|
@newsvideo.newspartials.each_with_index do |part, idx|
|
|
59
59
|
cmd = "#{cmd} echo \"file 'newspartial_#{idx}.mp4' \" >> videolist.txt ; "
|
|
60
60
|
cmd = "#{cmd} echo \"file 'newspartial_#{idx}.wav' \" >> audiolist.txt ; "
|
|
61
|
-
cmd = "#{cmd} ffmpeg -i newspartial_#{idx}.webm newspartial_#{idx}.mp4 ; "
|
|
62
61
|
end
|
|
63
|
-
puts "+++ cmd:"
|
|
62
|
+
puts "+++ config cmd:"
|
|
64
63
|
puts cmd
|
|
65
64
|
out = `#{cmd}`
|
|
66
65
|
puts! out, 'out'
|
|
@@ -69,9 +68,10 @@ class Wco::Newsvideo
|
|
|
69
68
|
cmd = "cd #{Rails.root.join('tmp', @newsvideo.id)} ; "
|
|
70
69
|
@newsvideo.newspartials.each_with_index do |part, idx|
|
|
71
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 ; "
|
|
72
72
|
cmd = "#{cmd} wget -nc -O newspartial_#{idx}.wav #{part.audio.url} ; "
|
|
73
73
|
end
|
|
74
|
-
puts "+++ cmd:"
|
|
74
|
+
puts "+++ base files cmd:"
|
|
75
75
|
puts cmd
|
|
76
76
|
out = `#{cmd}`
|
|
77
77
|
puts! out, 'out'
|
|
@@ -81,7 +81,7 @@ class Wco::Newsvideo
|
|
|
81
81
|
@newsvideo.newsoverlays.each_with_index do |overlay, idx|
|
|
82
82
|
cmd = "#{cmd} wget -nc -O overlay_#{idx}.mp4 #{overlay.video.video.url} ; "
|
|
83
83
|
end
|
|
84
|
-
puts "+++ cmd:"
|
|
84
|
+
puts "+++ overlays 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'
|
|
@@ -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'
|