Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (81)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (7267)

  • Im trying to add Audio to a mute Video and it doesnt work

    15 février 2021, par mybrainisrunningoutofmyears

    I had two approaches :

    


    1.ffmpeg-python

    


    def addaudtovid(audpath,vidpath,savepath): 
    input_video = ffmpeg.input(vidpath)
    input_audio = ffmpeg.input(audpath)
    ffmpeg.concat(input_video, input_audio, v=1, a=1).output(savepath).run()


    


    here for some reason it "cant find a file"(in the fourth line) but all files exist.
Tried this too :

    


    subprocess.run("ffmpeg -i "+vidpath+" -i "+audpath+" -c copy "+savepath)


    


      

    1. MoviePy.editor
    2. 


    


    Here the finished Video starts after about 3 seconds of blackscreen, but the Audio already starts at the beginning

    


    videoclip = VideoFileClip(vidpath)
audioclip = AudioFileClip(audpath)
videoclip.audio = audioclip
videoclip.write_videofile(savepath)


    


    The Audio and Video are exactly the same length

    


    I am using Windows 10 python 3.8

    


    I am happy about any idea how to fix it because I tried everything I could think and google of.

    


  • Start and end time of MoviePy's VideoClip not working

    21 mars 2024, par ernesto casco velazquez

    I'm trying to add captions to a video. The desired outcome is to show each word in the exact moment is being said.

    


    I have a method that gives me the accurate time start and end per each word :

    


    def get_words_per_time(audio_speech_file):
    model = whisper.load_model("base")
    transcribe = model.transcribe(
        audio=audio_speech_file, fp16=False, word_timestamps=True
    )
    segments = transcribe["segments"]
    words = []

    for seg in segments:
        for word in seg["words"]:
            words.append(
                {
                    "word": word["word"],
                    "start": word["start"],
                    "end": word["end"],
                    "prob": round(word["probability"], 4),
                }
            )
    return words


    


    Then I have a code that uses MoviePy to create TextClip and assing a given start and end time per pair of words (I know there are redundant statements, srry) :

    


    def generate_captions(
    words,
    font="Komika",
    fontsize=32,
    color="White",
    align="center",
    stroke_width=3,
    stroke_color="black",
):
    text_comp = []
    for i in track(range(0, len(words), 2), description="Creating captions..."):
        word1 = words[i]
        if i + 1 < len(words):
            word2 = words[i + 1]
        text_clip = TextClip(
            f"{word1['word']} {word2['word'] if i + 1 < len(words) else ''}",
            font=font,  # Change Font if not found
            fontsize=fontsize,
            color=color,
            align=align,
            method="caption",
            size=(660, None),
            stroke_width=stroke_width,
            stroke_color=stroke_color,
        )
        text_clip = text_clip.set_start(word1["start"])
        text_clip = text_clip.set_end(
            word2["end"] if i + 1 < len(words) else word1["end"]
        )
        text_comp.append(text_clip)
    return text_comp


    


    Finally, I concatenate the words into a single video :

    


    vid_clip = CompositeVideoClip(
    [vid_clip, concatenate_videoclips(text_comp).set_position(("center", 860))]
)


    


    The output is this, but you can clearly see the words are not flowing with the speech. They somehow move faster as if the start/end time did not matter. Here's the video

    


    The words with their respective start/end time, look like this :

    


    [
    {
        'word': 'This',
        'start': 0.0,
        'end': 0.22,
        'prob': 0.805
    },
    {
        'word': 'is',
        'start': 0.22,
        'end': 0.42,
        'prob': 0.9991
    },
    {
        'word': 'a',
        'start': 0.42,
        'end': 0.6,
        'prob': 0.999
    },
    {
        'word': 'test,
        ',
        'start': 0.6,
        'end': 1.04,
        'prob': 0.9939
    },
    {
        'word': 'to',
        'start': 1.18,
        'end': 1.3,
        'prob': 0.9847
    },
    {
        'word': 'show',
        'start': 1.3,
        'end': 1.54,
        'prob': 0.9971
    },
    {
        'word': 'words',
        'start': 1.54,
        'end': 1.9,
        'prob': 0.995
    },
    {
        'word': 'does',
        'start': 1.9,
        'end': 2.16,
        'prob': 0.997
    },
    {
        'word': 'not',
        'start': 2.16,
        'end': 2.4,
        'prob': 0.9978
    },
    {
        'word': 'appear.',
        'start': 2.4,
        'end': 2.82,
        'prob': 0.9984
    },
    {
        'word': 'At',
        'start': 3.46,
        'end': 3.6,
        'prob': 0.9793
    },
    {
        'word': 'their',
        'start': 3.6,
        'end': 3.8,
        'prob': 0.9984
    },
    {
        'word': 'proper',
        'start': 3.8,
        'end': 4.22,
        'prob': 0.9976
    },
    {
        'word': 'time.',
        'start': 4.22,
        'end': 4.72,
        'prob': 0.999
    },
    {
        'word': 'Thanks',
        'start': 5.04,
        'end': 5.4,
        'prob': 0.9662
    },
    {
        'word': 'for,
        ',
        'start': 5.4,
        'end': 5.66,
        'prob': 0.9941
    },
    {
        'word': 'watching.',
        'start': 5.94,
        'end': 6.36,
        'prob': 0.7701
    }
]


    


    What could be causing this ?

    


  • ffmpeg silenceremove - hear what bits are removed

    7 avril 2020, par jimo

    ffmpeg silenceremove is pretty cool. im loving it. i can trim 3 second silences to 2 seconds and reduce a 1.5 hour file of spoken audio down 3 or 4 minutes (depending on the speaker).

    



    once in a while I do hear my choice for stop_threshold (ie-40dB on audio only analog file) does cause the end of a word to be clipped, just here and there when the speaker trails off softly at the end of the word.

    



    is there any way to output what is trimmed to a file ? so I can listen to it and get an idea of just how often this word clipping happens ?

    



    thanks !