Beispiel #1
0
 def test_ntsc_attribute_is_working_properly(self):
     """testing if the ntsc attribute is working properly
     """
     r = Rate(ntsc=True)
     self.assertEqual(r.ntsc, True)
     r.ntsc = False
     self.assertEqual(r.ntsc, False)
Beispiel #2
0
 def test_ntsc_attribute_is_working_properly(self):
     """testing if the ntsc attribute is working properly
     """
     r = Rate(ntsc=True)
     self.assertEqual(r.ntsc, True)
     r.ntsc = False
     self.assertEqual(r.ntsc, False)
Beispiel #3
0
 def test_timebase_attribute_is_set_to_None(self):
     """testing if the timebase attribute value will be set to the default
     value if it is set to None
     """
     r = Rate(timebase='25')
     r.timebase = None
     self.assertEqual(r.timebase, '25')
Beispiel #4
0
 def test_timebase_attribute_is_set_to_None(self):
     """testing if the timebase attribute value will be set to the default
     value if it is set to None
     """
     r = Rate(timebase='25')
     r.timebase = None
     self.assertEqual(r.timebase, '25')
Beispiel #5
0
 def test_ntsc_attribute_is_set_to_None(self):
     """testing if the ntsc attribute value will be False if it is set to
     None
     """
     r = Rate(ntsc=True)
     self.assertTrue(r.ntsc)
     r.ntsc = None
     self.assertFalse(r.ntsc)
Beispiel #6
0
 def test_ntsc_attribute_is_set_to_None(self):
     """testing if the ntsc attribute value will be False if it is set to
     None
     """
     r = Rate(ntsc=True)
     self.assertTrue(r.ntsc)
     r.ntsc = None
     self.assertFalse(r.ntsc)
Beispiel #7
0
    def test_to_xml_method_is_working_properly(self):
        """testing if the to_xml() method is working properly
        """
        r = Rate(timebase='25', ntsc=False)
        self.assertEqual(
            r.to_xml(), """<rate>
  <timebase>25</timebase>
  <ntsc>FALSE</ntsc>
</rate>""")
Beispiel #8
0
    def test_timebase_attribute_is_not_a_str(self):
        """testing if a TypeError will be raised when the timebase attribute is
        not set to a str
        """
        r = Rate(timebase='12')
        with self.assertRaises(TypeError) as cm:
            r.timebase = 15

        self.assertEqual(cm.exception.message,
                         'Rate.timebase should be a str, not int')
Beispiel #9
0
    def test_ntsc_attribute_is_set_to_a_non_bool_value(self):
        """testing if a TypeError will be raised when the ntsc attribute is set
        to a non bool value
        """
        r = Rate(ntsc=True)
        with self.assertRaises(TypeError) as cm:
            r.ntsc = 'not a bool value'

        self.assertEqual(str(cm.exception),
                         'Rate.ntsc should be a bool value, not str')
Beispiel #10
0
    def test_to_xml_method_is_working_properly(self):
        """testing if the to_xml() method is working properly
        """
        r = Rate(timebase='25', ntsc=False)
        self.assertEqual(
            r.to_xml(),
            """<rate>
  <timebase>25</timebase>
  <ntsc>FALSE</ntsc>
</rate>"""
        )
Beispiel #11
0
    def test_timebase_attribute_is_not_a_str(self):
        """testing if a TypeError will be raised when the timebase attribute is
        not set to a str
        """
        r = Rate(timebase='12')
        with self.assertRaises(TypeError) as cm:
            r.timebase = 15

        self.assertEqual(
            cm.exception.message,
            'Rate.timebase should be a str, not int'
        )
Beispiel #12
0
    def test_ntsc_attribute_is_set_to_a_non_bool_value(self):
        """testing if a TypeError will be raised when the ntsc attribute is set
        to a non bool value
        """
        r = Rate(ntsc=True)
        with self.assertRaises(TypeError) as cm:
            r.ntsc = 'not a bool value'

        self.assertEqual(
            str(cm.exception),
            'Rate.ntsc should be a bool value, not str'
        )
