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.
- checksums.yaml +4 -4
- data/app/models/wco/newsvideo.rb +12 -12
- 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,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)} ;
|