Exemple #1
0
def _merge_fragments_to_single_video(game_id: int) -> None:
    tprint("Merge to a single video", debug_only=True)
    concat_video(
        _get_concat_file_name(game_id),
        _get_raw_file_name(game_id),
        extra_args="-bsf:a aac_adtstoasc",
    )
Exemple #2
0
def _merge_cuts_to_silent_video(game_id: int) -> None:
    tprint(
        "Merging segments back to single video and saving: " +
        f"{game_id}_silent.mkv",
        debug_only=True,
    )
    concat_video(f"{game_id}/concat_list.txt", f"{game_id}_silent.mkv")
Exemple #3
0
def obfuscate(download: Download) -> None:
    """
    Pads the end of the video with 100 minutes of black
    """
    game_tracking.update_game_status(download.game_id, GameStatus.obfuscating)

    input_file: str = f"{download.game_id}_silent.mkv"

    obfuscate_concat_content = _create_obfuscation_concat_content(input_file)
    concat_list_file = f"{download.game_id}/obfuscate_concat_list.txt"

    write_lines_to_file(obfuscate_concat_content, concat_list_file)

    tprint("Obfuscating end time of video..")
    output_file: str = f"{download.game_id}_obfuscated.mkv"
    concat_video(concat_list_file, output_file)

    os.remove(input_file)

    cut_to_closest_hour(download.game_id)

    game_tracking.update_game_status(download.game_id, GameStatus.moving)

    move_file_to_download_folder(download)

    game_tracking.update_game_status(download.game_id, GameStatus.completed)
    game_tracking.download_finished(download.game_id)
Exemple #4
0
def test_concat_video_w_extraargs(mock_call_subp_and_raise):
    concat_video("conc.txt", "outp.mkv", extra_args="btree -c")
    command = (f"ffmpeg -y -nostats -loglevel 0 -f concat -safe 0 -i "
               f"conc.txt -c copy btree -c outp.mkv")
    mock_call_subp_and_raise.assert_called_once_with(command)
Exemple #5
0
def test_concat_video(mock_call_subp_and_raise):
    concat_video("conc.txt", "outp.mkv")
    command = (f"ffmpeg -y -nostats -loglevel 0 -f concat -safe 0 -i "
               f"conc.txt -c copy  outp.mkv")
    mock_call_subp_and_raise.assert_called_once_with(command)