Beispiel #13
0
    def test_from_xml_method_is_working_properly(self):
        """testing if the from_xml() method is working properly
        """
        r = Rate(timebase='24', ntsc=False)

        from xml.etree import ElementTree
        rate_node = ElementTree.Element('rate')
        timebase_node = ElementTree.SubElement(rate_node, 'timebase')
        timebase_node.text = '25'
        ntsc_node = ElementTree.SubElement(rate_node, 'ntsc')
        ntsc_node.text = 'TRUE'

        r.from_xml(rate_node)

        self.assertEqual(r.timebase, '25')
        self.assertEqual(r.ntsc, True)
Beispiel #14
0
    def test_from_xml_method_is_working_properly(self):
        """testing if the from_xml() method is working properly
        """
        r = Rate(timebase='24', ntsc=False)

        from xml.etree import ElementTree
        rate_node = ElementTree.Element('rate')
        timebase_node = ElementTree.SubElement(rate_node, 'timebase')
        timebase_node.text = '25'
        ntsc_node = ElementTree.SubElement(rate_node, 'ntsc')
        ntsc_node.text = 'TRUE'

        r.from_xml(rate_node)

        self.assertEqual(r.timebase, '25')
        self.assertEqual(r.ntsc, True)
Beispiel #15
0
    def test_ntsc_argument_is_not_a_bool_value(self):
        """testing if a TypeError will be raised when the ntsc argument is not
        a bool
        """
        with self.assertRaises(TypeError) as cm:
            r = Rate(ntsc='not a bool value')

        self.assertEqual(str(cm.exception),
                         'Rate.ntsc should be a bool value, not str')
Beispiel #16
0
    def test_timebase_argument_is_not_a_str_value(self):
        """testing if a TypeError will be raised when the timebase argument is
        not a string value
        """
        with self.assertRaises(TypeError) as cm:
            Rate(timebase=24)

        self.assertEqual(cm.exception.message,
                         'Rate.timebase should be a str, not int')
Beispiel #17
0
 def tst_rate_attribute_is_None(self):
     """testing if the rate attribute can be set to None
     """
     from anima.edit import Rate
     r = Rate(timebase='24', ntsc=False)
     c = Clip(rate=r)
     self.assertIsNotNone(c.rate)
     c.rate = None
     self.assertIsNone(c.rate)
Beispiel #18
0
    def to_xml(self):
        """return an eml version of this edl
        """
        from anima.edit import Sequence, Rate
        s = Sequence(rate=Rate(timebase='24'))
        s.from_edl(self.events)

        # optimize clips
        for track in s.media.video.tracks:
            track.optimize_clips()

        xml_data = s.to_xml()
        return xml_data
Beispiel #19
0
    def test_rate_attribute_is_valid_to_xml_is_working_properly(self):
        """testing if the rate attribute will be included int the xml output if
        it is not None
        """
        f = File()
        f.duration = 34
        f.name = 'shot2'
        f.pathurl = 'file://localhost/home/eoyilmaz/maya/projects/default/data/shot2.mov'

        c = Clip()
        c.id = 'shot2'
        c.start = 1
        c.end = 35
        c.name = 'shot2'
        c.enabled = True
        c.duration = 34
        c.in_ = 0
        c.out = 34
        c.file = f
        c.rate = Rate(timebase='25')

        expected_xml = \
            """<clipitem id="shot2">
  <end>35</end>
  <name>shot2</name>
  <enabled>True</enabled>
  <start>1</start>
  <in>0</in>
  <duration>34</duration>
  <rate>
    <timebase>25</timebase>
    <ntsc>FALSE</ntsc>
  </rate>
  <out>34</out>
  <file id="shot2.mov">
    <duration>34</duration>
    <name>shot2</name>
    <pathurl>file://localhost/home/eoyilmaz/maya/projects/default/data/shot2.mov</pathurl>
  </file>
</clipitem>"""

        self.maxDiff = None
        self.assertEqual(expected_xml, c.to_xml())
