lib/movie_normalizer.rb
#Adds a black screen to the end of videotrack
Adds a black screen to the end of videotrack
Adds a black screen to the end of videotrack
def truncate_end_of_video_track(movie)
    sorted_visuals = movie.visual_sequence.sort
    sorted_audios = movie.audio_sequence.sort
    last_audio = sorted_audios[sorted_audios.length - 1]
    last_visual = sorted_visuals[sorted_visuals.length - 1]
    delta_x = (last_audio.place.milliseconds + last_audio.length) - (last_visual.place.milliseconds + last_visual.length)
    gap_place = (last_visual.place.milliseconds + last_visual.length)
    gap_start = 0
    gap_end = delta_x
    gap = Visual.new("blackness", "nil", gap_start, gap_end, gap_place, true, [], [])
    sorted_visuals << gap
    movie.visual_sequence.visuals = sorted_visuals
  end
def truncate_end_of_video_track ( movie ) sorted_visuals = movie . visual_sequence . sort sorted_audios = movie . audio_sequence . sort last_audio = sorted_audios [ sorted_audios . length - 1 ] last_visual = sorted_visuals [ sorted_visuals . length - 1 ] delta_x = ( last_audio . place . milliseconds + last_audio . length ) - ( last_visual . place . milliseconds + last_visual . length ) gap_place = ( last_visual . place . milliseconds + last_visual . length ) gap_start = 0 gap_end = delta_x gap = Visual . new ( "blackness" , "nil" , gap_start , gap_end , gap_place , true , [ ] , [ ] ) sorted_visuals << gap movie . visual_sequence . visuals = sorted_visuals end
Adds a black screen to the end of videotrack
Adds a black screen to the end of videotrack
#The length of the missing clip
movie
<not_specific>