Recherche avancée

Médias (91)

Autres articles (59)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (7216)

  • HLS stream plays in VLC not in Safari

    7 janvier 2021, par Myles McDonnell

    I have created a HLS stream using FFMPEG using this command :

    


    ffmpeg -i 10-brass-in-pocket.flac -map 0:a -map 0:a -map 0:a -map 0:a -c:a:0 flac -c:a:1 aac -c:a:2 aac -c:a:3 aac -b:a:1 320k -b:a:2 160k -b:a:3 96k -f hls -hls_playlist_type vod -master_pl_name master.m3u8 -var_stream_map "a:0 a:1 a:2 a:3" stream_%v.m3u8

    


    see master playlist here : https://di5wym8npn4cm.cloudfront.net/ffmpeg/master.m3u8

    


    It has for sub-streams ;

    


      

    • 1 FLAC @ 44.1Hz / 16bit
    • 


    • 2 AAC-LC 320
    • 


    • 3 AAC-LC 160
    • 


    • 4 AAC-LC 96
    • 


    


    It works if I play that URL in VLC but if I use that URL in a HTML5 control and load in Safari the loader spins and I can see from the dev tools the data being pulled down but it doesn't play, see here : https://di5wym8npn4cm.cloudfront.net/ffmpeg/index.html

    


    Why doesn't this play in Safari and how can I debug this ?

    


  • Why do I get UnknownValueError() speech_recognition.UnknownValueError when trying to run .recognize_google ?

    20 juillet 2022, par John Smith

    Following code is meant to transcribe a long audio file to text. It is to do this piece by piece. trimmed.wav holds a 15-second-long piece of a longer audio file (whose path is stored in fname) :

    


    #!/usr/bin/env python3

from subprocess import run
from sys import exit

italic = '\33[3m'
end = '\33[m'

try:
    from speech_recognition import AudioFile, Recognizer
except:
    run("pip3 install SpeechRecognition", shell=True)
    from speech_recognition import AudioFile, Recognizer

def transcribe_piece(fname, lang, stime):
    extension = fname[-3:]
    etime = stime + 15
    cmd = f"ffmpeg -ss {stime} -to {etime} -i {fname} -c copy trimmed.{extension} >/dev/null 2>&1"
    run(cmd, shell=True)
    cmd = f"ffmpeg -i trimmed.{extension} -f wav trimmed.wav >/dev/null 2>&1"
    run(cmd, shell=True)
    r = Recognizer()    
    af = AudioFile("trimmed.wav")
    with af as source:
        r.adjust_for_ambient_noise(source)
        audio = r.record(source)
        t = r.recognize_google(audio, language=lang)#UnknownValueError() speech_recognition.UnknownValueError
        print(f"{italic}{t}{end}")
        with open("of", "w") as f:
            f.write(f"{t}\n")
    run(f"rm trimmed.{extension}", shell=True) 
    run(f"rm trimmed.wav", shell=True)
    
    

fname = input("File name? Skip the path if the file is in CWD. The usage of ~ is allowed.\n")

lang = input("""Specify one of the following languages:
fr-BE, fr-CA, fr-FR, fr-CH

en-AU, en-CA, en-GH, en-HK, en-IN, en-IE, en-KE, en-NZ, en-PK, en-PH, en-SG, en-ZA, en-TZ, en-GB, en-US

es-AR, es-BO, es-BO, es-CL, es-CO, es-CR, es-DO, es-EC, es-SV, es-SV, es-GT, es-HN, es-MX, es-NI, es-PA, es-PY, es-PE, es-PR, es-ES, es-US, es-UY, es-VE\n""")


#for stime in range(0, 10000, 15):
#    try:
#        transcribe_piece(fname, lang, stime)
#    except:
#        run("shred -u trimmed.wav" , shell=True) 
        #run("shred -u trimmed.wav >/dev/null 2>&1" , shell=True) 
#        exit(0)
        