Beispiel #20
0
    def test_from_edl_method_is_working_properly(self):
        """testing if the from_edl method will return an anima.previs.Sequence
        instance with proper hierarchy
        """
        # first supply an edl
        from edl import Parser
        p = Parser('24')
        edl_path = os.path.abspath('./test_data/test_v001.edl')

        with open(edl_path) as f:
            edl_list = p.parse(f)

        r = Rate(timebase='24')

        s = Sequence(rate=r)
        s.from_edl(edl_list)

        self.assertEqual('SEQ001_HSNI_003', s.name)

        self.assertEqual(111, s.duration)

        r = s.rate
        self.assertEqual('24', r.timebase)
        self.assertEqual('00:00:00:00', s.timecode)

        m = s.media
        self.assertTrue(isinstance(m, Media))

        v = m.video
        self.assertTrue(isinstance(v, Video))

        t = v.tracks[0]
        self.assertEqual(False, t.locked)
        self.assertEqual(True, t.enabled)

        clips = t.clips
        self.assertEqual(3, len(clips))

        clip1 = clips[0]
        clip2 = clips[1]
        clip3 = clips[2]

        self.assertTrue(isinstance(clip1, Clip))
        self.assertTrue(isinstance(clip2, Clip))
        self.assertTrue(isinstance(clip3, Clip))

        # clip1
        self.assertEqual(34, clip1.duration)
        self.assertEqual(True, clip1.enabled)
        self.assertEqual(35, clip1.end)
        self.assertEqual('SEQ001_HSNI_003_0010_v001', clip1.id)
        self.assertEqual(10, clip1.in_)
        self.assertEqual('SEQ001_HSNI_003_0010_v001', clip1.name)
        self.assertEqual(44, clip1.out)
        self.assertEqual(1, clip1.start)
        self.assertEqual('Video', clip1.type)

        f = clip1.file
        self.assertTrue(isinstance(f, File))
        self.assertEqual(44, f.duration)
        self.assertEqual('SEQ001_HSNI_003_0010_v001', f.name)
        self.assertEqual(
            'file://localhost/tmp/SEQ001_HSNI_003_0010_v001.mov',
            f.pathurl
        )

        # clip2
        self.assertEqual(31, clip2.duration)
        self.assertEqual(True, clip2.enabled)
        self.assertEqual(66, clip2.end)
        self.assertEqual('SEQ001_HSNI_003_0020_v001', clip2.id)
        self.assertEqual(10, clip2.in_)
        self.assertEqual('SEQ001_HSNI_003_0020_v001', clip2.name)
        self.assertEqual(41, clip2.out)
        self.assertEqual(35, clip2.start)
        self.assertEqual('Video', clip2.type)

        f = clip2.file
        self.assertTrue(isinstance(f, File))
        self.assertEqual(41, f.duration)
        self.assertEqual('SEQ001_HSNI_003_0020_v001', f.name)
        self.assertEqual(
            'file://localhost/tmp/SEQ001_HSNI_003_0020_v001.mov',
            f.pathurl
        )

        # clip3
        self.assertEqual(46, clip3.duration)
        self.assertEqual(True, clip3.enabled)
        self.assertEqual(112, clip3.end)
        self.assertEqual('SEQ001_HSNI_003_0030_v001', clip3.id)
        self.assertEqual(10, clip3.in_)
        self.assertEqual('SEQ001_HSNI_003_0030_v001', clip3.name)
        self.assertEqual(56, clip3.out)
        self.assertEqual(66, clip3.start)
        self.assertEqual('Video', clip3.type)

        f = clip3.file
        self.assertTrue(isinstance(f, File))
        self.assertEqual(56, f.duration)
        self.assertEqual('SEQ001_HSNI_003_0030_v001', f.name)
        self.assertEqual(
            'file://localhost/tmp/SEQ001_HSNI_003_0030_v001.mov',
            f.pathurl
        )
