sensible-cinema 0.28.1 → 0.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. data/{README → README.TXT} +35 -14
  2. data/Rakefile +49 -41
  3. data/TODO +337 -250
  4. data/VERSION +1 -1
  5. data/bin/sensible-cinema +15 -14
  6. data/bin/sensible-cinema-cli +1 -1
  7. data/business_ideas.txt +8 -0
  8. data/change_log_with_feature_list.txt +198 -1
  9. data/documentation/is_it_legal_to_copy_dvds.txt +44 -30
  10. data/goc.bat +1 -1
  11. data/gpl-2.0.txt +339 -0
  12. data/history_and_related_works_list.txt +37 -33
  13. data/{cone.png → inventionzy_files/cone.png} +0 -0
  14. data/legal_draft +23 -0
  15. data/lib/add_any_bundled_gems_to_load_path.rb +4 -3
  16. data/lib/check_installed_mac.rb +10 -10
  17. data/lib/count_down_timer_jruby_swing.rb +4 -4
  18. data/lib/edl_parser.rb +155 -142
  19. data/lib/extract/dumpstream.bat +1 -0
  20. data/lib/extract/get_init.bat +3 -0
  21. data/lib/extract/pause_early.rb +13 -0
  22. data/lib/gui/base.rb +707 -0
  23. data/lib/gui/create-file.rb +244 -0
  24. data/lib/gui/create.rb +565 -0
  25. data/lib/gui/dependencies.rb +177 -0
  26. data/lib/gui/normal.rb +190 -0
  27. data/lib/gui/{sensible-cinema-upconvert.rb → upconvert.rb} +33 -14
  28. data/lib/keyboard_input.rb +0 -2
  29. data/lib/mencoder_wrapper.rb +8 -3
  30. data/lib/movie_hasher.rb +27 -0
  31. data/lib/mplayer_edl.rb +1 -0
  32. data/lib/subtitle_profanity_finder.rb +141 -103
  33. data/lib/vlc_programmer.rb +1 -1
  34. data/lib/zoom_player_max_edl.rb +50 -0
  35. data/{developer_how_to_contribute_to_the_project.txt → notes_for_potential_developers.txt} +18 -11
  36. data/roadmap_possibilities +12 -0
  37. data/spec/arse.srt +6 -1
  38. data/spec/dragon.srt +3 -0
  39. data/spec/edl_parser.spec.rb +57 -52
  40. data/spec/mencoder_wrapper.spec.rb +26 -19
  41. data/spec/mplayer_edl.spec.rb +40 -10
  42. data/spec/notes +3043 -9
  43. data/spec/sensible_cinema_gui.spec.rb +8 -3
  44. data/spec/subtitle_profanity_finder.spec.rb +91 -36
  45. data/spec/zoom_player_max_edl.spec.rb +29 -0
  46. data/template_bats/README_DISTRO.TXT +3 -1
  47. data/template_bats/RUN SENSIBLE CINEMA CLICK HERE WINDOWS.bat +25 -0
  48. data/template_bats/mac/RUN SENSIBLE CINEMA CLICK HERE.command +2 -1
  49. data/template_bats/mac/advanced--create or edit sensible cinema edit list files.command +2 -1
  50. data/template_bats/mac/advanced--run-upconverting-video-player.command +2 -1
  51. data/template_bats/pc/advanced--create or edit sensible cinema edit list files.bat +2 -0
  52. data/template_bats/pc/advanced--run-upconverting-video-player.bat +2 -0
  53. data/todo.inventionzy.txt +69 -2
  54. data/todo.propaganda +34 -10
  55. data/todo.upconvert +8 -1
  56. data/{upconvert_netflix/latest2 → upconvert_from_screen}/go_upscaling.bat +0 -0
  57. data/{also_see_rogerdpack_youtube_account_and_sourceforge_files_movies_account → upconvert_from_screen/go_upscaling_works} +0 -0
  58. data/{upconvert_netflix → upconvert_from_screen/old}/latest2/combine_video.avs +0 -0
  59. data/{upconvert_netflix → upconvert_from_screen/old}/latest2/go_no_upscaling.bat +0 -0
  60. data/upconvert_from_screen/old/latest2/go_upscaling.bat +12 -0
  61. data/{upconvert_netflix → upconvert_from_screen/old}/latest2/push2.GRF +0 -0
  62. data/upconvert_from_screen/old/latest2/push3.grf +0 -0
  63. data/{upconvert_netflix → upconvert_from_screen/old}/latest2/setup_capture_coords.rb +0 -0
  64. data/{upconvert_netflix → upconvert_from_screen/old}/latest2/setup_directshow_filter_params.rb +0 -0
  65. data/{upconvert_netflix → upconvert_from_screen/old}/latest2/upconvert_from_screen_me2.avs +1 -1
  66. data/{upconvert_netflix → upconvert_from_screen}/old/latest_now_possibly_oudated/push2.GRF +0 -0
  67. data/{upconvert_netflix → upconvert_from_screen}/old/latest_now_possibly_oudated/upconvert_from_screen_me2.avs +0 -0
  68. data/{upconvert_netflix → upconvert_from_screen}/old/position_window.png +0 -0
  69. data/{upconvert_netflix → upconvert_from_screen}/old/push_source_desktop.GRF +0 -0
  70. data/{upconvert_netflix → upconvert_from_screen/old}/record_screen/record.bat +0 -0
  71. data/{upconvert_netflix → upconvert_from_screen}/old/upconvert_from_screen.avs +0 -0
  72. data/{upconvert_netflix → upconvert_from_screen}/old/upconvert_from_screen_me.avs +0 -0
  73. data/{upconvert_netflix → upconvert_from_screen}/old/upconvert_from_screen_me2.avs +0 -0
  74. data/{upconvert_netflix → upconvert_from_screen}/old/upconvert_from_screen_me_push_source.avs +0 -0
  75. data/{upconvert_netflix → upconvert_from_screen}/old/uscreen.GRF +0 -0
  76. data/{upconvert_netflix → upconvert_from_screen}/old/uscreen_me.GRF +0 -0
  77. data/upconvert_from_screen/push3.grf +0 -0
  78. data/upconvert_from_screen/upconvert_from_screen_me2.avs +19 -0
  79. data/vendor/mplayer_patches/apply.bat +12 -0
  80. data/vendor/{rdp-win32screenshot-0.0.9/RDP_BRANCH_HAS_MASTER_WITH_CORRECT_VERSION_NUMBER → mplayer_patches/configure_from_betterlogic} +0 -0
  81. data/vendor/mplayer_patches/libdvdnav/2905259c3b45529b3d8dedba572b6e4f67a2d8f4.diff +19 -0
  82. data/vendor/mplayer_patches/libdvdnav/83f1c9256f500285e46f1e44bcc74ffce90159db.diff +16 -0
  83. data/vendor/mplayer_patches/libdvdnav/eb91fb74680d30322461a1b9e425918ad4e2b2df.diff +21 -0
  84. data/vendor/mplayer_patches/libdvdnav/jump_to_time.diff +654 -0
  85. data/vendor/mplayer_patches/libdvdnav/non_strict.diff +13 -0
  86. data/vendor/mplayer_patches/mplayer_edl.diff +354 -0
  87. data/vendor/mplayer_patches/port_dir/PortIndex.quick +2 -0
  88. data/vendor/mplayer_patches/port_dir/how_to +13 -0
  89. data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/Portfile +300 -0
  90. data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/files/configure.x11.patch +20 -0
  91. data/vendor/mplayer_patches/port_dir/multimedia/mplayer-edl/files/llvm-gcc-workaround.patch +11 -0
  92. data/vendor/mplayer_patches/port_dir/multimedia/rdp-projects/Portfile +43 -0
  93. data/vendor/{rdp-win32screenshot-0.0.9/RDP_VERSION_IS_IN_RDP_BRANCH → mplayer_patches/updated_lib_too} +0 -0
  94. data/vendor/{readme.txt → readme.txt.setpriority} +0 -0
  95. data/www/content_editor.html +28 -28
  96. data/www/index.html +6 -1
  97. data/www/upconverting_movie_player.html +13 -3
  98. data/www/youtube_edl/.htaccess +44 -0
  99. data/{inventionzy_files/control_youtube.html → www/youtube_edl/control_youtube.rhtml} +39 -33
  100. data/www/youtube_edl/dispatch.fcgi +25 -0
  101. data/www/youtube_edl/render_edited.rb +25 -0
  102. data/{inventionzy_files/serve.rb → www/youtube_edl/server_this_dir.rb} +0 -0
  103. data/www/youtube_edl/todo +23 -0
  104. data/www/zoomplayer_max.png +0 -0
  105. data/zamples/edit_decision_lists/dvds/Harry Potter 2 chamber of secrets.txt +10 -5
  106. data/zamples/edit_decision_lists/dvds/aladdin.txt +30 -0
  107. data/zamples/edit_decision_lists/dvds/bambi.txt +1 -1
  108. data/zamples/edit_decision_lists/dvds/big_buck_bunny_dvd.txt +2 -0
  109. data/zamples/edit_decision_lists/dvds/bobs_big_plan.txt +2 -2
  110. data/zamples/edit_decision_lists/dvds/cars_2.txt +26 -0
  111. data/zamples/edit_decision_lists/dvds/cars_disney.txt +1 -1
  112. data/zamples/edit_decision_lists/dvds/condor_man_widescreen.txt +22 -0
  113. data/zamples/edit_decision_lists/dvds/court_jester.txt +10 -13
  114. data/zamples/edit_decision_lists/dvds/edls_being_edited/making_marriage_work.txt +15 -0
  115. data/zamples/edit_decision_lists/dvds/edls_being_edited/national_treasure.txt +23 -0
  116. data/zamples/edit_decision_lists/dvds/edls_being_edited/ratatouille.txt +35 -0
  117. data/zamples/edit_decision_lists/dvds/edls_being_edited/the_explorers.txt +49 -0
  118. data/zamples/edit_decision_lists/dvds/finding_neverland.txt +32 -0
  119. data/zamples/edit_decision_lists/dvds/flight_of_the_navigator.txt +22 -16
  120. data/zamples/edit_decision_lists/dvds/harry_potter_3_prisoner_of_azkaban.txt +21 -4
  121. data/zamples/edit_decision_lists/dvds/hitchhiker's_guide_to_the_galaxy.txt +1 -1
  122. data/zamples/edit_decision_lists/dvds/{edls_being_edited/king_of_kings.txt → king_of_kings.txt} +5 -5
  123. data/zamples/edit_decision_lists/dvds/nanny_mcphee.txt +31 -0
  124. data/zamples/edit_decision_lists/dvds/pack_jackson_wedding_2007-03-03.txt +9 -2
  125. data/zamples/edit_decision_lists/dvds/remember_the_titans.txt +35 -0
  126. data/zamples/edit_decision_lists/dvds/sintel_open_source_blender_ntsc_dvd.txt +8 -4
  127. data/zamples/edit_decision_lists/dvds/speed_racer.txt +1 -1
  128. data/zamples/edit_decision_lists/dvds/tangled.txt +21 -0
  129. data/zamples/edit_decision_lists/dvds/tron_legacy.txt +4 -1
  130. data/zamples/edit_decision_lists/files/conference_music_video.txt +10 -0
  131. data/zamples/edit_decision_lists/notes_on_movies_without_edls_yet/tron.txt +10 -0
  132. data/zamples/edit_decision_lists/old_not_yet_updated/example_edit_decision_list.txt +1 -1
  133. metadata +139 -117
  134. data/conclusions +0 -6
  135. data/documentation/how_to_create_your_own_delete_lists.txt +0 -69
  136. data/lib/gui/sensible-cinema-base.rb +0 -620
  137. data/lib/gui/sensible-cinema-create.rb +0 -331
  138. data/lib/gui/sensible-cinema-dependencies.rb +0 -28
  139. data/lib/gui/sensible-cinema-normal.rb +0 -351
  140. data/lib/gui/sensible-cinema-side-by-side.rb +0 -27
  141. data/lib/shutdown_kill.rb +0 -32
  142. data/lib/storage.rb +0 -105
  143. data/ocr.todo_if_need_speed +0 -6
  144. data/upconvert_netflix/record_screen/recording/1.png +0 -0
  145. data/upconvert_netflix/record_screen/recording/10.png +0 -0
  146. data/upconvert_netflix/record_screen/recording/2.png +0 -0
  147. data/upconvert_netflix/record_screen/recording/3.png +0 -0
  148. data/upconvert_netflix/record_screen/recording/4.png +0 -0
  149. data/upconvert_netflix/record_screen/recording/5.png +0 -0
  150. data/upconvert_netflix/record_screen/recording/6.png +0 -0
  151. data/upconvert_netflix/record_screen/recording/7.png +0 -0
  152. data/upconvert_netflix/record_screen/recording/8.png +0 -0
  153. data/upconvert_netflix/record_screen/recording/9.png +0 -0
  154. data/upconvert_netflix/record_screen/recording/d.png +0 -0
  155. data/vendor/monkey.png +0 -0
  156. data/vendor/rdp-win32screenshot-0.0.9/.document +0 -5
  157. data/vendor/rdp-win32screenshot-0.0.9/History.rdoc +0 -53
  158. data/vendor/rdp-win32screenshot-0.0.9/LICENSE +0 -20
  159. data/vendor/rdp-win32screenshot-0.0.9/README.rdoc +0 -95
  160. data/vendor/rdp-win32screenshot-0.0.9/Rakefile +0 -63
  161. data/vendor/rdp-win32screenshot-0.0.9/VERSION +0 -1
  162. data/vendor/rdp-win32screenshot-0.0.9/enumerated +0 -55576
  163. data/vendor/rdp-win32screenshot-0.0.9/lib/aero_offscreen_srccopy_captureblt_doesnt_have_everything.bmp.gz +0 -0
  164. data/vendor/rdp-win32screenshot-0.0.9/lib/enumerate.rb +0 -6
  165. data/vendor/rdp-win32screenshot-0.0.9/lib/firefox.bmp +0 -0
  166. data/vendor/rdp-win32screenshot-0.0.9/lib/normal.bmp +0 -0
  167. data/vendor/rdp-win32screenshot-0.0.9/lib/normal2.bmp +0 -0
  168. data/vendor/rdp-win32screenshot-0.0.9/lib/notes +0 -5
  169. data/vendor/rdp-win32screenshot-0.0.9/lib/snapshot.rb +0 -10
  170. data/vendor/rdp-win32screenshot-0.0.9/lib/srccopy.bmp +0 -0
  171. data/vendor/rdp-win32screenshot-0.0.9/lib/srccopyplus.bmp +0 -0
  172. data/vendor/rdp-win32screenshot-0.0.9/lib/srccopyplusdirectx.bmp +0 -0
  173. data/vendor/rdp-win32screenshot-0.0.9/lib/vc.bmp +0 -0
  174. data/vendor/rdp-win32screenshot-0.0.9/lib/win32/screenshot.rb +0 -95
  175. data/vendor/rdp-win32screenshot-0.0.9/lib/win32/screenshot/bitmap_maker.rb +0 -200
  176. data/vendor/rdp-win32screenshot-0.0.9/lib/win32/util.rb +0 -93
  177. data/vendor/rdp-win32screenshot-0.0.9/spec/spec.opts +0 -1
  178. data/vendor/rdp-win32screenshot-0.0.9/spec/spec_helper.rb +0 -85
  179. data/vendor/rdp-win32screenshot-0.0.9/spec/win32_screenshot_spec.rb +0 -194
  180. data/vendor/rdp-win32screenshot-0.0.9/spec/win32_screenshot_util_spec.rb +0 -75
  181. data/vendor/rdp-win32screenshot-0.0.9/win32screenshot.gemspec +0 -69
  182. data/vendor/tsmuxer_1.10.6/licence.txt +0 -42
  183. data/zamples/edit_decision_lists/dvds/making_marriage_work.txt +0 -15
  184. data/zamples/edit_decision_lists/notes/tron.txt +0 -4
  185. data/zamples/edit_decision_lists/old_not_yet_updated/dvds/making marriage work.txt +0 -9
