Recherche avancée

Médias (33)

Mot : - Tags -/creative commons

Autres articles (94)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (12827)

  • avformat/mpegts : recognizes and export private streams

    4 juin 2015, par Michael Niedermayer
    avformat/mpegts : recognizes and export private streams
    

    Based on patch by Wolfgang Lorenz <wl-chmw@gmx.de>
    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>

    • [DH] libavformat/mpegts.c
  • avcodec/av1_parser : export color information

    26 janvier 2020, par James Almer
    avcodec/av1_parser : export color information
    

    Should fix fate-lavf-fate-av1.mkv failures on builds without an AV1 decoder.

    Tested-by : Michael Niedermayer <michael@niedermayer.cc>
    Signed-off-by : James Almer <jamrial@gmail.com>

    • [DH] libavcodec/av1_parser.c
  • 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.

    &#xA;

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

    &#xA;

    def get_words_per_time(audio_speech_file):&#xA;    model = whisper.load_model("base")&#xA;    transcribe = model.transcribe(&#xA;        audio=audio_speech_file, fp16=False, word_timestamps=True&#xA;    )&#xA;    segments = transcribe["segments"]&#xA;    words = []&#xA;&#xA;    for seg in segments:&#xA;        for word in seg["words"]:&#xA;            words.append(&#xA;                {&#xA;                    "word": word["word"],&#xA;                    "start": word["start"],&#xA;                    "end": word["end"],&#xA;                    "prob": round(word["probability"], 4),&#xA;                }&#xA;            )&#xA;    return words&#xA;

    &#xA;

    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) :

    &#xA;

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

    &#xA;

    Finally, I concatenate the words into a single video :

    &#xA;

    vid_clip = CompositeVideoClip(&#xA;    [vid_clip, concatenate_videoclips(text_comp).set_position(("center", 860))]&#xA;)&#xA;

    &#xA;

    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

    &#xA;

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

    &#xA;

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

    &#xA;

    What could be causing this ?

    &#xA;