Beispiel #21
0
    def test_to_xml_method_is_working_properly(self):
        """testing if the to xml method is working properly
        """
        s = Sequence()
        s.duration = 109
        s.name = 'previs_edit_v001'

        s.rate = Rate(timebase='24', ntsc=False)

        s.timecode = '00:00:00:00'

        m = Media()
        s.media = m

        v = Video()
        v.width = 1024
        v.height = 778
        m.video = v

        t = Track()
        t.enabled = True
        t.locked = False

        v.tracks.append(t)

        # clip 1
        f = File()
        f.duration = 34
        f.name = 'shot2'
        f.pathurl = 'file:///home/eoyilmaz/maya/projects/default/data/shot2.mov'

        c = Clip()
        c.id = 'shot2'
        c.start = 1
        c.end = 35
        c.name = 'shot2'
        c.enabled = True
        c.duration = 34
        c.in_ = 0
        c.out = 34
        c.file = f

        t.clips.append(c)

        # clip 2
        f = File()
        f.duration = 30
        f.name = 'shot'
        f.pathurl = 'file:///home/eoyilmaz/maya/projects/default/data/shot.mov'

        c = Clip()
        c.id = 'shot'
        c.start = 35
        c.end = 65
        c.name = 'shot'
        c.enabled = True
        c.duration = 30
        c.in_ = 0
        c.out = 30
        c.file = f

        t.clips.append(c)

        # clip 3
        f = File()
        f.duration = 45
        f.name = 'shot1'
        f.pathurl = 'file:///home/eoyilmaz/maya/projects/default/data/shot1.mov'

        c = Clip()
        c.id = 'shot1'
        c.start = 65
        c.end = 110
        c.name = 'shot1'
        c.enabled = True
        c.duration = 45
        c.in_ = 0
        c.out = 45
        c.file = f

        t.clips.append(c)

        expected_xml = \
            """<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xmeml>
<xmeml version="5">
<sequence>
  <duration>109</duration>
  <name>previs_edit_v001</name>
  <rate>
    <timebase>24</timebase>
    <ntsc>FALSE</ntsc>
  </rate>
  <timecode>
    <string>00:00:00:00</string>
  </timecode>
  <media>
    <video>
      <format>
        <samplecharacteristics>
          <width>1024</width>
          <height>778</height>
        </samplecharacteristics>
      </format>
      <track>
        <locked>FALSE</locked>
        <enabled>TRUE</enabled>
        <clipitem id="shot2">
          <end>35</end>
          <name>shot2</name>
          <enabled>True</enabled>
          <start>1</start>
          <in>0</in>
          <duration>34</duration>
          <out>34</out>
          <file id="shot2.mov">
            <duration>34</duration>
            <name>shot2</name>
            <pathurl>file://localhost/home/eoyilmaz/maya/projects/default/data/shot2.mov</pathurl>
          </file>
        </clipitem>
        <clipitem id="shot">
          <end>65</end>
          <name>shot</name>
          <enabled>True</enabled>
          <start>35</start>
          <in>0</in>
          <duration>30</duration>
          <out>30</out>
          <file id="shot.mov">
            <duration>30</duration>
            <name>shot</name>
            <pathurl>file://localhost/home/eoyilmaz/maya/projects/default/data/shot.mov</pathurl>
          </file>
        </clipitem>
        <clipitem id="shot1">
          <end>110</end>
          <name>shot1</name>
          <enabled>True</enabled>
          <start>65</start>
          <in>0</in>
          <duration>45</duration>
          <out>45</out>
          <file id="shot1.mov">
            <duration>45</duration>
            <name>shot1</name>
            <pathurl>file://localhost/home/eoyilmaz/maya/projects/default/data/shot1.mov</pathurl>
          </file>
        </clipitem>
      </track>
    </video>
  </media>
</sequence>
</xmeml>"""

        self.assertEqual(
            expected_xml,
            s.to_xml()
        )
Beispiel #22
0
 def test_timebase_attribute_is_working_properly(self):
     """testing if the timebase attribute is working properly
     """
     r = Rate(timebase='12')
     r.timebase = '15'
     self.assertEqual('15', r.timebase)
Beispiel #23
0
 def test_timebase_argument_skipped(self):
     """testing if the default value will be used when the timebase argument
     is skipped
     """
     r = Rate()
     self.assertEqual(r.timebase, '25')
Beispiel #24
0
 def test_ntsc_argument_is_None(self):
     """testing if the ntsc attribute will be False if the ntsc argument is
     None
     """
     r = Rate()
     self.assertFalse(r.ntsc)
