Ejemplo n.º 1
0
    def test_multi_edit_events(self):
        with open("tests/edls/TEST.edl", 'r') as f:
            edl = pycmx.parse_cmx3600(f)
            events = list(edl.events)

            self.assertEqual(events[42].number, 43)
            self.assertEqual(len(events[42].edits), 2)

            self.assertEqual(events[42].edits[0].source, "TC_R1_V1")
            self.assertEqual(events[42].edits[0].clip_name,
                             "TC R1 V1.2 TEMP1 FX ST.WAV")
            self.assertEqual(events[42].edits[0].source_in, "00:00:00:00")
            self.assertEqual(events[42].edits[0].source_out, "00:00:00:00")
            self.assertEqual(events[42].edits[0].record_in, "01:08:56:09")
            self.assertEqual(events[42].edits[0].record_out, "01:08:56:09")
            self.assertTrue(
                events[42].edits[0].transition.kind == pycmx.Transition.Cut)

            self.assertEqual(events[42].edits[1].source, "TC_R1_V6")
            self.assertEqual(events[42].edits[1].clip_name,
                             "TC R1 V6 TEMP2 ST FX.WAV")
            self.assertEqual(events[42].edits[1].source_in, "00:00:00:00")
            self.assertEqual(events[42].edits[1].source_out, "00:00:00:00")
            self.assertEqual(events[42].edits[1].record_in, "01:08:56:09")
            self.assertEqual(events[42].edits[1].record_out, "01:08:56:11")
            self.assertTrue(events[42].edits[1].transition.kind ==
                            pycmx.Transition.Dissolve)
Ejemplo n.º 2
0
def scene_list(infile, outfile, out_format, pattern):
    
    edl = pycmx.parse_cmx3600(infile)

    current_scene_name = None
    
    grouped_edits = [ ]

    for edit in all_video_edits(edl):
        this_scene_name = get_scene_name(edit, pattern)
        if this_scene_name is not None:
            if current_scene_name != this_scene_name:
                grouped_edits.append([ ])
                current_scene_name = this_scene_name

            grouped_edits[-1].append(edit)
    
    out_list = [ ]
    for group in grouped_edits:
        out_list.append({ 
            'start': group[0].record_in, 
            'end': group[-1].record_out,
            'scene': get_scene_name(group[0], pattern ) }
            )
    
    if out_format == 'cmx':
        output_cmx(outfile, out_list)
    if out_format == 'cols':
        output_cols(outfile, out_list)
    else:
        log.warning(f"Format {out_format} unrecognized. Will use cmx.\n")
        output_cmx(outfile, out_list)
Ejemplo n.º 3
0
    def test_line_numbers(self):
        with open("tests/edls/ToD_R4_LOCK3.1_030618_Video.edl") as f:
            edl = pycmx.parse_cmx3600(f)

            events = list(edl.events)
            self.assertEqual(events[0].edits[0].line_number, 2)
            self.assertEqual(events[14].edits[0].line_number, 45)
            self.assertEqual(events[180].edits[0].line_number, 544)
Ejemplo n.º 4
0
 def test_event_sanity(self):
     for fn in type(self).files:
         path = "tests/edls/" + fn
         with open(path, 'r') as f:
             edl = pycmx.parse_cmx3600(f)
             for index, event in enumerate(edl.events):
                 self.assertTrue(len(event.edits) > 0)
                 self.assertTrue(event.number == index + 1)
Ejemplo n.º 5
0
 def test_channel_map(self):
     with open("tests/edls/TEST.edl", 'r') as f:
         edl = pycmx.parse_cmx3600(f)
         events = list(edl.events)
         self.assertFalse(events[0].edits[0].channels.video)
         self.assertFalse(events[0].edits[0].channels.a1)
         self.assertTrue(events[0].edits[0].channels.a2)
         self.assertTrue(events[2].edits[0].channels.get_audio_channel(7))
         self.assertTrue(events[2].edits[0].channels.audio)
Ejemplo n.º 6
0
    def test_event_counts(self):

        counts = [287, 466, 250, 376, 120, 3, 466]

        for fn, count in zip(type(self).files, counts):
            with open("tests/edls/" + fn, 'r') as f:
                edl = pycmx.parse_cmx3600(f)
                actual = len(list(edl.events))
                self.assertTrue(
                    actual == count, "expected %i in file %s but found %i" %
                    (count, fn, actual))
Ejemplo n.º 7
0
    def test_events(self):
        with open("tests/edls/TEST.edl", 'r') as f:
            edl = pycmx.parse_cmx3600(f)
            events = list(edl.events)

            self.assertEqual(events[0].number, 1)
            self.assertEqual(events[0].edits[0].source, "OY_HEAD_")
            self.assertEqual(events[0].edits[0].clip_name, "HEAD LEADER MONO")
            self.assertEqual(events[0].edits[0].source_file,
                             "OY_HEAD_LEADER.MOV")
            self.assertEqual(events[0].edits[0].source_in, "00:00:00:00")
            self.assertEqual(events[0].edits[0].source_out, "00:00:00:00")
            self.assertEqual(events[0].edits[0].record_in, "01:00:00:00")
            self.assertEqual(events[0].edits[0].record_out, "01:00:08:00")
            self.assertTrue(
                events[0].edits[0].transition.kind == pycmx.Transition.Cut)
Ejemplo n.º 8
0
 def test_list_sanity(self):
     for fn in type(self).files:
         with open("tests/edls/" + fn, 'r') as f:
             edl = pycmx.parse_cmx3600(f)
             self.assertTrue(type(edl.title) is str)
             self.assertTrue(len(edl.title) > 0)
Ejemplo n.º 9
0
 def test_transition_name(self):
     with open("tests/edls/test_25.edl", "r") as f:
         edl = pycmx.parse_cmx3600(f)
         events = list(edl.events)
         self.assertEqual(events[4].edits[1].transition.name,
                          "CROSS DISSOLVE")