@@ -4,33 +4,40 @@ You can test the DVD portion of the program out by mounting the DVD of "big buck
4
4
  http://rogerdpack.t28.net/sensible-cinema/releases/dvd_isos has it and a few other creative commons ISO's for use.
5
5
  On windows daemon tools helps there, or "magic ISO" or the like, may be helpful to avoid having to burn disks.
6
6
 
7
- Or you could alternatively burn a copy of big buck bunny to DVD, then use that to test it against (a slightly more cross platform approach).
7
+ Or you could alternatively burn a copy of big buck bunny to DVD, then use that to test it against
8
+ (a slightly more cross platform approach I guess).
8
9
 
9
- Then rip it and use the output.
10
+ Then rip it and use the output, or use it as your DVD.
10
11
 
11
12
  Or if you have a DVD that already has a edit list available for it, you could use that, or create
12
13
  a new edit list for a DVD you own, etc.
13
14
 
14
- The main development roadmap/backlog is in the TODO.
15
15
  If you have any feedback/feature requests, et al, post an
16
16
  issue or post to the Mailing List: http://groups.google.com/group/sensible-cinema
17
17
 
18
- To run it from source, you may need to install a few gem dependencies (listed in the Rakefile)
18
+ To run it from source, download from github, you may need to install a few gem dependencies (listed in the Rakefile)
19
19
 
