Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (16)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

  • Emballe Médias : Mettre en ligne simplement des documents

    29 octobre 2010, par

    Le plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
    Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
    D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (3303)

  • how would i play a large list of mp3 and wav files while showing the name of it on the screen with ffmpeg

    4 juillet 2023, par iiDk

    i've been attempting to make a video that is autogenerated using ffmpeg that plays a list of audios and while they are playing it shows the name of the audio file on the screen. i have no idea how to use ffmpeg and i abused ai for the provided script, but it's stupid and doesn't know how to properly reencode the file fixing the bugs at the end which cause the audio to only be on the left channel for no reason and then eventually cutting out.

    


    import os
import subprocess

def create_combined_video(audio_folder, output_path):
    # Get a list of audio files in the specified folder
    audio_files = []
    for filename in os.listdir(audio_folder):
        if filename.endswith(".mp3") or filename.endswith(".wav"):
            audio_files.append(os.path.join(audio_folder, filename))

    # Sort the audio files alphabetically
    audio_files.sort()

    # Create a folder to store the temporary image frames
    temp_frames_folder = "temp_frames"
    os.makedirs(temp_frames_folder, exist_ok=True)

    # Generate the image frames with the corresponding audio file names
    for index, audio_file in enumerate(audio_files):
        name = os.path.splitext(os.path.basename(audio_file))[0]
        image_path = os.path.join(temp_frames_folder, f"{index+1:06d}.jpg")

        # Use FFmpeg to create the image frame with text overlay
        ffmpeg_cmd = f'ffmpeg -y -f lavfi -i color=c=white:s=720x480:d=1 -vf "drawtext=text=\'{name}\':fontcolor=black:fontsize=36:x=(w-text_w)/2:y=(h-text_h)/2" -vframes 1 "{image_path}"'
        subprocess.run(ffmpeg_cmd, shell=True)

    # Generate a text file containing the image file names for each audio
    image_names_path = "image_names.txt"
    with open(image_names_path, "w") as file:
        for index, audio_file in enumerate(audio_files):
            image_path = os.path.join(temp_frames_folder, f"{index+1:06d}.jpg")
            duration = get_audio_duration(audio_file)
            file.write(f"file '{image_path}'\nduration {duration}\n")

    # Generate a text file containing the audio file names
    audio_names_path = "audio_names.txt" 
    with open(audio_names_path, "w") as file:
        for audio_file in audio_files:
            file.write(f"file '{audio_file}'\n")

    # Re-encode the audio files with a common codec (AAC)
    reencoded_audio_folder = "reencoded_audio"
    os.makedirs(reencoded_audio_folder, exist_ok=True)
    for index, audio_file in enumerate(audio_files):
        reencoded_audio_file = os.path.join(reencoded_audio_folder, f"{index:03d}.m4a")
        ffmpeg_cmd = f'ffmpeg -y -i "{audio_file}" -c:a aac "{reencoded_audio_file}"'
        subprocess.run(ffmpeg_cmd, shell=True)

    # Generate a text file containing the re-encoded audio file names
    reencoded_audio_names_path = "reencoded_audio_names.txt"
    with open(reencoded_audio_names_path, "w") as file:
        for index, audio_file in enumerate(audio_files):
            reencoded_audio_file = os.path.join(reencoded_audio_folder, f"{index:03d}.m4a")
            file.write(f"file '{reencoded_audio_file}'\n")

    # Use FFmpeg to generate the video with the image frames and re-encoded audio
    ffmpeg_cmd = f'ffmpeg -y -f concat -safe 0 -i "{image_names_path}" -f concat -safe 0 -i "{reencoded_audio_names_path}" -c:v libx264 -pix_fmt yuv420p -vf "scale=720:480:force_original_aspect_ratio=increase,crop=720:480" -c:a aac -shortest "{output_path}"'
    subprocess.run(ffmpeg_cmd, shell=True)

    # Clean up temporary files and folders
    os.remove(image_names_path)
    os.remove(audio_names_path)
    for image_file in os.listdir(temp_frames_folder):
        os.remove(os.path.join(temp_frames_folder, image_file))
    os.rmdir(temp_frames_folder)
    for audio_file in os.listdir(reencoded_audio_folder):
        os.remove(os.path.join(reencoded_audio_folder, audio_file))
    os.rmdir(reencoded_audio_folder)

def get_audio_duration(audio_file): 
    # Use FFprobe to get the duration of the audio file
    ffprobe_cmd = f'ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "{audio_file}"'
    result = subprocess.run(ffprobe_cmd, shell=True, capture_output=True, text=True)
    duration = float(result.stdout.strip())
    return duration

# Usage example
audio_folder = "C:/Users/Admin/Desktop/Sounds"
output_path = "C:/Users/Admin/Desktop/output.mp4"
create_combined_video(audio_folder, output_path)


    


    i've tried yelling at ai to fix the bug and all it does is break the script instead of doing what i asked it to, but i believe all it has to do is fix reencoding

    


  • RTMP video streaming client without showing the video just need extensive log

    6 août 2016, par Amir

    I set up an RTMP video streaming server in a cloud environment for research purposes. On another VM in the cloud, I want to use a client to do some experiments. I have tried some different video player like VLC and FFplay but they are keep playing the video in the shell. As it is in the command line environment and to make sure my experiments are not biased with human errors, I need an RTMP video streaming client that just receives the stream as if it wanted to play it and log everything, for instance, if the playback stops due to buffering, average buffer size, etc.

    Thanks

  • FFmpeg how to get an image for a particular 'coded_picture_number' together with motion vectors

    26 février 2018, par helmo

    I am looking for ways to get this output from ffmpeg :

    enter image description here

    Basically, I would like to pass to the shell, a command that allows me to output a particular frame number, let’s say coded_picture_number=200 with the motion vectors drawn into it.

    Any clue ? Thanks in advance.