示例#1
0
def main():
    sys.stderr = open(LOGFILE, 'a')
    print >> sys.stderr, "\n<-------------------" + time.strftime("%c") + "----------------------->\n"

    bbb_version = bbbversion()
    print >> sys.stderr, "bbb_version: " + bbb_version

    os.chdir(source_dir)

    dictionary, length, dims = prepare(bbb_version)

    audio = audio_path + 'audio.ogg'
    audio_trimmed = temp_dir + 'audio_trimmed.m4a'
    result = target_dir + 'meeting.mp4'
    slideshow = temp_dir + 'slideshow.mp4'

    try:
        create_slideshow(dictionary, length, slideshow, bbb_version)
        ffmpeg.trim_audio_start(dictionary, length, audio, audio_trimmed)
        ffmpeg.mux_slideshow_audio(slideshow, audio_trimmed, result)
        serve_webcams()
        # zipdir('./download/')
        copy_mp4(result, source_dir + meetingId + '.mp4')
    finally:
        print >> sys.stderr, "Cleaning up temp files..."
        cleanup()
        print >> sys.stderr, "Done"
示例#2
0
 def start(self):
     os.chdir(str(self.meeting.source_dir))
     self.prepare()
     self.create_slideshow()
     ffmpeg.trim_audio_start(self.meeting.slides[0]['in'],
                             self.meeting.total_length,
                             self.meeting.audio_file,
                             self.meeting.audio_trimmed)
     ffmpeg.mux_slideshow_audio(self.meeting.slideshow_file,
                                self.meeting.audio_trimmed,
                                self.meeting.result_file)
     self.serve_webcams()
     # self.zipdir()
     self.copy_mp4()
     print("\n<------------------- ENDED [" + time.strftime("%c") +
           "] ----------------------->\n",
           file=sys.stderr)
示例#3
0
def main():
    sys.stderr = open(LOGFILE, 'a')
    print >> sys.stderr, "\n<-------------------" + time.strftime("%c") + "----------------------->\n"
    os.chdir(source_dir)

    dictionary, length, dims = prepare()

    audio = audio_path + 'audio.ogg'
    audio_trimmed = temp_dir + 'audio_trimmed.m4a'
    result = target_dir + 'meeting.mp4'
    slideshow = temp_dir + 'slideshow.mp4'

    try:
        create_slideshow(dictionary, length, slideshow)
        ffmpeg.trim_audio_start(dictionary, length, audio, audio_trimmed)
        ffmpeg.mux_slideshow_audio(slideshow, audio_trimmed, result)
        serve_webcams()
        zipdir('./download/')
    finally:
        print >> sys.stderr, "Cleaning up temp files..."
        cleanup()
        print >> sys.stderr, "Done"
示例#4
0
def main():
    sys.stderr = open(LOGFILE, 'a')
    print >> sys.stderr, "\n<-------------------" + time.strftime(
        "%c") + "----------------------->\n"

    bbb_version = bbbversion()
    print >> sys.stderr, "bbb_version: " + bbb_version

    os.chdir(source_dir)
    print >> sys.stderr, "Verifying record"
    try:
        if not video_exists(source_dir + meetingId + '_presentation.mp4'):
            dictionary, length, dims = prepare(bbb_version)
            audio = audio_path + 'audio.ogg'
            audio_trimmed = temp_dir + 'audio_trimmed.m4a'
            result = target_dir + 'meeting.mp4'
            slideshow = temp_dir + 'slideshow.mp4'
            try:
                print >> sys.stderr, "Creating presentation's .Mp4 video..."
                print >> sys.stderr, "Slideshow"
                create_slideshow(dictionary, length, slideshow, bbb_version)
                print >> sys.stderr, "audio"
                ffmpeg.trim_audio_start(dictionary, length, audio,
                                        audio_trimmed)
                print >> sys.stderr, "Slideshow + audio"
                ffmpeg.mux_slideshow_audio(slideshow, audio_trimmed, result)

                serve_webcams()
                # zipdir('./download/')
                copy_mp4(result, source_dir + meetingId + '_presentation.mp4')
                print >> sys.stderr, "Presentation's Mp4 Creation Done"
            except:
                print >> sys.stderr, "Presentation's Mp4 Creation Failed"
        else:
            print >> sys.stderr, "Presentation record already exists: " + source_dir + meetingId + '_presentation.mp4'

        if not video_exists(source_dir + meetingId + '_cams.mp4'):
            try:
                print >> sys.stderr, "Converting Webcam to .mp4..."
                ffmpeg.webm_to_mp4(source_dir + "video/webcams.webm",
                                   source_dir + meetingId + '_cams.mp4')
                print >> sys.stderr, "Webcams' Mp4 Creation Done"
            except:
                print >> sys.stderr, "Webcams' Mp4 Creation Failed"
        else:
            print >> sys.stderr, "Webcam record already exists: " + source_dir + meetingId + "_cams.mp4"

        if not video_exists(source_dir + meetingId + '_overlayed.mp4'):
            if (video_exists(source_dir + meetingId + '_presentation.mp4')
                    and video_exists(source_dir + meetingId + '_cams.mp4')):
                try:
                    print >> sys.stderr, "Overlayig Presentation and webcams..."
                    ffmpeg.overlay_video(
                        source_dir + meetingId + '_presentation.mp4',
                        source_dir + meetingId + '_cams.mp4',
                        source_dir + meetingId + '_overlayed.mp4')
                    print >> sys.stderr, "Overlaying is done"
                except:
                    print >> sys.stderr, "Overlaying is Failed"
            else:
                print >> sys.stderr, "Overlaying is not possible"
        else:
            print >> sys.stderr, "Webcam record already exists: " + meetingId + '_overlayed.mp4'
    finally:
        print >> sys.stderr, "Cleaning up temp files..."
        cleanup()
        print >> sys.stderr, "Process finished"