Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (80)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (6046)

  • How to transcribe the recording for speech recognization

    29 mai 2021, par DLim

    After downloading and uploading files related to the mozilla deeepspeech, I started using google colab. I am using mozilla/deepspeech for speech recognization. The code shown below is for recording my audio. After recording the audio, I want to use a function/method to transcribe the recording into text. Everything compiles, but the text does not come out correctly. Any thoughts in my code ?

    


    """&#xA;To write this piece of code I took inspiration/code from a lot of places.&#xA;It was late night, so I&#x27;m not sure how much I created or just copied o.O&#xA;Here are some of the possible references:&#xA;https://blog.addpipe.com/recording-audio-in-the-browser-using-pure-html5-and-minimal-javascript/&#xA;https://stackoverflow.com/a/18650249&#xA;https://hacks.mozilla.org/2014/06/easy-audio-capture-with-the-mediarecorder-api/&#xA;https://air.ghost.io/recording-to-an-audio-file-using-html5-and-js/&#xA;https://stackoverflow.com/a/49019356&#xA;"""&#xA;from google.colab.output import eval_js&#xA;from base64 import b64decode&#xA;from scipy.io.wavfile import read as wav_read&#xA;import io&#xA;import ffmpeg&#xA;&#xA;AUDIO_HTML = """&#xA;<code class="echappe-js">&lt;script&gt;&amp;#xA;var my_div = document.createElement(&quot;DIV&quot;);&amp;#xA;var my_p = document.createElement(&quot;P&quot;);&amp;#xA;var my_btn = document.createElement(&quot;BUTTON&quot;);&amp;#xA;var t = document.createTextNode(&quot;Press to start recording&quot;);&amp;#xA;&amp;#xA;my_btn.appendChild(t);&amp;#xA;//my_p.appendChild(my_btn);&amp;#xA;my_div.appendChild(my_btn);&amp;#xA;document.body.appendChild(my_div);&amp;#xA;&amp;#xA;var base64data = 0;&amp;#xA;var reader;&amp;#xA;var recorder, gumStream;&amp;#xA;var recordButton = my_btn;&amp;#xA;&amp;#xA;var handleSuccess = function(stream) {&amp;#xA;  gumStream = stream;&amp;#xA;  var options = {&amp;#xA;    //bitsPerSecond: 8000, //chrome seems to ignore, always 48k&amp;#xA;    mimeType : &amp;#x27;audio/webm;codecs=opus&amp;#x27;&amp;#xA;    //mimeType : &amp;#x27;audio/webm;codecs=pcm&amp;#x27;&amp;#xA;  };            &amp;#xA;  //recorder = new MediaRecorder(stream, options);&amp;#xA;  recorder = new MediaRecorder(stream);&amp;#xA;  recorder.ondataavailable = function(e) {            &amp;#xA;    var url = URL.createObjectURL(e.data);&amp;#xA;    var preview = document.createElement(&amp;#x27;audio&amp;#x27;);&amp;#xA;    preview.controls = true;&amp;#xA;    preview.src = url;&amp;#xA;    document.body.appendChild(preview);&amp;#xA;&amp;#xA;    reader = new FileReader();&amp;#xA;    reader.readAsDataURL(e.data); &amp;#xA;    reader.onloadend = function() {&amp;#xA;      base64data = reader.result;&amp;#xA;      //console.log(&quot;Inside FileReader:&quot; &amp;#x2B; base64data);&amp;#xA;    }&amp;#xA;  };&amp;#xA;  recorder.start();&amp;#xA;  };&amp;#xA;&amp;#xA;recordButton.innerText = &quot;Recording... press to stop&quot;;&amp;#xA;&amp;#xA;navigator.mediaDevices.getUserMedia({audio: true}).then(handleSuccess);&amp;#xA;&amp;#xA;&amp;#xA;function toggleRecording() {&amp;#xA;  if (recorder &amp;amp;&amp;amp; recorder.state == &quot;recording&quot;) {&amp;#xA;      recorder.stop();&amp;#xA;      gumStream.getAudioTracks()[0].stop();&amp;#xA;      recordButton.innerText = &quot;Saving the recording... pls wait!&quot;&amp;#xA;  }&amp;#xA;}&amp;#xA;&amp;#xA;// https://stackoverflow.com/a/951057&amp;#xA;function sleep(ms) {&amp;#xA;  return new Promise(resolve =&gt; setTimeout(resolve, ms));&amp;#xA;}&amp;#xA;&amp;#xA;var data = new Promise(resolve=&gt;{&amp;#xA;//recordButton.addEventListener(&quot;click&quot;, toggleRecording);&amp;#xA;recordButton.onclick = ()=&gt;{&amp;#xA;toggleRecording()&amp;#xA;&amp;#xA;sleep(2000).then(() =&gt; {&amp;#xA;  // wait 2000ms for the data to be available...&amp;#xA;  // ideally this should use something like await...&amp;#xA;  //console.log(&quot;Inside data:&quot; &amp;#x2B; base64data)&amp;#xA;  resolve(base64data.toString())&amp;#xA;&amp;#xA;});&amp;#xA;&amp;#xA;}&amp;#xA;});&amp;#xA;      &amp;#xA;&lt;/script&gt;&#xA;"""&#xA;&#xA;def get_audio() :&#xA;  display(HTML(AUDIO_HTML))&#xA;  data = eval_js("data")&#xA;  binary = b64decode(data.split(',')[1])&#xA;  &#xA;  process = (ffmpeg&#xA;    .input('pipe:0')&#xA;    .output('pipe:1', format='wav')&#xA;    .run_async(pipe_stdin=True, pipe_stdout=True, pipe_stderr=True, quiet=True, overwrite_output=True)&#xA;  )&#xA;  output, err = process.communicate(input=binary)&#xA;  &#xA;  riff_chunk_size = len(output) - 8&#xA;  # Break up the chunk size into four bytes, held in b.&#xA;  q = riff_chunk_size&#xA;  b = []&#xA;  for i in range(4) :&#xA;      q, r = divmod(q, 256)&#xA;      b.append(r)&#xA;&#xA;  # Replace bytes 4:8 in proc.stdout with the actual size of the RIFF chunk.&#xA;  riff = output[:4] + bytes(b) + output[8 :]&#xA;&#xA;  sr, audio = wav_read(io.BytesIO(riff))&#xA;&#xA;  return audio, sr&#xA;&#xA;audio, sr = get_audio()&#xA;

    &#xA;

    def recordingTranscribe(audio):&#xA;  data16 = np.frombuffer(audio)&#xA;  return model.stt(data16)&#xA;

    &#xA;

    recordingTranscribe(audio)&#xA;

    &#xA;

  • Django Celery FFMPEG : convert video files

    3 janvier 2012, par sultan

    I'm trying to convert video files using FFMPEG via Celery tasks. The generated command to be executed looks like

    ffmpeg -i /path/to/flv -ar 22050 -ab 96k -r 24 -b 600k -f flv path/to/flv/transcoded/flv_movie.flv

    and when I call the task TranscodeVideoTask.delay(src=filepath, dst=destination_path)
    I get flv_movie.flv file but its size is only about 200Kb and debug output

    Press [q] to stop, [?] for help
    [h264 @ 0x10205a200] Reference 3 >= 3
    [h264 @ 0x10205a200] error while decoding MB 7 5, bytestream (690)
    [h264 @ 0x10205a200] concealing 762 DC, 762 AC, 762 MV errors
    frame=   40 fps=  0 q=2.0 Lsize=     136kB time=00:00:01.66 bitrate= 668.2kbits/s dup=0 drop=9    
    video:114kB audio:20kB global headers:0kB muxing overhead 1.814991%

    TranscodeVideoTask source

    @task(name="transcode.media")
    def TranscodeVideoTask(src, dst):
       command = commands.get("flv") % {"src": src, "dst": dst}
       os.system(src, dst)
       filename = os.path.join(dst, "flv_movie.flv")
       YamdiInjector.yamdi(filename, dst)

    When the same command executed manually in the console it works just fine.

    UPDATE
    So far I've composed the following ffmpeg instructions in my bash file and it converts almost every avi file I tested already

    #!/bin/sh
    INPUT=$1
    OUTPUT=$2/flv_movie.flv

    echo "Input file: ${INPUT}"
    echo "Output file: ${OUTPUT}"
    echo `ffmpeg -y -i $INPUT -ar 44100 -ab 128k -ac 2 -sameq -f flv $OUTPUT`

    What may cause this strange problem ?

    Sultan

  • FFMPEG conversion to MXF [closed]

    16 février 2012, par MFB

    I have to wrap an MPEG2 video file in an MXF container and convert the audio in the process. I have the MXF wrapping working but it won't convert the audio stream (which needs to be 16bit, 48kHz Linear PCM).

    Here's what I'm trying :

    ffmpeg -i input.mpg -map 0:0 -map 0:1 -vcodec copy -f mpeg2video -acodec pcm_s16le -ar 48000 -ac 2 output.mxf

    Results :

    ffmpeg version 0.10 Copyright (c) 2000-2012 the FFmpeg developers
     built on Jan 30 2012 17:49:23 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
     configuration: *{snipped}*
    runtime-cpudetect
     libavutil      51. 34.101 / 51. 34.101
     libavcodec     53. 60.100 / 53. 60.100
     libavformat    53. 31.100 / 53. 31.100
     libavdevice    53.  4.100 / 53.  4.100
     libavfilter     2. 60.100 /  2. 60.100
     libswscale      2.  1.100 /  2.  1.100
     libswresample   0.  6.100 /  0.  6.100
     libpostproc    52.  0.100 / 52.  0.100
    [mpeg @ 0x10201ae00] max_analyze_duration 5000000 reached at 5000000
    Input #0, mpeg, from &#39;/Volumes/Extra/test.mpg&#39;:
     Duration: 00:00:59.97, start: 0.192911, bitrate: 6513 kb/s
       Stream #0:0[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
       Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 12000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Output #0, mpeg2video, to &#39;video.mxf&#39;:
     Metadata:
       encoder         : Lavf53.31.100
       Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=2-31, 12000 kb/s, 25 fps, 90k tbn, 25 tbc
    Stream mapping:
     Stream #0:1 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    frame= 1500 fps=  0 q=-1.0 Lsize=   43949kB time=00:00:59.96 bitrate=6004.6kbits/s    
    video:43949kB audio:0kB global headers:0kB muxing overhead 0.000000%

    The video plays fine as the MXF, but there is no audio stream at all. Any help would be great.