示例#1
0
def _generate_xml(rendition_id, keyframes, xml_path):
    template_path = os.path.join(os.path.dirname(__file__), 'metadata.xml')
    xml = Template(filename=template_path).render(renditionId=rendition_id,
                                                  keyframes=keyframes)
    fileutil.writefile(xml_path, xml)
示例#2
0
def generate_m3u8(m3u8_path, segments, segment_seconds, end=True):
    template_path = os.path.join(os.path.dirname(__file__), 'template.m3u8')
    m3u8 = Template(filename=template_path).render(segments=segments, segmentSeconds=segment_seconds, end=end)
    fileutil.writefile(m3u8_path, m3u8)
    
示例#3
0
def _generate_xml(rendition_id, keyframes, xml_path):
    template_path = os.path.join(os.path.dirname(__file__), 'metadata.xml')
    xml = Template(filename=template_path).render(renditionId=rendition_id, keyframes=keyframes)
    fileutil.writefile(xml_path, xml)
示例#4
0
def generate_m3u8(m3u8_path, segments, segment_seconds, end=True):
    template_path = os.path.join(os.path.dirname(__file__), 'template.m3u8')
    m3u8 = Template(filename=template_path).render(
        segments=segments, segmentSeconds=segment_seconds, end=end)
    fileutil.writefile(m3u8_path, m3u8)