dvdvrconv 1.0.2 → 1.2.0
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/README.md +304 -54
- data/dvdvrconv.gemspec +1 -1
- data/lib/dvdvrconv/command.rb +60 -19
- data/lib/dvdvrconv/dvdvr.rb +38 -9
- data/lib/dvdvrconv/options.rb +8 -2
- data/lib/dvdvrconv/version.rb +1 -1
- data/{sample_default_dvdvrconv.yaml → sample_default_dvdvrconv.yml} +0 -0
- data/{sample_my.yaml → sample_my.yml} +0 -0
- data/test-unit.yml +11 -11
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60c712bd8767cdb73ae5d0049e5f5a82dde6ca4e8e82ec53747f2a772db5ffed
|
4
|
+
data.tar.gz: 72d7400f331b064ddb1530427c8c7257736223c6c38b3872ea0c46f708b36363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22c9af9efb48ef68efd27cf859fc7243a6ec8e7817df89f18d6dc3e05d1bbcc7ad5cdba103e55027af491dbbb9bc2e1f6208eff798bd64b159ed76864478e98a
|
7
|
+
data.tar.gz: 6e4735ab98426feea6d4fcd3b3862742e4688322e56af7b2dc2dbd49ac0383fdd413ea522dcd04da50f2dcf23279043020f48bdd03c97c512daccd364d05bb01
|
data/README.md
CHANGED
@@ -1,55 +1,305 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
For Windows users, I attached `dvd-vr.exe` for cygwin environment.
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
* [
|
12
|
-
* FFmpeg
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
Add this line to your application's Gemfile:
|
17
|
-
|
18
|
-
```ruby
|
19
|
-
gem 'dvdvrconv'
|
20
|
-
```
|
21
|
-
|
22
|
-
And then execute:
|
23
|
-
```ruby
|
24
|
-
$ bundle install
|
25
|
-
```
|
26
|
-
Or install it yourself as:
|
27
|
-
```ruby
|
28
|
-
$ gem install dvdvrconv
|
29
|
-
```
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
1
|
+
# dvdvrconv [](https://badge.fury.io/rb/dvdvrconv)
|
2
|
+
|
3
|
+
|
4
|
+
dvdvrconv extracts the `vob` files from the `vro` files on the DVD-VR format disc and converts them to `mp4` files.
|
5
|
+
dvdvrconv is also a wrapper for [pixelb/dvd-vr](https://github.com/pixelb/dvd-vr/).
|
6
|
+
|
7
|
+
For Windows users, I attached `dvd-vr.exe` for cygwin environment.
|
8
|
+
|
9
|
+
# dependent libraries
|
10
|
+
|
11
|
+
* [dvd-vr](https://github.com/pixelb/dvd-vr/)
|
12
|
+
* [FFmpeg](https://www.ffmpeg.org/)
|
13
|
+
|
14
|
+
# Installation
|
15
|
+
|
16
|
+
Add this line to your application's Gemfile:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
gem 'dvdvrconv'
|
20
|
+
```
|
21
|
+
|
22
|
+
And then execute:
|
23
|
+
```ruby
|
24
|
+
$ bundle install
|
25
|
+
```
|
26
|
+
Or install it yourself as:
|
27
|
+
```ruby
|
28
|
+
$ gem install dvdvrconv
|
29
|
+
```
|
30
|
+
|
31
|
+
|
32
|
+
# Usage
|
33
|
+
|
34
|
+
View video information from dvd-ram disc in dvd-vr format.
|
35
|
+
|
36
|
+
`dvdvrconv -i` or `dvdvrconv`
|
37
|
+
```
|
38
|
+
>dvdvrconv
|
39
|
+
== Use these paths ==
|
40
|
+
=> VR_MANGR.IFO: ./DVD_RTAV/VR_MANGR.IFO
|
41
|
+
=> VR_MOVIE.VRO ./DVD_RTAV/VR_MOVIE.VRO
|
42
|
+
=> dvd-vr.exe: ./win/dvd-vr.exe
|
43
|
+
----- view dvd-vr info -----
|
44
|
+
format: DVD-VR V1.1
|
45
|
+
Encryption: CPRM supported
|
46
|
+
|
47
|
+
tv_system : NTSC
|
48
|
+
resolution : 704x480
|
49
|
+
aspect_ratio: 4:3
|
50
|
+
video_format: MPEG2
|
51
|
+
audio_channs: 2
|
52
|
+
audio_coding: Dolby AC-3
|
53
|
+
|
54
|
+
num : 1
|
55
|
+
title: TEST1
|
56
|
+
date : 2019-10-30 22:32:07
|
57
|
+
size : 3534848
|
58
|
+
-
|
59
|
+
num : 2
|
60
|
+
title: TEST2
|
61
|
+
date : 2019-10-30 22:33:05
|
62
|
+
size : 2965504
|
63
|
+
-
|
64
|
+
num : 3
|
65
|
+
title: TEST3
|
66
|
+
date : 2019-10-30 22:33:37
|
67
|
+
size : 2394112
|
68
|
+
-
|
69
|
+
```
|
70
|
+
|
71
|
+
Execute the VRO file to mp4 conversion.
|
72
|
+
|
73
|
+
`dvdvrconv -e` or `dvdvrconv --exec`
|
74
|
+
|
75
|
+
Command options
|
76
|
+
```
|
77
|
+
>dvdvrconv -h
|
78
|
+
Usage: dvdvrconv [options]
|
79
|
+
-v, --version Show version
|
80
|
+
-i, --info Show file information
|
81
|
+
-c, --config=FILE Use YAML format FILE.
|
82
|
+
-e, --exec Execute the VRO file to mp4 conversion.
|
83
|
+
```
|
84
|
+
|
85
|
+
# Configure dvdvrconv
|
86
|
+
|
87
|
+
dvdvrconv reads `default_dvdvrconv.yml` in the current working directory as dvdvrconv's configuration file. It can contain the following settings:
|
88
|
+
|
89
|
+
* vr_mangr_ifo
|
90
|
+
* vr_movie_vro
|
91
|
+
* dvd_vr_cmd
|
92
|
+
* use_customize_title
|
93
|
+
* base_dst_name
|
94
|
+
* number_list
|
95
|
+
|
96
|
+
## vr_mangr_ifo, vr_movie_vro
|
97
|
+
|
98
|
+
`vr_mangr_ifo` and `vr_movie_vro` specify the path to the dvd-ram disc.
|
99
|
+
Drive D is assumed, if different you need to write its path.
|
100
|
+
|
101
|
+
windows default
|
102
|
+
```
|
103
|
+
vr_mangr_ifo: "/cygdrive/D/DVD_RTAV/VR_MANGR.IFO"
|
104
|
+
vr_movie_vro: "/cygdrive/D/DVD_RTAV/VR_MOVIE.VRO"
|
105
|
+
```
|
106
|
+
|
107
|
+
WSL(ubuntu) default
|
108
|
+
```
|
109
|
+
vr_mangr_ifo: "/mnt/d/DVD_RTAV/VR_MANGR.IFO"
|
110
|
+
vr_movie_vro: "/mnt/d/DVD_RTAV/VR_MOVIE.VRO"
|
111
|
+
```
|
112
|
+
|
113
|
+
## dvd_vr_cmd
|
114
|
+
|
115
|
+
On Windows, you can use the included dvd-vr command.
|
116
|
+
|
117
|
+
On WSL(ubuntu), you can use the dvd-vr command that you have compiled yourself.
|
118
|
+
* See the section below, "install dependent libraries for WSL(ubuntu)"
|
119
|
+
|
120
|
+
## use_customize_title, base_dst_name, number_list
|
121
|
+
|
122
|
+
customize the title name of vob files.
|
123
|
+
|
124
|
+
If specify individual file names. Write "base_dst_name:" as an Array.
|
125
|
+
```
|
126
|
+
use_customize_title: 1
|
127
|
+
base_dst_name: ["name_one", "name_two"]
|
128
|
+
number_list: []
|
129
|
+
```
|
130
|
+
The resulting file name is => ["name_one", "name_two"]
|
131
|
+
|
132
|
+
|
133
|
+
If add a sequence number to the file name. Write "base_dst_name:" as String.
|
134
|
+
```
|
135
|
+
use_customize_title: 2
|
136
|
+
base_dst_name: "output_name_"
|
137
|
+
number_list: []
|
138
|
+
```
|
139
|
+
The resulting file name is => ["output_name_01", "output_name_02", ...]
|
140
|
+
|
141
|
+
If specify sequence numbers individually.
|
142
|
+
Write "base_dst_name:" as String and Write "number_list" as an Array.
|
143
|
+
```
|
144
|
+
use_customize_title: 3
|
145
|
+
base_dst_name: "output_name_"
|
146
|
+
number_list: [12, 13, 14, 15]
|
147
|
+
```
|
148
|
+
The resulting file name is => ["output_name_12", "output_name_13", "output_name_14", "output_name_15"]
|
149
|
+
|
150
|
+
|
151
|
+
If do not want to customize the title name,
|
152
|
+
Specify `use_customize_title: no`.
|
153
|
+
```
|
154
|
+
use_customize_title: no
|
155
|
+
base_dst_name: []
|
156
|
+
number_list: []
|
157
|
+
```
|
158
|
+
|
159
|
+
## concat mode
|
160
|
+
|
161
|
+
Allow users to choose to concatenate or not concatenate titles with the same name.
|
162
|
+
|
163
|
+
When editing a title on a dvd-vr recorder (e.g., partial cut editing.), the title is split into multiple files.
|
164
|
+
|
165
|
+
Enabling "concat_mode" allows you to concatenate multiple split files into one.
|
166
|
+
|
167
|
+
If this option is not specified, the default setting is to concatenate titles of the same name.
|
168
|
+
```
|
169
|
+
concat_mode: true
|
170
|
+
```
|
171
|
+
|
172
|
+
On the other hand, you may not want to concatenate multiple titles with the same name on a dvd-vr disc.
|
173
|
+
In this case, "concat_mode" can be disabled.
|
174
|
+
```
|
175
|
+
concat_mode: false
|
176
|
+
```
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
# Install dependent libraries for WSL(ubuntu)
|
182
|
+
|
183
|
+
## dvd-vr
|
184
|
+
|
185
|
+
* [pixelb/dvd-vr](https://github.com/pixelb/dvd-vr/)
|
186
|
+
|
187
|
+
```
|
188
|
+
$ git clone https://github.com/pixelb/dvd-vr.git
|
189
|
+
Cloning into 'dvd-vr'...
|
190
|
+
remote: Enumerating objects: 140, done.
|
191
|
+
remote: Total 140 (delta 0), reused 0 (delta 0), pack-reused 140
|
192
|
+
Receiving objects: 100% (140/140), 260.97 KiB | 40.00 KiB/s, done.
|
193
|
+
Resolving deltas: 100% (37/37), done.
|
194
|
+
|
195
|
+
$ cd dvd-vr/
|
196
|
+
|
197
|
+
$ sudo make install
|
198
|
+
cc -std=gnu99 -Wall -Wextra -Wpadded -DVERSION='"0.9.8b"' -O3 -DNDEBUG -DHAVE_ICONV -DICONV_CONST="" -c -o dvd-vr.o dvd-vr.c
|
199
|
+
cc dvd-vr.o -Wl,-S -o dvd-vr
|
200
|
+
cp -p dvd-vr /usr/local/bin
|
201
|
+
gzip -c man/dvd-vr.1 > /usr/local/share/man/man1/dvd-vr.1.gz
|
202
|
+
|
203
|
+
$ dvd-vr --help
|
204
|
+
Usage: dvd-vr [OPTION]... VR_MANGR.IFO [VR_MOVIE.VRO]
|
205
|
+
Print info about and optionally extract vob data from DVD-VR files.
|
206
|
+
|
207
|
+
If the VRO file is specified, the component programs are
|
208
|
+
extracted to the current directory or to stdout.
|
209
|
+
|
210
|
+
-p, --program=NUM Only process program NUM rather than all programs.
|
211
|
+
|
212
|
+
-n, --name=NAME Specify a basename to use for extracted vob files
|
213
|
+
rather than using one based on the timestamp.
|
214
|
+
If you pass `-' the vob files will be written to stdout.
|
215
|
+
If you pass `[label]' the names will be based on
|
216
|
+
a sanitized version of the title or label.
|
217
|
+
|
218
|
+
--help Display this help and exit.
|
219
|
+
--version Output version information and exit.
|
220
|
+
```
|
221
|
+
|
222
|
+
|
223
|
+
## FFmpeg
|
224
|
+
|
225
|
+
```
|
226
|
+
sudo apt install ffmpeg
|
227
|
+
```
|
228
|
+
|
229
|
+
# Install dependent libraries for Windows
|
230
|
+
|
231
|
+
## dvd-vr
|
232
|
+
|
233
|
+
Compile dvd-vr command in Cygwin environment.
|
234
|
+
|
235
|
+
Download Cygwin for 64-bit version. => [setup-x86_64.exe](https://cygwin.com/setup-x86_64.exe)
|
236
|
+
|
237
|
+
|
238
|
+
Install Cygwin for 64-bit version. At the Windows command prompt.
|
239
|
+
```
|
240
|
+
setup-x86_64.exe ^
|
241
|
+
--root c:\cygwin64 ^
|
242
|
+
--local-package-dir c:\cygwin64\packages ^
|
243
|
+
--site https://ftp.iij.ad.jp/pub/cygwin/ ^
|
244
|
+
--quiet-mode ^
|
245
|
+
--packages libiconv,libiconv-devel,gcc-core,gcc-g++,git,make
|
246
|
+
```
|
247
|
+
|
248
|
+
Compile dvd-vr. At the Cygwin terminal.
|
249
|
+
```
|
250
|
+
$ git clone https://github.com/pixelb/dvd-vr.git
|
251
|
+
Cloning into 'dvd-vr'...
|
252
|
+
remote: Enumerating objects: 140, done.
|
253
|
+
remote: Total 140 (delta 0), reused 0 (delta 0), pack-reused 140
|
254
|
+
Receiving objects: 100% (140/140), 260.97 KiB | 954.00 KiB/s, done.
|
255
|
+
Resolving deltas: 100% (37/37), done.
|
256
|
+
|
257
|
+
$ cd dvd-vr/
|
258
|
+
|
259
|
+
$ make install
|
260
|
+
cc -std=gnu99 -Wall -Wextra -Wpadded -DVERSION='"0.9.8b"' -O3 -DNDEBUG -DHAVE_ICONV -DICONV_CONST="const" -c -o dvd-vr.o dvd-vr.c
|
261
|
+
dvd-vr.c: In function ‘text_convert’:
|
262
|
+
dvd-vr.c:414:24: warning: passing argument 2 of ‘libiconv’ from incompatible pointer type [-Wincompatible-pointer-types]
|
263
|
+
414 | if (iconv (cd, (ICONV_CONST char**)&src, &srclen, &dst, &dstlen) != (size_t)-1) {
|
264
|
+
| ^~~~~~~~~~~~~~~~~~~~~~~~
|
265
|
+
| |
|
266
|
+
| const char **
|
267
|
+
In file included from dvd-vr.c:124:
|
268
|
+
/usr/include/iconv.h:82:43: note: expected ‘char **’ but argument is of type ‘const char **’
|
269
|
+
82 | extern size_t iconv (iconv_t cd, char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
|
270
|
+
| ~~~~~~~~^~~~~
|
271
|
+
cc dvd-vr.o -liconv -Wl,-S -o dvd-vr.exe
|
272
|
+
cp man/dvd-vr.man man/dvd-vr.1
|
273
|
+
cp -p dvd-vr.exe /usr/local/bin
|
274
|
+
gzip -c man/dvd-vr.1 > /usr/local/share/man/man1/dvd-vr.1.gz
|
275
|
+
```
|
276
|
+
|
277
|
+
After compile success, you will get the following files.
|
278
|
+
* dvd-vr.exe (c:\cygwin64\home\user_name\dvd-vr)
|
279
|
+
* cygwin1.dll (c:\cygwin64\bin)
|
280
|
+
* cygiconv-2.dll (c:\cygwin64\bin)
|
281
|
+
|
282
|
+
|
283
|
+
## FFmpeg
|
284
|
+
|
285
|
+
* [FFmpeg](https://www.ffmpeg.org/download.html)
|
286
|
+
From the Windows EXE Files link above, select the following website.
|
287
|
+
* [Releases · BtbN/FFmpeg-Builds](https://github.com/BtbN/FFmpeg-Builds/releases) (daily auto-build).
|
288
|
+
|
289
|
+
As an example, download Auto-Build 2021-09-28 12:22.
|
290
|
+
* [ffmpeg-N-103899-g855014ff83-win64-gpl.zip 100MB](https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2021-09-28-12-22/ffmpeg-N-103899-g855014ff83-win64-gpl.zip)
|
291
|
+
|
292
|
+
|
293
|
+
# Development
|
294
|
+
|
295
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
296
|
+
|
297
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
# License
|
302
|
+
|
303
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
304
|
+
|
55
305
|
pixelb/dvd-vr is licensed under the GNU General Public License v2.0
|
data/dvdvrconv.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.email = ["icm7216d@gmail.com"]
|
8
8
|
|
9
9
|
spec.summary = %q{DVD-VR utility}
|
10
|
-
spec.description = %q{This tool converts "
|
10
|
+
spec.description = %q{This tool converts "vro" file on DVD-VR format disc to "mp4" files.}
|
11
11
|
spec.homepage = "https://github.com/icm7216/dvdvrconv"
|
12
12
|
spec.license = "MIT"
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
data/lib/dvdvrconv/command.rb
CHANGED
@@ -10,6 +10,7 @@ module Dvdvrconv
|
|
10
10
|
|
11
11
|
config_file = Dvdvrconv::DEFAULT_CONFIG_FILE
|
12
12
|
if File.exist?(config_file)
|
13
|
+
puts "Read the default config file. => #{config_file}"
|
13
14
|
load_config(config_file)
|
14
15
|
end
|
15
16
|
end
|
@@ -20,12 +21,23 @@ module Dvdvrconv
|
|
20
21
|
dvd = Dvdvrconv::Dvdvr.new
|
21
22
|
|
22
23
|
# Set the path specified in the yaml file.
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
if @options[:vr_mangr_ifo]
|
25
|
+
dvd.vrdisc.opts_ifo = @options[:vr_mangr_ifo]
|
26
|
+
else
|
27
|
+
dvd.vrdisc.opts_ifo = dvd.vrdisc.default_opts_ifo
|
28
|
+
end
|
29
|
+
|
30
|
+
if @options[:vr_movie_vro]
|
31
|
+
dvd.vrdisc.opts_vro = @options[:vr_movie_vro]
|
32
|
+
else
|
33
|
+
dvd.vrdisc.opts_vro = dvd.vrdisc.default_opts_vro
|
34
|
+
end
|
26
35
|
|
27
|
-
|
28
|
-
|
36
|
+
if @options[:dvd_vr_cmd]
|
37
|
+
dvd.vrdisc.cmd = @options[:dvd_vr_cmd]
|
38
|
+
else
|
39
|
+
dvd.vrdisc.cmd = dvd.vrdisc.default_cmd
|
40
|
+
end
|
29
41
|
|
30
42
|
if options[:opt][:config_file]
|
31
43
|
puts "Use config file\n => #{options[:opt][:config_file]}"
|
@@ -36,19 +48,28 @@ module Dvdvrconv
|
|
36
48
|
dvd.vrdisc.cmd = @options[:dvd_vr_cmd] if @options[:dvd_vr_cmd]
|
37
49
|
end
|
38
50
|
|
51
|
+
if @options[:concat_mode].nil?
|
52
|
+
dvd.vrdisc.concat_mode = Dvdvrconv::DEFAULT_CONCAT_MODE
|
53
|
+
else
|
54
|
+
dvd.vrdisc.concat_mode = @options[:concat_mode]
|
55
|
+
end
|
56
|
+
|
39
57
|
# View the path of each files
|
40
58
|
puts "== Use these paths =="
|
41
59
|
puts " => VR_MANGR.IFO: #{dvd.vrdisc.opts_ifo}"
|
42
60
|
puts " => VR_MOVIE.VRO #{dvd.vrdisc.opts_vro}"
|
43
61
|
puts " => dvd-vr.exe: #{dvd.vrdisc.cmd}"
|
62
|
+
puts "== Customize settings =="
|
63
|
+
puts " => use_customize_title: #{@options[:use_customize_title]}"
|
64
|
+
puts " => base_dst_name: #{@options[:base_dst_name]}"
|
65
|
+
puts " => number_list: #{@options[:number_list]}"
|
66
|
+
puts " => concat_mode: #{@options[:concat_mode]}"
|
44
67
|
|
45
68
|
dvd.read_info
|
46
69
|
|
47
|
-
if options[:opt][:info]
|
48
|
-
|
49
|
-
|
50
|
-
end
|
51
|
-
|
70
|
+
dvd.view_info if options[:opt][:info] || options[:opt].empty?
|
71
|
+
exit unless options[:opt][:exec]
|
72
|
+
|
52
73
|
# Extract vob files
|
53
74
|
dvd.adjust_title
|
54
75
|
dvd.vro2vob
|
@@ -58,8 +79,11 @@ module Dvdvrconv
|
|
58
79
|
dvd.rename_vob
|
59
80
|
|
60
81
|
# Concatenate Split titles
|
61
|
-
|
62
|
-
|
82
|
+
if dvd.vrdisc.concat_mode == true
|
83
|
+
puts "== Concatenate Split titles =="
|
84
|
+
concat_list = dvd.make_concat_list
|
85
|
+
dvd.concat_titles(concat_list)
|
86
|
+
end
|
63
87
|
|
64
88
|
# customize title of vob files
|
65
89
|
case @options[:use_customize_title]
|
@@ -101,6 +125,7 @@ module Dvdvrconv
|
|
101
125
|
puts "ERROR: number_list should be an Array."
|
102
126
|
exit
|
103
127
|
end
|
128
|
+
|
104
129
|
else
|
105
130
|
puts "No customize file names"
|
106
131
|
base_dst_name = dvd.vrdisc.title.uniq.map { |file| file[0].gsub(/\s/, "_") }
|
@@ -116,24 +141,40 @@ module Dvdvrconv
|
|
116
141
|
|
117
142
|
# load yaml file and store in @options.
|
118
143
|
def load_config(file)
|
119
|
-
config = YAML.load(File.read(file))
|
144
|
+
config = YAML.load(File.read(file)) || {}
|
120
145
|
|
121
146
|
%w(vr_mangr_ifo vr_movie_vro dvd_vr_cmd).each do |key|
|
147
|
+
@options[key.to_sym] = nil
|
148
|
+
|
122
149
|
unless config.key?(key)
|
123
150
|
puts "[ #{key} ] does not exist in #{file} file."
|
124
|
-
exit
|
125
|
-
end
|
126
|
-
|
127
|
-
if File.exist?(config[key])
|
128
|
-
@options[key.to_sym] = config[key]
|
129
151
|
else
|
130
|
-
|
152
|
+
if File.exist?(config[key])
|
153
|
+
@options[key.to_sym] = config[key]
|
154
|
+
else
|
155
|
+
puts "File read error. No such file: #{config[key]}"
|
156
|
+
end
|
131
157
|
end
|
158
|
+
|
132
159
|
end
|
133
160
|
|
134
161
|
@options[:use_customize_title] = config["use_customize_title"] || "no"
|
135
162
|
@options[:base_dst_name] = config["base_dst_name"] || []
|
136
163
|
@options[:number_list] = config["number_list"] || []
|
164
|
+
|
165
|
+
if config["concat_mode"].nil?
|
166
|
+
@options[:concat_mode] = Dvdvrconv::DEFAULT_CONCAT_MODE
|
167
|
+
else
|
168
|
+
@options[:concat_mode] = config["concat_mode"]
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
def dvdpath
|
173
|
+
{
|
174
|
+
:vr_mangr_ifo => @options[:vr_mangr_ifo],
|
175
|
+
:vr_movie_vro => @options[:vr_movie_vro],
|
176
|
+
:dvd_vr_cmd => @options[:dvd_vr_cmd]
|
177
|
+
}
|
137
178
|
end
|
138
179
|
end
|
139
180
|
end
|
data/lib/dvdvrconv/dvdvr.rb
CHANGED
@@ -13,16 +13,21 @@ module Dvdvrconv
|
|
13
13
|
:output_title, # @param [Array<String>]
|
14
14
|
:duplicate_name, # @param [Array<String>]
|
15
15
|
:vob_titles, # @param [Array<String>]
|
16
|
+
:default_opts_ifo,# @param [String]
|
17
|
+
:default_opts_vro,# @param [String]
|
18
|
+
:default_cmd, # @param [String]
|
19
|
+
:concat_mode, # @param [Boolean]
|
16
20
|
)
|
17
21
|
|
18
22
|
BASE_NAME = "DVD"
|
19
|
-
DEFAULT_CONFIG_FILE = "default_dvdvrconv.
|
23
|
+
DEFAULT_CONFIG_FILE = "default_dvdvrconv.yml"
|
24
|
+
DEFAULT_CONCAT_MODE = true
|
20
25
|
|
21
26
|
# Default DVD drive is "d".
|
22
|
-
# If you want to use a different drive, you need to set up a "default_dvdvrconv.
|
27
|
+
# If you want to use a different drive, you need to set up a "default_dvdvrconv.yml" file.
|
23
28
|
WIN_DRV_IFO = "/cygdrive/D/DVD_RTAV/VR_MANGR.IFO"
|
24
29
|
WIN_DRV_VRO = "/cygdrive/D/DVD_RTAV/VR_MOVIE.VRO"
|
25
|
-
WIN_DRV_CMD = "win/dvd-vr.exe"
|
30
|
+
WIN_DRV_CMD = File.expand_path("../../win/dvd-vr.exe", __dir__)
|
26
31
|
DRV_IFO = "/mnt/d/DVD_RTAV/VR_MANGR.IFO"
|
27
32
|
DRV_VRO = "/mnt/d/DVD_RTAV/VR_MOVIE.VRO"
|
28
33
|
DRV_CMD = "dvd-vr"
|
@@ -42,6 +47,11 @@ module Dvdvrconv
|
|
42
47
|
@vrdisc.opts_vro = Dvdvrconv::DRV_VRO
|
43
48
|
@vrdisc.cmd = Dvdvrconv::DRV_CMD
|
44
49
|
end
|
50
|
+
|
51
|
+
@vrdisc.default_opts_ifo = @vrdisc.opts_ifo
|
52
|
+
@vrdisc.default_opts_vro = @vrdisc.opts_vro
|
53
|
+
@vrdisc.default_cmd = @vrdisc.cmd
|
54
|
+
@vrdisc.concat_mode = Dvdvrconv::DEFAULT_CONCAT_MODE
|
45
55
|
end
|
46
56
|
|
47
57
|
# Read VRO file from dvd-ram disc in dvd-vr format, and output vob files.
|
@@ -75,6 +85,7 @@ module Dvdvrconv
|
|
75
85
|
#
|
76
86
|
def read_info
|
77
87
|
out, err, status = Open3.capture3(@vrdisc.cmd, @vrdisc.opts_ifo)
|
88
|
+
puts "File read error => #{err}" unless status.success?
|
78
89
|
@vrdisc.header = out.scan(/^(.*?)Number/m)
|
79
90
|
|
80
91
|
# Sets the captured information to @vrdisc.
|
@@ -204,18 +215,28 @@ module Dvdvrconv
|
|
204
215
|
def customize_title(base_dst_name, number_list = [])
|
205
216
|
vob_titles = []
|
206
217
|
|
207
|
-
|
208
|
-
|
209
|
-
|
218
|
+
if @vrdisc.concat_mode == true
|
219
|
+
titels = @vrdisc.title.uniq.flatten
|
220
|
+
else
|
221
|
+
titels = @vrdisc.output_title
|
222
|
+
end
|
223
|
+
|
224
|
+
titels.each_with_index do |title, idx|
|
225
|
+
src = title.gsub(/\s/, "_") + ".vob"
|
210
226
|
|
211
227
|
case base_dst_name
|
212
228
|
when Array
|
213
|
-
dst_name = base_dst_name[
|
229
|
+
dst_name = base_dst_name[idx]
|
214
230
|
when String
|
215
231
|
if number_list.size.zero?
|
216
|
-
dst_name = base_dst_name + format("_%02d",
|
232
|
+
dst_name = base_dst_name + format("_%02d", idx + 1)
|
217
233
|
else
|
218
|
-
|
234
|
+
case number_list[idx]
|
235
|
+
when Numeric
|
236
|
+
dst_name = base_dst_name + format("_%02d", number_list[idx])
|
237
|
+
when String
|
238
|
+
dst_name = base_dst_name + format("_%s", number_list[idx])
|
239
|
+
end
|
219
240
|
end
|
220
241
|
end
|
221
242
|
|
@@ -303,6 +324,14 @@ module Dvdvrconv
|
|
303
324
|
end
|
304
325
|
end
|
305
326
|
|
327
|
+
def vrdisc_status
|
328
|
+
puts "\n< < < < < @vrdisc status > > > > >"
|
329
|
+
%w(num title output_title duplicate_name vob_titles concat_mode).each do |item|
|
330
|
+
puts "#{item}=> #{@vrdisc[item]}"
|
331
|
+
end
|
332
|
+
puts "< < < < < @vrdisc status > > > > >\n"
|
333
|
+
end
|
334
|
+
|
306
335
|
# convert vob to mp4.
|
307
336
|
#
|
308
337
|
# required Values:
|
data/lib/dvdvrconv/options.rb
CHANGED
@@ -15,9 +15,13 @@ module Dvdvrconv
|
|
15
15
|
options[:info] = v
|
16
16
|
end
|
17
17
|
|
18
|
-
o.on("--config=FILE", String, "Use YAML format FILE.") do |file|
|
18
|
+
o.on("-c", "--config=FILE", String, "Use YAML format FILE.") do |file|
|
19
19
|
options[:config_file] = file
|
20
20
|
end
|
21
|
+
|
22
|
+
o.on("-e", "--exec", "Execute the VRO file to mp4 conversion.") do |v|
|
23
|
+
options[:exec] = v
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
23
27
|
begin
|
@@ -26,11 +30,13 @@ module Dvdvrconv
|
|
26
30
|
abort e.message
|
27
31
|
rescue OptionParser::MissingArgument => e
|
28
32
|
case e.args
|
29
|
-
when ["--config"]
|
33
|
+
when ["-c"], ["--config"]
|
30
34
|
# load_config(Dvdvrconv::DEFAULT_CONFIG_FILE)
|
31
35
|
puts "The config file has not been specified.\nUse the default configuration file. (=> #{Dvdvrconv::DEFAULT_CONFIG_FILE})"
|
32
36
|
options[:config_file] = Dvdvrconv::DEFAULT_CONFIG_FILE
|
33
37
|
end
|
38
|
+
rescue OptionParser::ParseError => e
|
39
|
+
abort e.message
|
34
40
|
end
|
35
41
|
|
36
42
|
{ opt: options }
|
data/lib/dvdvrconv/version.rb
CHANGED
File without changes
|
File without changes
|
data/test-unit.yml
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
runner: console
|
2
|
-
console_options:
|
3
|
-
color_scheme: normal
|
4
|
-
color_schemes:
|
5
|
-
normal:
|
6
|
-
success:
|
7
|
-
name: green
|
8
|
-
bold: true
|
9
|
-
failure:
|
10
|
-
name: red
|
11
|
-
bold: true
|
1
|
+
runner: console
|
2
|
+
console_options:
|
3
|
+
color_scheme: normal
|
4
|
+
color_schemes:
|
5
|
+
normal:
|
6
|
+
success:
|
7
|
+
name: green
|
8
|
+
bold: true
|
9
|
+
failure:
|
10
|
+
name: red
|
11
|
+
bold: true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dvdvrconv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- icm7216
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description: This tool converts "
|
41
|
+
description: This tool converts "vro" file on DVD-VR format disc to "mp4" files.
|
42
42
|
email:
|
43
43
|
- icm7216d@gmail.com
|
44
44
|
executables:
|
@@ -61,8 +61,8 @@ files:
|
|
61
61
|
- lib/dvdvrconv/dvdvr.rb
|
62
62
|
- lib/dvdvrconv/options.rb
|
63
63
|
- lib/dvdvrconv/version.rb
|
64
|
-
- sample_default_dvdvrconv.
|
65
|
-
- sample_my.
|
64
|
+
- sample_default_dvdvrconv.yml
|
65
|
+
- sample_my.yml
|
66
66
|
- test-unit.yml
|
67
67
|
- win/cygiconv-2.dll
|
68
68
|
- win/cygwin1.dll
|
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
|
-
rubygems_version: 3.
|
89
|
+
rubygems_version: 3.2.17
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: DVD-VR utility
|