sensible-cinema 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,13 +1,14 @@
1
- Sensible-cinema is a program that aims to allow you to do arbitrary scene selection (i.e. "mute out" or "bleep out" bad scenes).
1
+ Sensible-cinema is a program that allows you to do edit-decision-list scene selection (i.e. "mute out"
2
+ or "bleep out" bad scenes) on arbitrary players like netflix online, vlc.
2
3
 
3
4
  Currently it takes as input a list of known "skip-worthy" scenes (profanity, violence, annoying songs, whatever you don't like).
4
- It then tracks the player you are using, as it is playing, and mutes or blanks out the system screen appropriately, during the scenes
5
- specified.
5
+ It then tracks the player you are using, as it is playing, and mutes or blanks out the system screen appropriately,
6
+ during the scenes specified.
6
7
 
7
- Currently it is known to work for for hulu and VLC playback on windows. It also isn't hard to add new players,
8
- and probably wouldn't be super hard to add more operating systems.
8
+ Currently it is programmed out of the box to work with hulu and VLC player on windows. It isn't hard to
9
+ add new players,and probably wouldn't be super hard to add more operating systems.
9
10
 
10
- The concept isn't new: http://en.wikipedia.org/wiki/Edit_decision_list
11
+ The concept isn't all that novel: http://en.wikipedia.org/wiki/Edit_decision_list
11
12
 
12
13
  == How to use ==
13
14
 
@@ -25,8 +26,8 @@ You could also specify those two filenames on the command-line, if desired, like
25
26
  Sensible-cinema will now run in your console window, screen tracking the player's timer to monitor the playback position
26
27
  and react appropriately.
27
28
 
28
- You'll know that it's working if, when you change the time of your player (ex: dragging it to a new spot in the playback),
29
- the screen output in sensible-cinema's console should change to match the new time.
29
+ You'll know that it's working if, when you change the time of your player (ex: dragging it to a new spot
30
+ in the playback), the screen output in sensible-cinema's console should change to match the new time.
30
31
 
31
32
  It is presumed that you'll then minimize the console window and enjoy the movie.
32
33
 
@@ -48,59 +49,68 @@ choosing the hulu player.
48
49
 
49
50
  It will proceed do a few "demo" mutes and blank outs.
50
51
 
51
- == How to Program ==
52
+ == Programming Your Own Scene List ==
52
53
 
53
- To program sensible-cinema to play what you'd like, first "preview" the on-computer movie you'd like to create a scene-list for.
54
- As questionable scenes occur, jot down their start and end times somewhere.
55
- Then create an Edit Decision List (EDL) file that looks like this:
54
+ To program sensible-cinema, your job is to create an edit decision list it can use.
55
+
56
+ An Edit Decision List (EDL) looks something like this trivial example:
56
57
 
57
58
  mutes:
58
- "00:01:01.5" : "00:01:02.5" # mute from one minute, one second and a half to one minute, two seconds and a half
59
59
  "01:00:00" : "01:01:02.5" # mute from exactly one hour to one hour, one minute, two seconds and a half will be muted.
60
+ "01:00:00" : "01:01:02.5" # mute from exactly one hour to one hour, one minute, two seconds and a half will be muted.
60
61
  blank_outs:
61
- "00:15" : "00:18" # sultry scene from seconds 15 to 18 will be blanked out.
62
- "01:00:00" : "01:01:02.5" # also blank out on of the muted scenes.
62
+ "01:00:00" : "01:01:02.5" # also blank out (overlay with blank window) the same.
63
63
 
64
- ...
64
+ Here's one with more detail
65
65
 
66
- Here's an example with more detail
67
66
  http://github.com/rdp/sensible-cinema/blob/master/zamples/scene_lists/example_scene_list.yml
68
67
 
69
- Now save that file somewhere (I tend to save it with a .yml extension--you don't have to--.txt will do)
70
- and remember where you saved it.
68
+ Basically your job is to save an appropriate file like that somewhere,
69
+ then start sensible-cinema and instruct it to use your new file.
70
+
71
+ To create it, basically you notice something you want to add to the list, add it, then go back a few seconds
72
+ in your media player, and it should now be muted/blanked out automatically.
73
+
74
+ So here is a way to create your scene list.
75
+ First create a new file [2], and select it in sensible-cinema (even though it's still blank).
76
+ Now select the new file you just created as your scene list.
77
+ Now "preview" the movie, and as we do, we're going to add to the file, and test our additions.
78
+ As you watch and hit a questionable scene, go back to several seconds before it using your player's
79
+ controls. When you run into it again, just before and just after the scene,
80
+ hit the space bar *in the sensible-cinema window*. Hitting the space bar outputs the current playback time.
81
+ You should now have two reasonably accurate "timestamps" displayed.
82
+ If they look reasonable, add them to your scene list (changes will be automatically picked up),
83
+ then review your additions by rewinding your player and letting it play through the scene in question again.
84
+ It should now skip it appropriately. If not, adjust your timestamps and try again.
71
85
 
72
- Now start sensible-cinema, see above, and browse to wherever you file is (the "home" icon might be useful to you), and
73
- select it for your scene list. Also restart the movie.
74
86
 
75
- Sensible-cinema will now use it as the edit decision list for the movie
76
- as it plays it back. You could probably re-watch the movie and see if you got the timings right. A good excuse to
77
- watch movies, what could be better?
87
+ Once you're done then you can contribute your scene list if desired, to the project [1].
78
88
 
79
- Note also that don't have to watch the whole movie twice. You can create and test the scene list file on the fly.
80
- To do so, first create a blank file, and choose it in sensible-cinema (even though it's blank).
81
- Now "as you watch" the movie, you can edit the file, and any new changes should be picked up automatically.
82
- So you could basically notice something you want to add to the list, add it to the file, then go back a few seconds in your
83
- media player, and it should now be muted/blanked out automatically.
89
+ [1] http://github.com/rdp/sensible-cinema/issues
90
+ [2] The easiest way to do this is to start sensible-cinema, then instead of choosing an existing file,
91
+ right click and choose "New -> Text Document" Now rename it (leaving it as .txt).
92
+ "Right click -> Open" to open it in an editor. Now also select that same file in sensible-cinema.
93
+ Another easy way is to "right drag" an existing file then rename it and edit that one.
84
94
 
85
95
  == FAQ ==
86
96
 
87
97
  Q. Can I watch movies this way on my TV, not just on my computer?
88
98
 
89
- A. Not yet. Well maybe. Currently you'll either need to attach your computer to your TV
90
- (buy some long cables, or a new graphics card, etc.)
91
- or get some other computer that you can move closer to the TV and do the same (ex: buy a used older laptop with s-video out).
92
- I'd be happy to do a linux port of sensible-cinema if anybody needs that for their dedicated TV computer.
93
- There has also been some work toward getting your computer to stream what it plays "live" to your wii/ps3/xbox.
94
- github message me if you're interested in trying it out.
99
+ A. Not yet. And maybe. Currently you'll either need to attach your computer to your TV
100
+ (buy some long cables, or a new graphics card, etc.) or get some computer that you can move closer to the TV and do the same
101
+ (ex: buy a used older laptop with s-video out, use that).
102
+ I'd be happy to do a linux port of sensible-cinema if anybody requests it for their dedicated TV computer.
103
+ There has also been some work toward getting your computer to stream "live" to your wii/ps3/xbox.
104
+ github message me if you're interested in trying it out!
95
105
 
96
106
  Q. What movies are available to watch online?
97
107
 
98
- A. Not many are available free (hulu, youtube have a few), but Netflix has quite a few. Plus you can watch your DVD's
99
- on your computer monitor, or rent or borrow them.
108
+ A. Not many are available free (hulu, youtube have a few), but Netflix has quite a few for its default subscription.
109
+ Plus you can watch your existing DVD's on your computer, or rent or borrow them and watch them there.
100
110
 
101
111
  Q. Why does my mouse bounce up and down while this thing is playing?
102
112
 
103
- A. This enables you to keep your on screen tracker visible, which allows sensible-cinema to track where you're at.
104
- Message me if this bugs you too much and we'll see what we can do for it.
113
+ A. This enables your player to keep its on-screen time tracker, which in turn allows sensible-cinema to track where
114
+ you're at. Message me if this bugs you too much and we'll see what we can do for it.
105
115
 
106
116
  Q. Why does it seem really laggy at screen detection at the beginning?
107
117
 
@@ -113,10 +123,16 @@ Made programming this actually somewhat a pleasure.
113
123
 
114
124
  == License ==
115
125
 
116
- See the LICENSE for licensing, usage terms (gplv3).
126
+ See the LICENSE file for licensing, usage terms (gplv3).
127
+
128
+ == Related ==
129
+
130
+ http://imdb.com (click on "parent's guide") and http://kids-in-mind.com are two sites that tend to have
131
+ reasonably good lists of what all goes on in a movie
117
132
 
118
133
  == Feedback ==
119
134
 
120
135
  Feedback, including feature requests, welcome.
136
+
121
137
  http://github.com/rdp/sensible-cinema
122
138
  http://github.com/rdp me
data/TODO CHANGED
@@ -8,7 +8,10 @@
8
8
  == raw backlog ... based on user request.. ==
9
9
 
10
10
  remember: just local files for my own needs...
11
+ utube nuki
12
+ generations profanidade
11
13
 
14
+ screencast
12
15
  bundle fewer imagemagick binaries
13
16
 
14
17
  "do" star trek generations hulu scene list
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.2
1
+ 0.7.3
data/lib/overlayer.rb CHANGED
@@ -25,30 +25,32 @@ class OverLayer
25
25
  def mute!
26
26
  @am_muted = true
27
27
  puts 'muting!' if $VERBOSE
28
- Muter.mute! unless $DEBUG
28
+ Muter.mute!
29
29
  end
30
30
 
31
31
  def unmute!
32
32
  @am_muted = false
33
33
  puts 'unmuting!' if $VERBOSE
34
- Muter.unmute! unless $DEBUG
34
+ Muter.unmute!
35
35
  end
36
36
 
37
37
  def blank!
38
38
  @am_blanked = true
39
- Blanker.blank_full_screen! unless $DEBUG
39
+ Blanker.blank_full_screen!
40
40
  end
41
41
 
42
42
  def unblank!
43
43
  @am_blanked = false
44
- Blanker.unblank_full_screen! unless $DEBUG
44
+ Blanker.unblank_full_screen!
45
45
  end
46
46
 
47
47
  def check_reload_yaml
48
- current_mtime = File.stat(@filename).mtime # save 0.0002!
48
+ current_mtime = File.stat(@filename).mtime
49
49
  if @file_mtime != current_mtime
50
50
  reload_yaml!
51
51
  @file_mtime = current_mtime
52
+ else
53
+ p 'same mtime:', @file_mtime if $DEBUG && $VERBOSE
52
54
  end
53
55
  end
54
56
 
@@ -203,7 +205,7 @@ class OverLayer
203
205
  p 'set debug to', $DEBUG
204
206
  return
205
207
  when ' ' then
206
- puts cur_time
208
+ puts cur_english_time
207
209
  return
208
210
  when 'r' then
209
211
  reload_yaml!
@@ -320,7 +322,6 @@ class OverLayer
320
322
  pps 'sleeping until next action (%s) begins in %fs (%f) %f' % [next_point, time_till_next_mute_starts, Time.now_f, cur_time] if $VERBOSE
321
323
 
322
324
  @cv.wait(@mutex, time_till_next_mute_starts) if time_till_next_mute_starts > 0
323
- pps 'just woke up from pre-mute wait at', Time.now_f if $VERBOSE
324
325
  set_states!
325
326
  }
326
327
  }
@@ -109,6 +109,17 @@ class ScreenTracker
109
109
  current = get_bmp
110
110
  if current != original
111
111
  if @digits
112
+ return attempt_to_get_time_from_screen
113
+ else
114
+ puts 'screen time change only detected...' if $VERBOSE
115
+ end
116
+ return
117
+ end
118
+ sleep 0.02
119
+ }
120
+ end
121
+
122
+ def attempt_to_get_time_from_screen
112
123
  out = {}
113
124
  dump_digits if $DEBUG
114
125
  digits = get_digits_as_bitmaps # 0.08s [!] not too accurate...
@@ -123,8 +134,12 @@ class ScreenTracker
123
134
  p 'unable to identify digit!' + type.to_s + @a.to_s
124
135
  File.binwrite("bad_digit#{@a}#{type}.bmp", digits[type])
125
136
  end
126
- # early return
127
- return
137
+ if type == :hours
138
+ digit = 0 # this one can fail in VLC
139
+ else
140
+ # early return
141
+ return
142
+ end
128
143
  end
129
144
  out[type] = digit
130
145
  else
@@ -136,15 +151,8 @@ class ScreenTracker
136
151
  p 'got new screen time ' + out + " delta:" + (Time.now - start).to_s if $VERBOSE
137
152
  # if the window was in the background it will be all zeroes, so nil it out
138
153
  out = nil unless out =~ /[1-9]/
139
- return out, Time.now - start
140
- else
141
- puts 'screen time change only detected...' if $VERBOSE
154
+ return out, Time.now-start
142
155
  end
143
- return
144
- end
145
- sleep 0.02
146
- }
147
- end
148
156
 