20
20
  or to install them automatically:
21
-
22
- $ jruby -S gem install sensible-cinema # installs dev. dependencies
23
- Note that, in order to run the unit tests, you'll want to checkout the source from the repository to get all the test images
24
-
25
- The tests are in the spec directory, though some of them are out of date as development has shifted focus to other areas.
21
+ $ jruby -S gem install rake os sane jeweler # some helper gems
22
+ $ jruby -S rake build
23
+ $ jruby -S gem install pkg\*.gem --development
24
+ # optional:
25
+ $ jruby -S gem uninstall -x sensible-cinema # uninstall the gem so you don't have to worry about it conflicting later, just in case.
26
+
27
+ You'll have to install some git submodules, too.
28
+ $ git submodule init
29
+ $ git submodule update
30
+
31
+ The tests are in the spec directory, though some of them are out of date as development has shifted focus to other areas.
26
32
 
27
33
  Note: you transfer (c) of materials to sensible cinema when you submit patches/contributions, of course, so don't submit something you don't want published :)
28
34
 
29
35
  Also you'll need to run git submodule init && git submodule update (possibly modify .gitsubmodules to be the open one, or ask me to)
30
36
 
31
37
  To run it via command line:
38
+
32
39
  $ jruby bin/sensible-cinema --help # tells you all available options
