video_transcoding 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -4
- data/bin/transcode-video +1 -1
- data/lib/video_transcoding/media.rb +8 -8
- data/lib/video_transcoding/version.rb +1 -1
- data/video_transcoding-0.1.1.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea1e5f908d34e4290159cef2ead3dc50c75f6f4e
|
4
|
+
data.tar.gz: 699559bd07d8e133272ac7222520cc5d14d3183e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd714b6cd993f10849fccd7d24ce15143fc16577ffe3809bf0b4ec7958965aca47ae4813b38aacc150bd475db56d754aea3bf675a43c5ef807f206907161edf4
|
7
|
+
data.tar.gz: 6db85f92780f16e2d5d88de5fd298c44f52f55bdef3b47c2153cec0ceacf9e051c7eb9ebdf899ac70cff1fa46796d0ff182ad58f9adda3c4022cdbbba2be6d7c
|
data/README.md
CHANGED
@@ -12,16 +12,16 @@ This package is based on my original collection of [Video Transcoding Scripts](h
|
|
12
12
|
|
13
13
|
Most of the tools in this package are essentially intelligent wrappers around Open Source software like [HandBrake](https://handbrake.fr/), [MKVToolNix](https://www.bunkus.org/videotools/mkvtoolnix/), [MPlayer](http://mplayerhq.hu/), [FFmpeg](http://ffmpeg.org/), and [MP4v2](https://code.google.com/p/mp4v2/). And they're all designed to be executed from the command line shell:
|
14
14
|
|
15
|
-
* [`transcode-video`](#
|
15
|
+
* [`transcode-video`](#why-transcode-video)
|
16
16
|
Transcode video file or disc image directory into format and size similar to popular online downloads.
|
17
17
|
|
18
|
-
* [`detect-crop`](#
|
18
|
+
* [`detect-crop`](#why-detect-crop)
|
19
19
|
Detect optimal crop values for video file or disc image directory.
|
20
20
|
|
21
|
-
* [`convert-video`](#
|
21
|
+
* [`convert-video`](#why-convert-video)
|
22
22
|
Convert video file from Matroska to MP4 format or from MP4 to Matroksa format without transcoding video.
|
23
23
|
|
24
|
-
* [`query-handbrake-log`](#
|
24
|
+
* [`query-handbrake-log`](#why-query-handbrake-log)
|
25
25
|
Report information from HandBrake-generated `.log` files.
|
26
26
|
|
27
27
|
Even if you don't try any of my tools, you may find this "README" document helpful:
|
@@ -300,6 +300,10 @@ However, you can copy the original audio track, provided HandBrake and your sele
|
|
300
300
|
|
301
301
|
transcode-video --copy-audio 1 "/path/to/Movie.mkv"
|
302
302
|
|
303
|
+
The `--copy-audio` option doesn't implicitly add the audio track to be copied. The previous command works because `1` identifies the main audio track and it's included by default. To copy a different track, you must first add it:
|
304
|
+
|
305
|
+
transcode-video --add-audio 4 --copy-audio 4 "/path/to/Movie.mkv"
|
306
|
+
|
303
307
|
Be aware that copying audio tracks in their original format will likely defeat two very important goals of transcoding: portability and compression.
|
304
308
|
|
305
309
|
#### Understanding subtitles
|
data/bin/transcode-video
CHANGED
@@ -978,7 +978,7 @@ HERE
|
|
978
978
|
def prepare_subtitle(media, handbrake_options)
|
979
979
|
return if media.info[:subtitle].empty?
|
980
980
|
|
981
|
-
if @auto_burn
|
981
|
+
if @auto_burn and not media.info[:mp4]
|
982
982
|
burn_track, _ = media.info[:subtitle].find { |_, info| info[:forced] }
|
983
983
|
else
|
984
984
|
burn_track = @burn_subtitle
|
@@ -51,9 +51,9 @@ module VideoTranscoding
|
|
51
51
|
@info = {}
|
52
52
|
|
53
53
|
if @title.nil?
|
54
|
-
if @scan =~ /\+ title ([0-9]+):\n \+ Main Feature/m
|
54
|
+
if @scan =~ /\+ title ([0-9]+):\r?\n \+ Main Feature/m
|
55
55
|
@title = $1.to_i
|
56
|
-
elsif @scan =~ /^\+ title ([0-9]+)
|
56
|
+
elsif @scan =~ /^\+ title ([0-9]+):/
|
57
57
|
@title = $1.to_i
|
58
58
|
else
|
59
59
|
@title = 1
|
@@ -70,7 +70,7 @@ module VideoTranscoding
|
|
70
70
|
@info[:size] = @stat.size
|
71
71
|
@info[:directory] = @stat.directory?
|
72
72
|
|
73
|
-
unless @scan =~ /^ \+ duration: ([0-9]{2}):([0-9]{2}):([0-9]{2})
|
73
|
+
unless @scan =~ /^ \+ duration: ([0-9]{2}):([0-9]{2}):([0-9]{2})/
|
74
74
|
fail 'media duration not found'
|
75
75
|
end
|
76
76
|
|
@@ -92,7 +92,7 @@ module VideoTranscoding
|
|
92
92
|
|
93
93
|
return @info unless @extended
|
94
94
|
|
95
|
-
unless @scan =~ / \+ audio tracks:\n(.*) \+ subtitle tracks:\n(.*)
|
95
|
+
unless @scan =~ / \+ audio tracks:\r?\n(.*) \+ subtitle tracks:\r?\n(.*)\r?\nHandBrake has exited./m
|
96
96
|
fail 'audio and subtitle information not found'
|
97
97
|
end
|
98
98
|
|
@@ -101,7 +101,7 @@ module VideoTranscoding
|
|
101
101
|
@info[:audio] = {}
|
102
102
|
@info[:subtitle] = {}
|
103
103
|
|
104
|
-
audio.each_line do |line|
|
104
|
+
audio.gsub(/\r/, '').each_line do |line|
|
105
105
|
if line =~ /^ \+ ([0-9.]+), [^(]+\(([^)]+)\) .*\(([0-9.]+) ch\) .*\(iso639-2: ([a-z]{3})\)/
|
106
106
|
track = $1.to_i
|
107
107
|
track_info = {}
|
@@ -121,7 +121,7 @@ module VideoTranscoding
|
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
|
-
subtitle.each_line do |line|
|
124
|
+
subtitle.gsub(/\r/, '').each_line do |line|
|
125
125
|
if line =~ /^ \+ ([0-9.]+), .*\(iso639-2: ([a-z]{3})\) \((?:Text|Bitmap)\)\(([^)]+)\)/
|
126
126
|
track = $1.to_i
|
127
127
|
track_info = {}
|
@@ -166,7 +166,7 @@ module VideoTranscoding
|
|
166
166
|
track_info[:default] = false
|
167
167
|
end
|
168
168
|
|
169
|
-
if @scan =~ /[ ]+Stream #0\.#{stream}[^ ]*: Audio: [^\n]+\n[ ]+Metadata:\n^[ ]+title[ ]+: ([^\n]+)/m
|
169
|
+
if @scan =~ /[ ]+Stream #0\.#{stream}[^ ]*: Audio: [^\n]+\n[ ]+Metadata:\r?\n^[ ]+title[ ]+: ([^\r\n]+)/m
|
170
170
|
track_info[:name] = $1
|
171
171
|
else
|
172
172
|
track_info[:name] = nil
|
@@ -188,7 +188,7 @@ module VideoTranscoding
|
|
188
188
|
track_info[:forced] = false
|
189
189
|
end
|
190
190
|
|
191
|
-
if @scan =~ /[ ]+Stream #0\.#{stream}[^ ]*: Subtitle: [^\n]+\n[ ]+Metadata:\n^[ ]+title[ ]+: ([^\n]+)/m
|
191
|
+
if @scan =~ /[ ]+Stream #0\.#{stream}[^ ]*: Subtitle: [^\n]+\n[ ]+Metadata:\r?\n^[ ]+title[ ]+: ([^\r\n]+)/m
|
192
192
|
track_info[:name] = $1
|
193
193
|
else
|
194
194
|
track_info[:name] = nil
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: video_transcoding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Don Melton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Video Transcoding is a package of tools to transcode, inspect
|
@@ -46,6 +46,7 @@ files:
|
|
46
46
|
- lib/video_transcoding/tool.rb
|
47
47
|
- lib/video_transcoding/version.rb
|
48
48
|
- video_transcoding-0.1.0.gem
|
49
|
+
- video_transcoding-0.1.1.gem
|
49
50
|
- video_transcoding.gemspec
|
50
51
|
homepage: https://github.com/donmelton/video_transcoding
|
51
52
|
licenses:
|