mp4ize 0.0.1

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 (2) hide show
  1. data/bin/mp4ize +42 -0
  2. metadata +69 -0
data/bin/mp4ize ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'streamio-ffmpeg'
5
+ require 'powerbar'
6
+
7
+ movie = FFMPEG::Movie.new ARGV[0]
8
+
9
+ abort "I'm sorry, I can't probe file" unless movie.valid?
10
+
11
+ options = {
12
+ :y => "",
13
+ :threads => 0,
14
+ :strict => -2,
15
+ :map_chapters => -1,
16
+ :vcodec => "copy",
17
+ :acodec => "copy",
18
+ :preset => "slower",
19
+ :tune => "film"
20
+ }
21
+
22
+ if movie.audio_bitrate.to_i >= 224 || ! %w(mp3 ac3).include?(movie.audio_codec)
23
+ options[:acodec]="libmp3lame"
24
+ options["b:a"]="224k"
25
+ options[:ac]=2
26
+ end
27
+
28
+ options_string = options.map{|k,v| "-#{k.to_s} #{v}"}.join(" ")
29
+
30
+ class PowerBar
31
+ def method_missing(name, *arguments)
32
+ end
33
+ end
34
+
35
+ p = PowerBar.new
36
+ p.settings.tty.finite.template.main = "${<msg>}: ${[<bar>] }${<percent>% }${<elapsed>}${, ETA: <eta>}"
37
+ FFMPEG.logger = p # Disable FFMPEG logger that was messing with PowerBar output
38
+
39
+ movie.transcode(ARGV[1] || ARGV[0]+".mp4", options_string) { |progress|
40
+ p.show(:msg => 'Transcoding into mp4', :done => progress, :total => 1)
41
+ }
42
+
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mp4ize
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Olivier Garcia
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-19 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: powerbar
16
+ requirement: &18910940 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *18910940
25
+ - !ruby/object:Gem::Dependency
26
+ name: streamio-ffmpeg
27
+ requirement: &18910280 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *18910280
36
+ description: Transcode videos in a mp4 file, suitable for Asus Transformer
37
+ email:
38
+ - olivier at creativ-it dot net
39
+ executables:
40
+ - mp4ize
41
+ extensions: []
42
+ extra_rdoc_files: []
43
+ files:
44
+ - bin/mp4ize
45
+ homepage: http://www.naildrivin5.com/todo
46
+ licenses: []
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project:
65
+ rubygems_version: 1.8.10
66
+ signing_key:
67
+ specification_version: 3
68
+ summary: Transcode videos for Asus Transformer
69
+ test_files: []