33
-
40
+ $ jruby lib/edl_parser edl_filename.txt # outputs the file, but parsed, and in YAML, useful for porting to other programming languages.
34
41
  Feedback/contribution welcome :)
35
42
 
36
43
  Ex: want JSON'ified output somehow? Just ask.
@@ -38,7 +45,7 @@ Ex: want JSON'ified output somehow? Just ask.
38
45
  == mac os x developers ==
39
46
 
40
47
  You'll have to install a few dependencies. It will tell you which at runtime,
41
- or see the installation instructions: http://rogerdpack.t28.net/sensible-cinema/
48
+ or see the installation instructions: http://rogerdpack.t28.net/sensible-cinema
42
49
 
43
50
  == OCR screen tracker ==
44
51
 
@@ -0,0 +1,12 @@
1
+ create a skype/google+ video recorder
2
+ upconvert DVD
3
+ upconvert Netflix [seems low demand?]
4
+ C EDL possibly never
5
+ netflix/skype "disable screen saver while running" program [?]
6
+ linearize [?] hmm...
7
+ re-update todo/all docu/user feedback etc.
8
+ LLC
9
+ if...back off to just the ffmpeg (plus an "[A,B]" viewer) only...but for now stick with just DVD playback [?] until people want more...
10
+ no propaganda...
11
+ no auto subtitle downloaders...
12
+ fix VLC's use of dvdnav itself +- mplayer DVD EDL
@@ -8,7 +8,7 @@
8
8
 
9
9
  6
10
10
  00:00:55,069 --> 00:00:59,164
11
- <i>at the very end of this line is a realllly bad word
11
+ <i>don't at the very end of this line is a realllly bad word
12
12
 
13
13
  6
14
14
  00:00:55,066 --> 00:00:59,164
@@ -34,3 +34,8 @@ waiting each < /i> < /I>
34
34
  <i>hello
35
35
  shell
36
36
 
37
+ 6
38
+ 00:00:56,070 --> 00:00:59,164
39
+ <i>line_end_full_worddon't forget there is heaven and hell.
40
+ waiting each < /i> < /I>
41
+
@@ -1,6 +1,7 @@
1
1
  1
2
2
  00:00:34,715 --> 00:00:37,047
3
3
  <i>This is Berk.</i>
4
+ <i>This is Berk.</i>
4
5
 
5
6
  2