Beispiel #25
0
 def test_timebase_attribute_is_working_properly(self):
     """testing if the timebase attribute is working properly
     """
     r = Rate(timebase='12')
     r.timebase = '15'
     self.assertEqual('15', r.timebase)
Beispiel #26
0
 def test_timebase_argument_is_working_properly(self):
     """testing if the timebase argument value is correctly passed to the
     timebase attribute
     """
     r = Rate(timebase='12')
     self.assertEqual('12', r.timebase)
Beispiel #27
0
    def generate_sequence_structure(self):
        """Generates a Sequence structure suitable for XML<->EDL conversion

        :return: Sequence
        """
        import timecode
        from anima.env.mayaEnv import Maya

        m = Maya()
        fps = m.get_fps()

        # export only the first sequence, ignore others
        sequencers = self.sequences.get()
        if len(sequencers) == 0:
            return None

        sequencer = sequencers[0]
        time = pm.PyNode('time1')

        seq = Sequence()
        seq.name = str(sequencer.get_sequence_name())

        seq.rate = Rate(timebase=str(fps), ntsc=False)
        seq.timecode = str(timecode.Timecode(
            framerate=seq.rate.timebase,
            frames=time.timecodeProductionStart.get() + 1
        ))
        seq.duration = sequencer.duration

        media = Media()
        video = Video()
        media.video = video

        for shot in sequencer.shots.get():
            clip = Clip()
            clip.id = str(shot.full_shot_name)
            clip.name = str(shot.full_shot_name)
            clip.duration = shot.duration + 2 * shot.handle.get()
            clip.enabled = True
            clip.start = shot.sequenceStartFrame.get()
            clip.end = shot.sequenceEndFrame.get() + 1
            # clips always start from 0 and includes the shot handle
            clip.in_ = shot.handle.get()  # handle at start
            clip.out = shot.handle.get() + shot.duration  # handle at end
            clip.type = 'Video'  # always video for now

            f = File()
            f.name = os.path.splitext(
                os.path.basename(str(shot.output.get()))
            )[0]

            f.duration = shot.duration + 2 * shot.handle.get()

            f.pathurl = str('file://localhost/%s' % shot.output.get())

            clip.file = f

            track_number = shot.track.get() - 1  # tracks should start from 0
            try:
                track = video.tracks[track_number]
            except IndexError:
                track = Track()
                video.tracks.append(track)

            track.clips.append(clip)
            # set video resolution
            video.width = shot.wResolution.get()
            video.height = shot.hResolution.get()

        seq.media = media
        return seq
Beispiel #28
0
 def test_ntsc_argument_is_working_properly(self):
     """testing if the ntsc argument value is properly passed to the ntsc
     attribute
     """
     r = Rate(ntsc=True)
     self.assertEqual(r.ntsc, True)
