rtranscoder 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,11 @@
1
+ == 0.1.1 / 2008-01-28
2
+
3
+ * Fixed show-stopping bug:
4
+ * <tt>lib/rtranscoder/ffmpeg/ffmpeg.rb</tt> was requiring:
5
+ <tt>lib/rtransocder/ffmpeg/extensions.rb</tt> which no longer exists.
6
+ * Fixed typos in <tt>exmaples/</tt>.
7
+ * Added examples to <tt>README.txt</tt>.
8
+
1
9
  == 0.1.0 / 2008-01-27
2
10
 
3
11
  * Many bug fixes.
data/README.txt CHANGED
@@ -26,6 +26,88 @@ to Ruby classes and methods for your convenience.
26
26
 
27
27
  $ sudo gem install rtranscoder
28
28
 
29
+ == EXAMPLES:
30
+
31
+ * Encode a video to FLV.
32
+
33
+ require 'rtranscoder/ffmpeg'
34
+
35
+ include RTranscoder
36
+
37
+ FFmpeg.encode do |ffmpeg|
38
+ ffmpeg.input = 'video.avi'
39
+ ffmpeg.audio_sampling_rate = 22.050.kHz
40
+ ffmpeg.audio_bitrate = 32 # kbit/s
41
+ ffmpeg.video_frame_size = '320x240'
42
+ ffmpeg.output_format = :flv
43
+ ffmpeg.output = 'video.flv'
44
+ end
45
+
46
+ Equivalent to:
47
+
48
+ $ ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 video.flv
49
+
50
+ * Encode an input AVI file using the x264 codec.
51
+
52
+ require 'rtranscoder/mencoder'
53
+
54
+ include RTranscoder
55
+
56
+ MEncoder.encode do |mencoder|
57
+ mencoder.input = 'input.avi'
58
+ mencoder.quiet = true
59
+
60
+ # x264 settings
61
+ mencoder.output_video_codec = :x264
62
+ mencoder.x264enc.bitrate = 3000
63
+ mencoder.x264enc.nr = 2000
64
+
65
+ # faac settings
66
+ mencoder.output_audio_codec = :faac
67
+ mencoder.faac.br = 32
68
+ mencoder.faac.tns = true
69
+
70
+ mencoder.output = 'output.mp4'
71
+ end
72
+
73
+ Equivalent to:
74
+
75
+ $ mencoder input.avi -o output.mp4 -queit -ovc x264 -x264encopts \
76
+ bitrate=3000:nr=2000 -oac faac -faacopts br=32:tns
77
+
78
+ * Extracts frame starting at 00:00:03 for 00:00:01.
79
+
80
+ require 'rtranscoder/ffmpeg'
81
+
82
+ include RTranscoder
83
+
84
+ FFmpeg.encode do |ffmpeg|
85
+ ffmpeg.input = 'video.flv'
86
+ ffmpeg.disable_audio = true
87
+ ffmpeg.record_start_time = '00:00:03'
88
+ ffmpeg.record_for = '00:00:01'
89
+ ffmpeg.fps = 1
90
+ ffmpeg.overwrite_output_files = true
91
+ ffmpeg.video_frame_size = '320x240'
92
+ ffmpeg.output = 'video_thumbnail_%d.jpg'
93
+ end
94
+
95
+ Or even simplier...
96
+
97
+ require 'rtranscoder/ffmpeg'
98
+
99
+ RTranscoder.thumbnail(:video => 'video.flv',
100
+ :start => '00:00:03',
101
+ :length => '00:00:01',
102
+ :width => 320,
103
+ :height => 240,
104
+ :image => 'video_thumbnail_%d.jpg')
105
+
106
+ Both equivalent to:
107
+
108
+ $ ffmpeg -i video.flv -an -ss 00:00:03 -t 00:00:01 -r 1 -y \
109
+ -s 320x240 video_thumbnail_%d.jpg
110
+
29
111
  == LICENSE:
30
112
 
31
113
  The MIT License
@@ -3,9 +3,7 @@ require 'rtranscoder/ffmpeg'
3
3
  include RTranscoder
4
4
 
5
5
  #
6
- # Encodes a video to FLV.
7
- # Equivalent to:
8
- # $ ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 video.flv
6
+ # Encode an video to FLV.
9
7
  #
10
8
  FFmpeg.encode do |ffmpeg|
11
9
  ffmpeg.input = 'video.avi'
@@ -15,3 +13,8 @@ FFmpeg.encode do |ffmpeg|
15
13
  ffmpeg.output_format = :flv
16
14
  ffmpeg.output = 'video.flv'
17
15
  end
16
+
17
+ #
18
+ # Equivalent to:
19
+ # $ ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 video.flv
20
+ #
@@ -3,10 +3,7 @@ require 'rtranscoder/ffmpeg'
3
3
  include RTranscoder
4
4
 
5
5
  #
6
- # Extracts a frame at 00:00:03.
7
- # Equivlanent to:
8
- # $ ffmpeg -i video.flv -an -ss 00:00:03 -t 00:00:01 -r 1 -y -s 320x240
9
- # video_thumbnail.jpg
6
+ # Extracts frame starting at 00:00:03 for 00:00:01.
10
7
  #
11
8
  FFmpeg.encode do |ffmpeg|
12
9
  ffmpeg.input = 'video.flv'
@@ -16,7 +13,7 @@ FFmpeg.encode do |ffmpeg|
16
13
  ffmpeg.fps = 1
17
14
  ffmpeg.overwrite_output_files = true
18
15
  ffmpeg.video_frame_size = '320x240'
19
- ffmpeg.output = 'video_thumbnail%d.jpg'
16
+ ffmpeg.output = 'video_thumbnail_%d.jpg'
20
17
  end
21
18
 
22
19
  #
@@ -27,4 +24,10 @@ RTranscoder.thumbnail(:video => 'video.flv',
27
24
  :length => '00:00:01',
28
25
  :width => 320,
29
26
  :height => 240,
30
- :image => 'thumb%d.jpg')
27
+ :image => 'video_thumbnail_%d.jpg')
28
+
29
+ #
30
+ # Both equivalent to:
31
+ # $ ffmpeg -i video.flv -an -ss 00:00:03 -t 00:00:01 -r 1 -y \
32
+ # -s 320x240 video_thumbnail_%d.jpg
33
+ #
@@ -1,5 +1,4 @@
1
1
  require 'rtranscoder/ffmpeg/ffmpeg_task'
2
- require 'rtranscoder/ffmpeg/extensions'
3
2
  require 'rtranscoder/extensions'
4
3
 
5
4
  require 'rprogram/program'
@@ -1,3 +1,3 @@
1
1
  module RTranscoder
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: rtranscoder
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.0
7
- date: 2008-01-27 00:00:00 -08:00
6
+ version: 0.1.1
7
+ date: 2008-01-28 00:00:00 -08:00
8
8
  summary: A Rubyful interface to various transcoding utilities using the RProgram library.
9
9
  require_paths:
10
10
  - lib