6
7
  00:00:37,184 --> 00:00:41,587
@@ -15,6 +16,7 @@
15
16
  4
16
17
  00:00:46,460 --> 00:00:50,089
17
18
  <i>My viIIage. In a word, sturdy.</i>
19
+ <i>My viIIage. In a word, sturdy.</i>
18
20
 
19
21
  5
20
22
  00:00:50,230 --> 00:00:54,929
@@ -29,3 +31,4 @@
29
31
  7
30
32
  00:00:59,306 --> 00:01:02,298
31
33
  <i>The onIy probIems are the pests.</i>
34
+ <i>The onIy probIems are the pests.</i>
@@ -18,6 +18,8 @@ This file is part of Sensible Cinema.
18
18
  require File.expand_path(File.dirname(__FILE__) + '/common')
19
19
  require_relative '../lib/edl_parser'
20
20
 
21
+ # MplayerEdl spec also exercises this pretty good...
22
+
21
23
  describe EdlParser do
22
24
 
23
25
  E = EdlParser
@@ -27,22 +29,27 @@ describe EdlParser do
27
29
  end
28
30
 
29
31
  it "should get mutes and blank_outs" do
30
- string = File.read(__DIR__ + "/../zamples/edit_decision_lists/old_not_yet_updated/example_edit_decision_list.txt")
32
+ string = <<-EOL
33
+ "mutes" => [
34
+ "00:00:01", "00:00:02",
35
+ "00:00:01", "00:00:02", "profanity", "dang",
36
+ ],
37
+ "blank_outs" => [
38
+ "01:01:00", "01:02:00", "nudity", "...",
39
+ ],
40
+ "missing_content" => "some stuff"
41
+ EOL
31
42
  expected =
32
43
  {
33
44
  "mutes"=>[["00:00:01", "00:00:02"],
34
- ["00:00:01", "00:00:02", "profanity", "dang"],
35
- ["01:01:00", "01:02:00"]],
36
- "blank_outs"=>[["01:01:00", "01:02:00", "nudity", "..."], ["00:03:03.5", "00:03:04.5"]],
37
- "missing_content"=>"this doesn't list some mild name calling",
38
- "title"=>"Forever Strong", "source"=>"Hulu", "url"=>"http://www.byutv.org/watch/1790-100",
39
- "whatever_else_you_want"=>"this is the old version of the film",
40
- "disk_unique_id"=>"1234|4678"
45
+ ["00:00:01", "00:00:02", "profanity", "dang"]],
46
+ "blank_outs"=>[["01:01:00", "01:02:00", "nudity", "..."], ],
47
+ "missing_content"=>"some stuff",
41
48
  }
42
49
  E.parse_string(string, nil).should == expected
43
50
  end
44
51
 
45
- it "should disallow full digits" do
52
+ it "should disallow full digits only" do
46
53
  proc {E.parse_string(%!"mutes" => ["1234", "1235", "profanity", "yo"]!, nil) }.should raise_exception SyntaxError
47
54
  proc {E.parse_string(%!"mutes" => ["0.0", "1.1", "profanity", "yo"]!, nil) }.should_not raise_exception
48
55
  proc {E.parse_string(%!"mutes" => ["0.0", "1.1", "profanity", "yo", "1234", "1235", "bad entry"]!, nil) }.should raise_exception SyntaxError
@@ -55,12 +62,16 @@ describe EdlParser do
55
62
  end
56
63
 
57
64
  it "should extract digits plus 'stuff' well" do
58
- out = ["1:01", "1:01", "a", "2:01", "2:02", "b"]
65
+ out = ["1:01", "1:01", "a", "2:01", " 2:02", "b"]
59
66
  EdlParser.extract_entry!(out).should == ["1:01", "1:01", "a"]
60
- EdlParser.extract_entry!(out).should == ["2:01", "2:02", "b"]
67
+ EdlParser.extract_entry!(out).should == ["2:01", " 2:02", "b"]
68
+ end
69
+
70
+ it "should parse with spaces ok" do
71
+ EdlParser.translate_string_to_seconds(" 2:02").should == 60*2+2
61
72
  end
62
73
 
63
- it "should raise if the first two aren't digits" do
74
+ it "should raise if the first two aren't digits, which is unexpected" do
64
75
  proc { EdlParser.extract_entry!(["a"])}.should raise_exception(SyntaxError)
65
76
  end
66
77
 
@@ -75,38 +86,39 @@ describe EdlParser do
75
86
 
76
87
  it "should parse a real file" do
77
88
  E.parse_file(File.expand_path(__DIR__) + "/../zamples/edit_decision_lists/dvds/bobs_big_plan.txt").should ==
78
- {"title"=>"Bob's Big Plan", "dvd_title_track"=>1, "other notes"=>"could use more nit-picking of the song, as some parts seem all right in the end", "mutes"=>[["00:03.8", "01:03", "theme song is a bit raucous at times"], ["28:13.5", "29:40", "theme song again"], ["48:46", "49:08", "theme song again"]], "blank_outs"=>[]}
89
+ {"title"=>"Bob's Big Plan", "dvd_title_track"=>1, "other notes"=>"could use more nit-picking of the song, as some parts seem all right in the end", "disk_unique_id"=>"12e77a76|b6e48ce8", "volume_name"=>"BOBS_BIG_PLAN","mutes"=>[["00:03.8", "01:03", "theme song is a bit raucous at times"], ["28:13.5", "29:40", "theme song again"], ["48:46", "49:08", "theme song again"]], "blank_outs"=>[]}
79
90
  end