Beispiel #29
0
    def test_from_edl_method_is_working_properly_with_negative_timecodes(self):
        """testing if the from_edl method will return an anima.previs.Sequence
        instance with proper hierarchy event with clips that has negative
        timecode values (timecodes with in point is bigger than out point and
        around 23:59:59:XX as a result)
        """
        # first supply an edl
        from edl import Parser
        p = Parser('24')
        edl_path = os.path.abspath('./test_data/test_v003.edl')

        with open(edl_path) as f:
            edl_list = p.parse(f)

        r = Rate(timebase='24')

        s = Sequence(rate=r)
        s.from_edl(edl_list)

        self.assertEqual('SEQ001_HSNI_003', s.name)

        self.assertEqual(247, s.duration)
        self.assertEqual('24', s.rate.timebase)
        self.assertEqual('00:00:00:00', s.timecode)

        m = s.media
        self.assertTrue(isinstance(m, Media))

        v = m.video
        self.assertTrue(isinstance(v, Video))

        t = v.tracks[0]
        self.assertEqual(False, t.locked)
        self.assertEqual(True, t.enabled)

        clips = t.clips
        self.assertEqual(3, len(clips))

        clip1 = clips[0]
        clip2 = clips[1]
        clip3 = clips[2]

        self.assertTrue(isinstance(clip1, Clip))
        self.assertTrue(isinstance(clip2, Clip))
        self.assertTrue(isinstance(clip3, Clip))

        # clip1
        self.assertEqual(176, clip1.duration)
        self.assertEqual(True, clip1.enabled)
        self.assertEqual(153, clip1.end)
        self.assertEqual('SEQ001_HSNI_003_0010_v001', clip1.id)
        self.assertEqual(15, clip1.in_)
        self.assertEqual('SEQ001_HSNI_003_0010_v001', clip1.name)
        self.assertEqual(191, clip1.out)
        self.assertEqual(-23, clip1.start)
        self.assertEqual('Video', clip1.type)

        f = clip1.file
        self.assertTrue(isinstance(f, File))
        self.assertEqual(191, f.duration)
        self.assertEqual('SEQ001_HSNI_003_0010_v001', f.name)
        self.assertEqual(
            'file://localhost/tmp/SEQ001_HSNI_003_0010_v001.mov',
            f.pathurl
        )

        # clip2
        self.assertEqual(55, clip2.duration)
        self.assertEqual(True, clip2.enabled)
        self.assertEqual(208, clip2.end)
        self.assertEqual('SEQ001_HSNI_003_0020_v001', clip2.id)
        self.assertEqual(45, clip2.in_)
        self.assertEqual('SEQ001_HSNI_003_0020_v001', clip2.name)
        self.assertEqual(100, clip2.out)
        self.assertEqual(153, clip2.start)
        self.assertEqual('Video', clip2.type)

        f = clip2.file
        self.assertTrue(isinstance(f, File))
        self.assertEqual(100, f.duration)
        self.assertEqual('SEQ001_HSNI_003_0020_v001', f.name)
        self.assertEqual(
            'file://localhost/tmp/SEQ001_HSNI_003_0020_v001.mov',
            f.pathurl
        )

        # clip3
        self.assertEqual(1, clip3.duration)
        self.assertEqual(True, clip3.enabled)
        self.assertEqual(224, clip3.end)
        self.assertEqual('SEQ001_HSNI_003_0030_v001', clip3.id)
        self.assertEqual(0, clip3.in_)
        self.assertEqual('SEQ001_HSNI_003_0030_v001', clip3.name)
        self.assertEqual(1, clip3.out)
        self.assertEqual(208, clip3.start)
        self.assertEqual('Video', clip3.type)

        f = clip3.file
        self.assertTrue(isinstance(f, File))
        self.assertEqual(1, f.duration)
        self.assertEqual('SEQ001_HSNI_003_0030_v001', f.name)
        self.assertEqual(
            'file://localhost/tmp/SEQ001_HSNI_003_0030_v001.mov',
            f.pathurl
        )