for stime in range(0, 10000, 15):#this loop is only for the sake of debugging, use try/except above
    transcribe_piece(fname, lang, stime)



    


    It gives me the following error :

    


    Traceback (most recent call last):&#xA;  File "/home/jim/CS/SoftwareDevelopment/MySoftware/Python/speech-to-text/long-audio-to-text.py", line 61, in <module>&#xA;    transcribe_piece(fname, lang, stime)&#xA;  File "/home/jim/CS/SoftwareDevelopment/MySoftware/Python/speech-to-text/long-audio-to-text.py", line 31, in transcribe_piece&#xA;    t = r.recognize_google(audio, language=lang)&#xA;  File "/home/jim/.local/lib/python3.10/site-packages/speech_recognition/__init__.py", line 858, in recognize_google&#xA;    if not isinstance(actual_result, dict) or len(actual_result.get("alternative", [])) == 0: raise UnknownValueError()&#xA;speech_recognition.UnknownValueError&#xA;&#xA;</module>

    &#xA;

    The said error refers to line 31, that is t = r.recognize_google(audio, language=lang).&#xA;Why do I get this error ? How might I rewrite this code so that such error does not appear ?

    &#xA;

  • Why do I get UnknownValueError when trying to run .recognize_google ?

    21 juillet 2022, par John Smith

    Following code is meant to transcribe a long audio file to text. It is to do this piece by piece. trimmed.wav holds a 15-second-long piece of a longer audio file (whose path is stored in fname) :

    &#xA;

    #!/usr/bin/env python3&#xA;&#xA;from subprocess import run&#xA;from sys import exit&#xA;&#xA;italic = &#x27;\33[3m&#x27;&#xA;end = &#x27;\33[m&#x27;&#xA;&#xA;try:&#xA;    from speech_recognition import AudioFile, Recognizer&#xA;except:&#xA;    run("pip3 install SpeechRecognition", shell=True)&#xA;    from speech_recognition import AudioFile, Recognizer&#xA;&#xA;def transcribe_piece(fname, lang, stime):&#xA;    extension = fname[-3:]&#xA;    etime = stime &#x2B; 15&#xA;    cmd = f"ffmpeg -ss {stime} -to {etime} -i {fname} -c copy trimmed.{extension} >/dev/null 2>&amp;1"&#xA;    run(cmd, shell=True)&#xA;    cmd = f"ffmpeg -i trimmed.{extension} -f wav trimmed.wav >/dev/null 2>&amp;1"&#xA;    run(cmd, shell=True)&#xA;    r = Recognizer()    &#xA;    af = AudioFile("trimmed.wav")&#xA;    with af as source:&#xA;        r.adjust_for_ambient_noise(source)&#xA;        audio = r.record(source)&#xA;        t = r.recognize_google(audio, language=lang)#UnknownValueError() speech_recognition.UnknownValueError&#xA;        print(f"{italic}{t}{end}")&#xA;        with open("of", "w") as f:&#xA;            f.write(f"{t}\n")&#xA;    run(f"rm trimmed.{extension}", shell=True) &#xA;    run(f"rm trimmed.wav", shell=True)&#xA;    &#xA;    &#xA;&#xA;fname = input("File name? Skip the path if the file is in CWD. The usage of ~ is allowed.\n")&#xA;&#xA;lang = input("""Specify one of the following languages:&#xA;fr-BE, fr-CA, fr-FR, fr-CH&#xA;&#xA;en-AU, en-CA, en-GH, en-HK, en-IN, en-IE, en-KE, en-NZ, en-PK, en-PH, en-SG, en-ZA, en-TZ, en-GB, en-US&#xA;&#xA;es-AR, es-BO, es-BO, es-CL, es-CO, es-CR, es-DO, es-EC, es-SV, es-SV, es-GT, es-HN, es-MX, es-NI, es-PA, es-PY, es-PE, es-PR, es-ES, es-US, es-UY, es-VE\n""")&#xA;&#xA;&#xA;#for stime in range(0, 10000, 15):&#xA;#    try:&#xA;#        transcribe_piece(fname, lang, stime)&#xA;#    except:&#xA;#        run("shred -u trimmed.wav" , shell=True) &#xA;        #run("shred -u trimmed.wav >/dev/null 2>&amp;1" , shell=True) &#xA;#        exit(0)&#xA;        &#xA;for stime in range(0, 10000, 15):#this loop is only for the sake of debugging, use try/except above&#xA;    transcribe_piece(fname, lang, stime)&#xA;&#xA;

    &#xA;

    It gives me the following error :

    &#xA;

    Traceback (most recent call last):&#xA;  File "/home/jim/CS/SoftwareDevelopment/MySoftware/Python/speech-to-text/long-audio-to-text.py", line 61, in <module>&#xA;    transcribe_piece(fname, lang, stime)&#xA;  File "/home/jim/CS/SoftwareDevelopment/MySoftware/Python/speech-to-text/long-audio-to-text.py", line 31, in transcribe_piece&#xA;    t = r.recognize_google(audio, language=lang)&#xA;  File "/home/jim/.local/lib/python3.10/site-packages/speech_recognition/__init__.py", line 858, in recognize_google&#xA;    if not isinstance(actual_result, dict) or len(actual_result.get("alternative", [])) == 0: raise UnknownValueError()&#xA;speech_recognition.UnknownValueError&#xA;&#xA;</module>

    &#xA;

    The said error refers to line 31, that is t = r.recognize_google(audio, language=lang).&#xA;Why do I get this error ? How might I rewrite this code so that such error does not appear ?

    &#xA;