80
91
 
81
92
  it "should be able to use personal preferences to decide which edits to make" do
82
93
  out = <<-EOL
83
94
  "mutes" => [
84
- "00:10", "00:15", "test category", "1",
85
- "00:20", "00:25", "test category", "2",
86
- "00:30", "00:35", "test category", "3"
95
+ "00:10", "00:15", "test category", "cat1",
96
+ "00:20", "00:25", "test category", "cat2",
97
+ "00:30", "00:35", "test category", "cat3"
87
98
  ]
88
99
  EOL
89
100
  parsed = E.parse_string out, nil
90
101
  parsed["mutes"].length.should == 3 # has all of them
91
102
 
92
103
  1.upto(2) do |n|
93
- parsed = E.parse_string(out, nil, [["test category", n.to_s]] )
104
+ parsed = E.parse_string(out, nil, [["test category", "cat" + n.to_s]] )
94
105
  parsed["mutes"].length.should == 2 # excludes one
95
106
  end
96
- parsed = E.parse_string(out, nil, [["test category", "1"], ["test category", "2"]] )
107
+ parsed = E.parse_string(out, nil, [["test category", "cat1"], ["test category", "cat2"]] )
97
108
  parsed["mutes"].length.should == 1 # excludes two
98
109
 
99
110
  # now with...just saying "this entire category is fine"
100
111
  parsed = E.parse_string(out, nil, [["test category"]])
101
112
  parsed["mutes"].length.should == 0
102
-
103
- # now with...just saying "levels below this are ok"
104
- parsed = E.parse_string(out, nil, [["test category", 2]])
105
- parsed["mutes"].length.should == 2
106
-
113
+
114
+ pending do
115
+ # now with...just saying "levels below this are ok"
116
+ parsed = E.parse_string(out, nil, [["test category", 2]])
117
+ parsed["mutes"].length.should == 2
118
+ end
107
119
  end
108
120
 
109
- it "should parse mplayer_dvd_splits as floats" do
121
+ it "should parse mplayer_dvd_splits as strings" do
110
122
  E.parse_string('"mplayer_dvd_splits" => []', 'fakename')['mplayer_dvd_splits'].should == []
111
123
  E.parse_string('"mplayer_dvd_splits" => ["123.5","124.5"]', 'fakename')['mplayer_dvd_splits'].should == ["123.5","124.5"]
112
124
  end
@@ -135,36 +147,18 @@ describe EdlParser do
135
147
  proc{ go({"mutes"=>{105=>104.9}})}.should raise_error(SyntaxError)
136
148
  end
137
149
 
138
- it "should allow for splits in its parseage" do
139
- go({ "mutes"=>{5=>6,105=>106}, "blank_outs" => {110 => 111} }, 0, 0, [103]).should ==
140
- [[1.0, 4.0, :mute], [5.0, 6.0, :mute], [6.0, 9.0, :blank]]
141
- end
142
-
143
150
  it "should raise on poor overlap" do
144
- proc{go({ "mutes"=>{5=>10, 6=>7}}, 0, 0, [1000])}.should raise_error(/overlap/i)
151
+ proc{go({ "mutes"=>{5=>10, 6=>7}}, 0, 0, [])}.should raise_error(/overlap/i)
145
152
  end
146
153
 
147
- # I put down it at 10:00 it's at 10:00.5
148
- # so...postludingers should be...too early now?
149
- # change when complaints come in :P
150
154
  it "should take the greater of the end and beginning on combined splits and greater of the blank versus mute" do
151
155
  # so if I have a very long mute with a mute in the middle, it should turn into a very long mute
152
- go({ "mutes"=>{5=>10, 103=>107}}, 0, 0, [100]).should == [[2.0, 10.0, :mute]]
153
- go({ "mutes"=>{5=>10, 103=>110}}, 0, 0, [100]).should == [[2.0, 11.0, :mute]]
154
- go({ "mutes"=>{5=>15, 103=>110}}, 0, 0, [100]).should == [[2.0, 15.0, :mute]]
155
- go({ "mutes"=>{5=>10, 103=>111}}, 0, 0, [100]).should == [[2.0, 12.0, :mute]]
156
- # now throw in blanks to the mix...
157
- go({ "mutes"=>{5=>10}, "blank_outs" => {103=>110}}, 0, 0, [100]).should == [[2.0, 11.0, :blank]]
158
- go({ "blank_outs"=>{5=>10}, "mutes" => {103=>110}}, 0, 0, [100]).should == [[2.0, 11.0, :blank]]
159
- end
160
-
161
- it "should accomodate well for multiples, and zero" do
162
- go({ "mutes"=>{5=>10, 75 => 76, 101 => 102}}, 0, 0, [50, 100]).should ==
163
- [[0.0, 4.0, :mute], [5.0, 10.0, :mute], [24.0, 27.0, :mute]]
156
+ go({ "mutes"=>{5=>10, 103=>107}}, 0, 0, []).should == [[5, 10, :mute], [103, 107, :mute]]
157
+
158
+ # and with blanks to the mix...
159
+ go({ "mutes"=>{5=>10}, "blank_outs" => {103=>110}}, 0, 0, []).should == [[5, 10, :mute], [103, 110, :blank]]
164
160
  end
