コード例 #1
0
    if (BACK_MUS is None and BACK_VOL != -12):
        print(
            'Warning! Background volume specified even though no background music was provided.'
        )

    if (KEEP_SEP == False and PRERUN == False and BACK_MUS is None
            and LOUD_THRESHOLD == 2 and NEW_TRAC == None
            and SILENT_SPEED == 99999 and VIDEO_SPEED == 1 and BASE_TRAC == 0
            and HWACCEL is None and not isAudio):

        OUTPUT_FILE = fastVideo(INPUT_FILE, OUTPUT_FILE, SILENT_THRESHOLD,
                                FRAME_SPREADAGE, SAMPLE_RATE, VERBOSE)
    else:
        OUTPUT_FILE = originalMethod(
            INPUT_FILE, OUTPUT_FILE, GIVEN_FPS, FRAME_SPREADAGE, FRAME_QUALITY,
            SILENT_THRESHOLD, LOUD_THRESHOLD, SAMPLE_RATE, SILENT_SPEED,
            VIDEO_SPEED, KEEP_SEP, BACK_MUS, BACK_VOL, NEW_TRAC, BASE_TRAC,
            COMBINE_TRAC, VERBOSE, PRERUN, HWACCEL)

    print('Finished.')
    timeLength = round(time.time() - startTime, 2)
    minutes = timedelta(seconds=round(timeLength))
    print(f'took {timeLength} seconds ({minutes})')

    if (not os.path.isfile(OUTPUT_FILE)):
        raise IOError(f'Error: The file {OUTPUT_FILE} was not created.')

    try:  # should work on Windows
        os.startfile(OUTPUT_FILE)
    except AttributeError:
        try:  # should work on MacOS and most Linux versions
コード例 #2
0
                                    args.keep_tracks_seperate)
            else:
                from scripts.fastVideoPlus import fastVideoPlus

                outFile = fastVideoPlus(
                    ffmpeg, INPUT_FILE, newOutput, args.silent_threshold,
                    args.frame_margin, args.sample_rate, args.audio_bitrate,
                    args.debug, args.video_speed, args.silent_speed,
                    args.cut_by_this_track, args.keep_tracks_seperate)
        else:
            from scripts.originalMethod import originalMethod

            outFile = originalMethod(
                ffmpeg, INPUT_FILE, newOutput, args.frame_margin,
                args.silent_threshold, args.zoom_threshold, args.sample_rate,
                args.audio_bitrate, args.silent_speed, args.video_speed,
                args.keep_tracks_seperate, args.background_music,
                args.background_volume, args.cut_by_this_audio,
                args.cut_by_this_track, args.cut_by_all_tracks, args.debug,
                args.hardware_accel)

    print('Finished.')
    timeLength = round(time.time() - startTime, 2)
    minutes = timedelta(seconds=round(timeLength))
    print(f'took {timeLength} seconds ({minutes})')

    if (not os.path.isfile(outFile)):
        raise IOError(f'Error: The file {outFile} was not created.')

    if (not args.no_open and not args.export_to_premiere):
        try:  # should work on Windows
            os.startfile(outFile)
コード例 #3
0
                outFile = fastVideo(INPUT_FILE, newOutput,
                                    args.silent_threshold, args.frame_margin,
                                    args.sample_rate, args.audio_bitrate,
                                    args.verbose, args.cut_by_this_track,
                                    args.keep_tracks_seperate)
            else:
                outFile = fastVideoPlus(
                    INPUT_FILE, newOutput, args.silent_threshold,
                    args.frame_margin, args.sample_rate, args.audio_bitrate,
                    args.verbose, VIDEO_SPEED, SILENT_SPEED,
                    args.cut_by_this_track, args.keep_tracks_seperate)
        else:
            outFile = originalMethod(INPUT_FILE, newOutput, args.frame_rate,
                                     args.frame_margin, args.silent_threshold,
                                     args.zoom_threshold, args.sample_rate,
                                     args.audio_bitrate, SILENT_SPEED,
                                     VIDEO_SPEED, args.keep_tracks_seperate,
                                     BACK_MUS, BACK_VOL, NEW_TRAC, BASE_TRAC,
                                     COMBINE_TRAC, args.verbose, HWACCEL)

    print('Finished.')
    timeLength = round(time.time() - startTime, 2)
    minutes = timedelta(seconds=round(timeLength))
    print(f'took {timeLength} seconds ({minutes})')

    if (not os.path.isfile(outFile)):
        raise IOError(f'Error: The file {outFile} was not created.')

    if (not args.no_open):
        try:  # should work on Windows
            os.startfile(outFile)