Beispiel #30
0
    def test_to_metafuze_xml_is_working_properly(self):
        """testing if to_metafuze_xml method is working properly
        """
        s = Sequence()
        s.duration = 109
        s.name = 'SEQ001_HSNI_003'
        s.timecode = '00:00:00:00'

        r = Rate()
        s.rate = r
        r.ntsc = False
        r.timebase = '24'

        m = Media()
        s.media = m

        v = Video()
        v.width = 1024
        v.height = 778
        m.video = v

        t = Track()
        t.enabled = True
        t.locked = False

        v.tracks.append(t)

        # clip 1
        f = File()
        f.duration = 34
        f.name = 'SEQ001_HSNI_003_0010_v001'
        f.pathurl = 'file://localhost/tmp/SEQ001_HSNI_003_0010_v001.mov'

        c = Clip()
        c.id = '0010'
        c.start = 1
        c.end = 35
        c.name = 'SEQ001_HSNI_003_0010_v001'
        c.enabled = True
        c.duration = 34
        c.in_ = 0
        c.out = 34
        c.file = f

        t.clips.append(c)

        # clip 2
        f = File()
        f.duration = 30
        f.name = 'SEQ001_HSNI_003_0020_v001'
        f.pathurl = 'file://localhost/tmp/SEQ001_HSNI_003_0020_v001.mov'

        c = Clip()
        c.id = '0020'
        c.start = 35
        c.end = 65
        c.name = 'SEQ001_HSNI_003_0020_v001'
        c.enabled = True
        c.duration = 30
        c.in_ = 0
        c.out = 30
        c.file = f

        t.clips.append(c)

        # clip 3
        f = File()
        f.duration = 45
        f.name = 'SEQ001_HSNI_003_0030_v001'
        f.pathurl = 'file://localhost/tmp/SEQ001_HSNI_003_0030_v001.mov'

        c = Clip()
        c.id = '0030'
        c.start = 65
        c.end = 110
        c.name = 'SEQ001_HSNI_003_0030_v001'
        c.enabled = True
        c.duration = 45
        c.in_ = 0
        c.out = 45
        c.file = f

        t.clips.append(c)

        expected_xmls = [
            """<?xml version='1.0' encoding='UTF-8'?>
<MetaFuze_BatchTranscode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MetaFuzeBatchTranscode.xsd">
   <Configuration>
      <Local>8</Local>
      <Remote>8</Remote>
   </Configuration>
   <Group>
      <FileList>
         <File>\\tmp\\SEQ001_HSNI_003_0010_v001.mov</File>
      </FileList>
      <Transcode>
         <Version>1.0</Version>
         <File>\\tmp\\SEQ001_HSNI_003_0010_v001.mxf</File>
         <ClipName>SEQ001_HSNI_003_0010_v001</ClipName>
         <ProjectName>SEQ001_HSNI_003</ProjectName>
         <TapeName>SEQ001_HSNI_003_0010_v001</TapeName>
         <TC_Start>00:00:00:00</TC_Start>
         <DropFrame>false</DropFrame>
         <EdgeTC>** TimeCode N/A **</EdgeTC>
         <FilmType>35.4</FilmType>
         <KN_Start>AAAAAAAA-0000+00</KN_Start>
         <Frames>33</Frames>
         <Width>1024</Width>
         <Height>778</Height>
         <PixelRatio>1.0000</PixelRatio>
         <UseFilmInfo>false</UseFilmInfo>
         <UseTapeInfo>true</UseTapeInfo>
         <AudioChannelCount>0</AudioChannelCount>
         <UseMXFAudio>false</UseMXFAudio>
         <UseWAVAudio>false</UseWAVAudio>
         <SrcBitsPerChannel>8</SrcBitsPerChannel>
         <OutputPreset>DNxHD 36</OutputPreset>
         <OutputPreset>
            <Version>2.0</Version>
            <Name>DNxHD 36</Name>
            <ColorModel>YCC 709</ColorModel>
            <BitDepth>8</BitDepth>
            <Format>1080 24p</Format>
            <Compression>DNxHD 36</Compression>
            <Conversion>Letterbox (center)</Conversion>
            <VideoFileType>.mxf</VideoFileType>
            <IsDefault>false</IsDefault>
         </OutputPreset>
         <Eye></Eye>
         <Scene></Scene>
         <Comment></Comment>
      </Transcode>
   </Group>
</MetaFuze_BatchTranscode>""",
            """<?xml version='1.0' encoding='UTF-8'?>
<MetaFuze_BatchTranscode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MetaFuzeBatchTranscode.xsd">
   <Configuration>
      <Local>8</Local>
      <Remote>8</Remote>
   </Configuration>
   <Group>
      <FileList>
         <File>\\tmp\\SEQ001_HSNI_003_0020_v001.mov</File>
      </FileList>
      <Transcode>
         <Version>1.0</Version>
         <File>\\tmp\\SEQ001_HSNI_003_0020_v001.mxf</File>
         <ClipName>SEQ001_HSNI_003_0020_v001</ClipName>
         <ProjectName>SEQ001_HSNI_003</ProjectName>
         <TapeName>SEQ001_HSNI_003_0020_v001</TapeName>
         <TC_Start>00:00:00:00</TC_Start>
         <DropFrame>false</DropFrame>
         <EdgeTC>** TimeCode N/A **</EdgeTC>
         <FilmType>35.4</FilmType>
         <KN_Start>AAAAAAAA-0000+00</KN_Start>
         <Frames>29</Frames>
         <Width>1024</Width>
         <Height>778</Height>
         <PixelRatio>1.0000</PixelRatio>
         <UseFilmInfo>false</UseFilmInfo>
         <UseTapeInfo>true</UseTapeInfo>
         <AudioChannelCount>0</AudioChannelCount>
         <UseMXFAudio>false</UseMXFAudio>
         <UseWAVAudio>false</UseWAVAudio>
         <SrcBitsPerChannel>8</SrcBitsPerChannel>
         <OutputPreset>DNxHD 36</OutputPreset>
         <OutputPreset>
            <Version>2.0</Version>
            <Name>DNxHD 36</Name>
            <ColorModel>YCC 709</ColorModel>
            <BitDepth>8</BitDepth>
            <Format>1080 24p</Format>
            <Compression>DNxHD 36</Compression>
            <Conversion>Letterbox (center)</Conversion>
            <VideoFileType>.mxf</VideoFileType>
            <IsDefault>false</IsDefault>
         </OutputPreset>
         <Eye></Eye>
         <Scene></Scene>
         <Comment></Comment>
      </Transcode>
   </Group>
</MetaFuze_BatchTranscode>""",
            """<?xml version='1.0' encoding='UTF-8'?>
<MetaFuze_BatchTranscode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MetaFuzeBatchTranscode.xsd">
   <Configuration>
      <Local>8</Local>
      <Remote>8</Remote>
   </Configuration>
   <Group>
      <FileList>
         <File>\\tmp\\SEQ001_HSNI_003_0030_v001.mov</File>
      </FileList>
      <Transcode>
         <Version>1.0</Version>
         <File>\\tmp\\SEQ001_HSNI_003_0030_v001.mxf</File>
         <ClipName>SEQ001_HSNI_003_0030_v001</ClipName>
         <ProjectName>SEQ001_HSNI_003</ProjectName>
         <TapeName>SEQ001_HSNI_003_0030_v001</TapeName>
         <TC_Start>00:00:00:00</TC_Start>
         <DropFrame>false</DropFrame>
         <EdgeTC>** TimeCode N/A **</EdgeTC>
         <FilmType>35.4</FilmType>
         <KN_Start>AAAAAAAA-0000+00</KN_Start>
         <Frames>44</Frames>
         <Width>1024</Width>
         <Height>778</Height>
         <PixelRatio>1.0000</PixelRatio>
         <UseFilmInfo>false</UseFilmInfo>
         <UseTapeInfo>true</UseTapeInfo>
         <AudioChannelCount>0</AudioChannelCount>
         <UseMXFAudio>false</UseMXFAudio>
         <UseWAVAudio>false</UseWAVAudio>
         <SrcBitsPerChannel>8</SrcBitsPerChannel>
         <OutputPreset>DNxHD 36</OutputPreset>
         <OutputPreset>
            <Version>2.0</Version>
            <Name>DNxHD 36</Name>
            <ColorModel>YCC 709</ColorModel>
            <BitDepth>8</BitDepth>
            <Format>1080 24p</Format>
            <Compression>DNxHD 36</Compression>
            <Conversion>Letterbox (center)</Conversion>
            <VideoFileType>.mxf</VideoFileType>
            <IsDefault>false</IsDefault>
         </OutputPreset>
         <Eye></Eye>
         <Scene></Scene>
         <Comment></Comment>
      </Transcode>
   </Group>
</MetaFuze_BatchTranscode>""",
        ]

        result = s.to_metafuze_xml()

        self.maxDiff = None
        self.assertEqual(
            expected_xmls[0],
            result[0]
        )
        self.assertEqual(
            expected_xmls[1],
            result[1]
        )
        self.assertEqual(
            expected_xmls[2],
            result[2]
        )
Beispiel #31
0
 def test_timebase_argument_is_None(self):
     """testing if the timebase attribute value will be set to the default
     value if the timebase argument is None
     """
     r = Rate(timebase=None)
     self.assertEqual(r.timebase, '25')