165
161
 
166
- it "should handle edge cases, like where an entry overlaps the divider, or the added stuff causes it to"
167
-
168
162
  def translate x
169
163
  EdlParser.translate_string_to_seconds x
170
164
  end
@@ -191,11 +185,11 @@ describe EdlParser do
191
185
  end
192
186
 
193
187
  it "should translate ints to english timestamps well" do
194
- english(60).should == "01:00"
188
+ english(60).should == "01:00.00"
195
189
  english(60.1).should == "01:00.10"
196
- english(3600).should == "1:00:00"
197
- english(3599).should == "59:59"
198
- english(3660).should == "1:01:00"
190
+ english(3600).should == "1:00:00.00"
191
+ english(3599).should == "59:59.00"
192
+ english(3660).should == "1:01:00.00"
199
193
  english(3660 + 0.1).should == "1:01:00.10"
200
194
  end
201
195
 
@@ -255,7 +249,18 @@ describe EdlParser do
255
249
 
256
250
  it "should download from imdb if specified and merge" do
257
251
  File.binwrite('files/edls/a.txt', %!"imdb_id" => "tt1727587"!)
258
- EdlParser.parse_file('files/edls/a.txt').should == {"blank_outs" => [["0:00:56", "0:00:57"], ["0:01:05", "0:01:14.500"]], "mutes" => [], "imdb_id" => "tt1727587"}
252
+ EdlParser.parse_file('files/edls/a.txt').should == {"blank_outs" => [["0:00:56.00", "0:00:57.00"], ["0:01:05.00", "0:01:14.50"]], "mutes" => [], "imdb_id" => "tt1727587"}
259
253
  end
260
254
 
255
+ it "should be able to convert from 29.97 DVD time to DVDNAV time" do
256
+
257
+ #"dvd_title_track_start_offset" => "0.06",
258
+ #"dvd_nav_packet_offset" => [0.866667, 0.944217],
259
+
260
+ start = [[1.0, 2.0, :blank], [3600, 3601, :mute]]
261
+ endy = EdlParser.convert_to_dvd_nav_times start, 'dvd_start_offset', 0.06, [0.866667, 0.944217], 29.97
262
+ # it should be slightly higher than 1, and slightly less than 3600
263
+ endy.should == [[1.07655099900099900000, 2.07555199800199830000, :blank], [3596.48114640359600000000, 3597.48014740259760000000, :mute]]
264
+ end
265
+
261
266
  end
@@ -34,7 +34,8 @@ describe MencoderWrapper do
34
34
  FileUtils.rm 'to_here.fulli_unedited.tmp.mpg.done' rescue nil
35
35
  FileUtils.rm 'to_here.fulli_unedited.tmp.mpg' rescue nil
36
36
  @a = EdlParser.parse_file "../zamples/edit_decision_lists/dvds/bobs_big_plan.txt"
37
- @out = MencoderWrapper.get_bat_commands @a, "e:\\", 'to_here'
37
+ @a["dvd_start_offset"] = 0
38
+ go
38
39
  end
39
40
 
40
41
  it "should be able to convert" do
@@ -164,13 +165,13 @@ describe MencoderWrapper do
164
165
 
165
166
  it "should accept audio_code" do
166
167
  # for the audio philes, I guess..
167
- settings = {"audio_codec"=>"copy2"}
168
+ settings = {"audio_codec"=>"copy2", 'dvd_start_offset' => 0.0}
168
169
  out = MencoderWrapper.get_bat_commands settings, "e:\\", 'to_here.avi'
169
170
  out.should include("-oac copy2")
170
171
  end
171
172
 
172
173
  def setup
173
- @settings = {"mutes"=>{1=>2, 7=>12}, "blank_outs"=>{"2"=>"3"}}
174
+ @settings = {"mutes"=>{1=>2, 7=>12}, "blank_outs"=>{"2"=>"3"}, "dvd_start_offset" => 0}
174
175
  @out = MencoderWrapper.get_bat_commands @settings, "e:\\", 'to_here.avi'
175
176
  end
176
177
 
@@ -199,30 +200,36 @@ describe MencoderWrapper do
199
200
  @out.scan(/(ffmpeg|mencoder).*to_here.avi.2.avi/).length.should be >= 1
200
201
  end
201
202
 
202
- context 'pinpointing sections' do
203
+ context 'telling it to only go from here to there' do
203
204
  before do
204
- settings = {"mutes"=>{15=>20, 30 => 35}}
205
- @out = MencoderWrapper.get_bat_commands settings, "e:\\", 'to_here.avi', '00:14', '00:25'
205
+ @settings = {"mutes"=>{15=>20, 30 => 35}, "dvd_start_offset" => 0}
206
+ @out2 = MencoderWrapper.get_bat_commands @settings, "e:\\", 'to_here.avi', '00:14', '00:25'
206
207
  end
207
208
 
208
209
  it "should always somewhat grab the whole thing, no endpos" do
209
- @out.should_not match(/mencoder dvd.*endpos/)
210
+ @out2.should_not match(/mencoder dvd.*endpos/)
210
211
  end
211
212
 
212
213
  it "should contain the included subsections" do