149
157
  def process_forever_in_thread
150
158
  Thread.new {
@@ -165,13 +165,23 @@ describe ScreenTracker do
165
165
  end
166
166
 
167
167
  it "should use OCR against the changes appropriately" do
168
- output = @a.wait_till_next_change
168
+ output = @a.wait_till_next_change # grab a real change
169
169
  output[0].should be_a(String)
170
- output[0].should include("00:0")# let's hope it runs quickly...
170
+ output[0].should include("00:0") # let's hope it runs quickly...
171
171
  output[0].should match(/[1-9]/)
172
+ output[1].should be_a Float
172
173
  end
173
-
174
- context "with an OCR that can change from hour to minutes during ads" do
174
+
175
+ it "should be ok with a failed hours read" do
176
+ @a.stub!(:get_digits_as_bitmaps) do
177
+ four = File.binread('images/4.bmp')
178
+ {:minute_tens=>four,:second_tens => four, :second_ones => four, :minute_ones => four,
179
+ :hours => File.binread('images/black.bmp')}
180
+ end
181
+ @a.attempt_to_get_time_from_screen[0].should == "0:44:44"
182
+ end
183
+
184
+ context "with an OCR that can change from hour to minutes during ads" do
175
185
  it "should ocr slash...[in other]"
176
186
  it "with VLC should be able to recognize when it goes past an hour somehow...probably by presence of hourly colon" # might already do this
177
187
  end
@@ -4,6 +4,7 @@ x: 522
4
4
  y: 47
5
5
  width: 35
6
6
  height: 14
7
+ note: this does not work for a maximized window, but does for full screen (double click)
7
8
  digits:
8
9
  :hours:
9
10
  - -89
@@ -0,0 +1,22 @@
1
+ name: VLC media player
2
+ x: -90
3
+ y : -15
4
+ width: 44
5
+ height: 11
6
+ note: does not work if VLC is maximized, must be in a window
7
+ digits:
8
+ :hours:
9
+ - -108
10
+ - 8
11
+ :minute_tens:
12
+ - -97
13
+ - 6
14
+ :minute_ones:
15
+ - -91
16
+ - 7
17
+ :second_tens:
18
+ - -81
19
+ - 6
20
+ :second_ones:
21
+ - -76
22
+ - 7
@@ -1,19 +1,20 @@
1
- title: Forever Strong
2
- source: Hulu
3
- version: 0.4.8
4
- mutes:
5
- 2.0 : 3.0 # comments can go after the # on each line
6
- 4.0 : 5.0 # mute from second 4 to second 5
7
- 9.0 : 13.0 # mute from second 9 to second 13
8
- 44.0 : 50.0 # mute for 6 seconds starting at second 44
9
- # This next means mute from one minute to one minute one second
10
- 1:00 : 1:01
11
- 10:01 : 10:02 # mute from ten minutes, one second to ten minutes, 2 seconds
12
- # if you use decimals, you'll have to put them in quotes
13
- # 01:01:01.05 (for one hour, one minute, one second and a half) does not work
14
- # "01:01:01.05" does
15
- "01:01:00.5" : "01:01:01.5" # mute from one hour one minute and a half second to one hour one minute and 1.5s
16
-
17
- blank_outs:
18
- "00:15" : "00:18" # blank from second 15 to 18
19
- 01:01 : "01:02.0" # blank from one minute one second to one minute two seconds, etc.
1
+ # comments can go after the # on each line
2
+ title: Forever Strong
3
+ source: Hulu # these aren't required fields -- mutes and blank_outs are
4
+ mutes:
5
+ 2.0 : 3.0
6
+ 4.0 : 5.0 # mute from second 4 to second 5
7
+ 9.0 : 13.0 # mute from second 9 to second 13
8
+ 44.0 : 50.0 # mute for 6 seconds starting at second 44
9
+ # This next means mute from one minute to one minute one second
10
+ 1:00 : 1:01
11
+ 10:01 : 10:02 # mute from ten minutes, one second to ten minutes, 2 seconds
12
+ # if you use decimals, you'll have to put them in quotes
13
+ # 01:01:01.05 (for one hour, one minute, one second and a half) does not work
14
+ # "01:01:01.05" does
15
+ "01:01:00.5" : "01:01:01.5" # mute from one hour one minute and a half second to one hour one minute and 1.5s
16
+
17
+ blank_outs:
18
+ "00:15" : "00:18" # blank from second 15 to 18
19
+ 01:01 : "01:02.0" # blank from one minute one second to one minute two seconds, etc.
20
+ 1:00:00 : 1:00:30 # note also that if you blank something out it isn't muted unless you *also* add it to the mute list, above. Message me if you want that changed.
@@ -1,7 +1,12 @@
1
1
  title: Happy Feet
2
- source: VLC DVD
2
+ source: DVD (VLC)
3
3
  mutes:
4
- # one hour one minute and a half second to one hour one minute and 1.5s
5
- "01:33:25.0" : "01:33:50.0"
4
+ 1:45 : 2:25 # sensuality: let's talk about eggs, baby...
5
+ 34:44 : 34:47 # "kiss our bums"
6
+ "46:33.5" : 46:41 # sensuality: my couch of perpetual indulgence
7
+ "01:33:21.0" : "01:33:50.0" # sensuality: a few sensual lyrics
6
8
  blank_outs:
7
- "55:35" : "55:42.0" # blank from one minute one second to one minute two seconds
9
+ "55:35" : "55:42.0" # sensuality: some "questionable" dancing
10
+
11
+ the good: "fun graphics, lots of varied, fun music"
12
+ the bad: bit of a liberal agenda
@@ -0,0 +1,9 @@
1
+ source: "hulu"
2
+ mutes:
3
+ # these aren't actually accurate yet, except for Data's one
4
+ # oh my ... at beginning
5
+ 08:54.5 : 08:56 # what the he...
6
+ 10:46.5 : 10:48 # durn
7
+ 11:21 : 11:24.5 # the he...
8
+ 19:45 : 19:50 # religious "...have mercy"
9
+ "01:15:38.5" : "01:15:41.5" # Data "oh s...."
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 2
9
- version: 0.7.2
8
+ - 3
9
+ version: 0.7.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Roger Pack
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-07 00:00:00 -06:00
17
+ date: 2010-08-09 00:00:00 -06:00
18
18
  default_executable: sensible-cinema
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -191,21 +191,23 @@ files:
191
191
  - vendor/imagemagick/msvcp90.dll
192
192
  - vendor/imagemagick/msvcr90.dll
193
193
  - vendor/imagemagick/vcomp90.dll
194
- - zamples/players/captures/hulu full screen non hour.jpg
195
- - zamples/players/captures/hulu full screen over hour.jpg
196
- - zamples/players/captures/silence.bmp
197
- - zamples/players/captures/vlc grab over one hour file over one hour play.bmp
198
- - zamples/players/captures/vlc2.bmp
199
- - zamples/players/captures/vlc_full_screen_slider under one hour.bmp
200
- - zamples/players/captures/youtube full screen big screen.jpg
201
194
  - zamples/players/how_to_create_a_new_player_description.txt
202
195
  - zamples/players/hulu_full_screen_total_length_over_an_hour.yml
196
+ - zamples/players/sample_snapshots/hulu full screen non hour.jpg
197
+ - zamples/players/sample_snapshots/hulu full screen over hour.jpg
198
+ - zamples/players/sample_snapshots/silence.bmp
199
+ - zamples/players/sample_snapshots/utube.JPG
200
+ - zamples/players/sample_snapshots/vlc grab over one hour file over one hour play.bmp
201
+ - zamples/players/sample_snapshots/vlc2.bmp
202
+ - zamples/players/sample_snapshots/vlc_full_screen_slider under one hour.bmp
203
+ - zamples/players/sample_snapshots/youtube full screen big screen.jpg
203
204
  - zamples/players/vlc_full_screened_total_length_over_an_hour.yml
205
+ - zamples/players/vlc_non_full_screened_and_total_length_over_an_hour.yml
204
206
  - zamples/players/vlc_non_full_screened_and_total_length_under_an_hour.yml
205
207
  - zamples/scene_lists/disney_cars.yml
206
208
  - zamples/scene_lists/example_scene_list.yml
207
209
  - zamples/scene_lists/happy_feet_dvd.yml
208
- - zamples/scene_lists/star_trek_generations.yml
210
+ - zamples/scene_lists/star_trek_generations_hulu.yml
209
211
  has_rdoc: true
210
212
  homepage: http://github.com/rdp
211
213
  licenses: []
@@ -1,8 +0,0 @@
1
- source: "hulu"
2
- mutes:
3
- # these aren't actually accurate yet, except for Data's one
4
- 08:55 : 08:56 # what the he...
5
- 10:50 : 10:51 # durn
6
- 11:23 : "11:24" # ?
7
- "01:15:39.5" : "01:15:41.5" # Data "oh s...."
8
- # two onyx at beginning