Recherche avancée

Médias (0)

Mot : - Tags -/alertes

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (86)

Sur d’autres sites (15293)

  • How to Bulk Speed UP and Crop Videos FFMPEG

    6 septembre 2023, par Usemo Shank

    I have videos in (input) folder that is located on the root of the script, I also have output folder on the root, The input folder has several videos that i want to speed up in bulk by 1.1 percent, I also want to cropt the videos by 90 percent (Meaning 90 Percent of original video is visible).

    


    I have a code that does not function well. Here is the code I have

    


     import os
import subprocess

# Define input and output directories
input_folder = "input"
output_folder = "output"

# Create the output directory if it doesn't exist
if not os.path.exists(output_folder):
    os.makedirs(output_folder)

# List all video files in the input directory
input_files = [f for f in os.listdir(input_folder) if f.endswith(('.mp4', '.avi', '.mkv'))]

# Speed up and crop each video
for input_file in input_files:
    input_path = os.path.join(input_folder, input_file)
    output_file = os.path.splitext(input_file)[0] + "_speed_crop.mp4"
    output_path = os.path.join(output_folder, output_file)

    # FFmpeg command to speed up video by 1.1x and crop to 90%
    ffmpeg_command = [
        "ffmpeg",
        "-i", input_path,
        "-vf", "setpts=1.1*PTS,crop=in_w*0.9:in_h*0.9",
        "-c:v", "libx264",
        "-crf", "20",
        "-c:a", "aac",
        "-strict", "experimental",
        output_path
    ]

    # Run FFmpeg command
    subprocess.run(ffmpeg_command)

print("Conversion complete.")


    


  • lavf : move AVStream.info to AVStreamInternal

    9 octobre 2020, par Anton Khirnov
    lavf : move AVStream.info to AVStreamInternal
    

    This struct is for internal use of avformat_find_stream_info(), so it
    should not be exposed in public headers. Keep a stub pointer in its
    place to avoid changing AVStream layout, since e.g. ffmpeg.c accesses
    some fields located after it (even though they are marked as private).

    • [DH] libavformat/avformat.h
    • [DH] libavformat/internal.h
    • [DH] libavformat/utils.c
  • oggenc : Support flushing the muxer

    29 mai 2014, par Martin Storsjö
    oggenc : Support flushing the muxer
    

    This allows the caller to write all buffered data to disk, allowing
    the caller to know at what byte position in the file a certain
    packet starts (any packet written after the flush will be located
    after that byte position).

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DBH] libavformat/oggenc.c
    • [DBH] libavformat/version.h