213
- @out.should_not include("-t 34.99")
214
- @out.should include("14.0")
215
- @out.should_not include("99999")
216
- @out.should include(" 0 ") # no start at 0 even
217
- @out.should match(/-ss 14.0.*0.999/)
218
- @out.should match(/-ss 15.0.*4.999/)
219
- end
214
+ @out2.should_not include("-t 34.99")
215
+ @out2.should include("14.0")
216
+ @out2.should_not include("99999")
217
+ @out2.should include(" 0 ") # no start at 0 even
218
+ @out2.should match(/-ss 14.0.*0.999/)
219
+ @out2.should match(/-ss 15.0.*4.999/)
220
+ end
220
221
 
221
- it "should allow you to play something even if there's no edit list, just for examination sake" do
222
- setup
223
- proc { MencoderWrapper.get_bat_commands @settings, "e:\\", 'to_here', '00:14', '00:15', "1", false, true}.should raise_error(/unable/)
222
+ it "should allow you to play something even if there's no edit list, just for examination sake" do
223
+ setup
224
+ proc { MencoderWrapper.get_bat_commands @settings, "e:\\", 'to_here', '00:14', '00:15', "1", false, true}.should raise_error(/unable/)
225
+ end
226
+ end
227
+
228
+ it "should allow one to specify some dvd_start_offsets" do
229
+ settings = {"mutes"=>{15=>20, 30 => 35}, "dvd_start_offset" => '0.36'}
230
+ out = MencoderWrapper.get_bat_commands settings, "e:\\", 'to_here.avi'
231
+ out.should match(/-vol 0 -ss 14.64 -t 4.999/) # mute
232
+ out.should match(/-ss 19.64 -t 9.999/) # unmute
224
233
  end
225
-
226
- end
227
234
 
228
235
  end
@@ -24,19 +24,19 @@ describe MplayerEdl do
24
24
  it "should translate verbatim" do
25
25
  a = MplayerEdl.convert_to_edl({ "mutes"=>{105=>145, "46:33.5"=>2801}, "blank_outs" => {6 => 7} } )
26
26
  # 0 for skip, 1 for mute
27
- a.should == <<EOL
27
+ a.should == <<-EOL
28
28
  6.0 7.0 0
29
29
  105.0 145.0 1
30
30
  2793.5 2801.0 1
31
- EOL
31
+ EOL
32
32
  end
33
33
 
34
34
  it "should add to mutes" do
35
35
  a = MplayerEdl.convert_to_edl({ "mutes"=>{105=>106}, "blank_outs" => {110 => 111} }, 1 )
36
- a.should == <<EOL
36
+ a.should == <<-EOL
37
37
  105.0 107.0 1
38
38
  110.0 112.0 0
39
- EOL
39
+ EOL
40
40
  end
41
41
 
42
42
  it "should catch overlaps from additions to mutes" do
@@ -51,20 +51,50 @@ EOL
51
51
 
52
52
  it "should add to beginning and ending of mutes" do
53
53
  a = MplayerEdl.convert_to_edl({ "mutes"=>{105=>106}, "blank_outs" => {110 => 111} }, 1, 1 )
54
- a.should == <<EOL
54
+ a.should == <<-EOL
55
55
  104.0 107.0 1
56
56
  109.0 112.0 0
57
- EOL
57
+ EOL
58
+
59
+ end
58
60
 
61
+ it "should accomodate for unordered sections in some dvd's and order the output" do
62
+ mplayer_dvd_splits = [103]
63
+ a = MplayerEdl.convert_to_edl({ "mutes"=>{5=>6,105=>106}, "blank_outs" => {110 => 111}}, 0, 0, mplayer_dvd_splits )
64
+ a.should == <<-EOL
65
+ 1.0 4.0 1
66
+ 5.0 6.0 1
67
+ 6.0 9.0 0
68
+ EOL
59
69
  end
60
70
 
61
- it "should accomodate for split sections in some dvd's and order the output" do
62
- a = MplayerEdl.convert_to_edl({ "mutes"=>{5=>6,105=>106}, "blank_outs" => {110 => 111}}, 0, 0, [103] )
71
+ it "should use non additive mplayer_dvd_splits" do
72
+ mplayer_dvd_splits = [103, 150]
73
+ a = MplayerEdl.convert_to_edl({ "mutes"=>{5=>6,114=>115}}, 0, 0, mplayer_dvd_splits )
63
74
  a.should == <<-EOL
64
- 2.0 3.0 1
65
75
  5.0 6.0 1
66
- 7.0 8.0 0
76
+ 10.0 13.0 1
67
77
  EOL
68
78
  end
79
+
80
+ it "should combine overlaps" do
81
+ mplayer_dvd_splits = [103, 12]
82
+ a = MplayerEdl.convert_to_edl({ "mutes"=>{5=>6, 105 => 106, 120=>121}}, 0, 0, mplayer_dvd_splits )
83
+ a.should == <<-EOL
84
+ 1.0 8.0 1
85
+ EOL
86
+
87
+ end
88
+
89
+ it "should use non additive mplayer_dvd_splits 2" do
90
+ mplayer_dvd_splits = [103, 47]
91
+ a = MplayerEdl.convert_to_edl({ "mutes"=>{5=>6,124=>125, 185 => 190}}, 0, 0, mplayer_dvd_splits )
92
+ a.should == <<-EOL
93
+ 5.0 6.0 1
94
+ 20.0 23.0 1
95
+ 33.0 42.0 1
96
+ EOL
69
97
 
98
+ end
99
+
70
100
  end