Recherche avancée

Médias (91)

Autres articles (10)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • 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 : (...)

Sur d’autres sites (3322)

  • Write only last five minutes of audio to wav file with FFmpeg [closed]

    27 février 2023, par Bohdan Petrenko

    I'm making a voice recorder bot for Discord.

    


    I have a FFMpeg process that writes all received data to a .wav audio file. One file represents the voice of one user. And when the recording stops, I merge all the audios in one file.

    


    The problem is that the recording can take hours and more, so I need to keep only last five minutes of data on the disk. I don't know how to make FFmpeg do it. Maybe I need use circular buffers, but I don't know how they work in FFmpeg.

    


    I tried making circular buffer by myself, but ffmpeg says that data is corrupted and doesn't write any data.
I use .NET 6 and latest ffmpeg version.
I will be glad to see any help or advice.

    


  • Cannot install ffmpeg [closed]

    22 mai 2022, par Ashok M

    I'm trying to learn video processing using Python. For that, I tried installing one of two packages using Homebrew : ffmpeg and ImageMagick. After upgrading and updating Homebrew, I ran the command : brew update && brew install ffmpeg. Below is the error I got before some downloads started :

    


    ERROR :

    


    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun


    


    After all downloads completed, another error came up as shown below :

    


    Error: python@3.9: the bottle needs the Apple Command Line Tools to be installed.
  You can install them, if desired, with:
    xcode-select --install
You can try to install from source with:
  brew install --build-from-source python@3.9
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.


    


    I'm on MacOSx with Python 10.4 installed. Don't if that's making any difference to the installation. Thanks for any help.

    


  • Title : Getting "invalid_request_error" when trying to pass converted audio file to OpenAI API

    19 avril 2023, par Dummy Cron

    I am working on a project where I receive a URL from a webhook on my server whenever users share a voice note on my WhatsApp. I am using WATI as my WhatsApp API Provder

    


    The file URL received is in the .opus format, which I need to convert to WAV and pass to the OpenAI Whisper API translation task.

    


    I am trying convert it to .wav using ffmpeg, and pass it to the OpenAI API for translation processing.
However, I am getting an "invalid_request_error"

    


    import requests
import io
import subprocess
file_url = #.opus file url
api_key = #WATI API Keu

def transcribe_audio_to_text():
  # Fetch the audio file and convert to wav format

  headers = {'Authorization': f'Bearer {api_key}'}
  response = requests.get(file_url, headers=headers)
  audio_bytes = io.BytesIO(response.content)

  process = subprocess.Popen(['ffmpeg', '-i', '-', '-f', 'wav', '-acodec', 'libmp3lame', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
  wav_audio, _ = process.communicate(input=audio_bytes.read())

  # Set the Whisper API endpoint and headers
  WHISPER_API_ENDPOINT = 'https://api.openai.com/v1/audio/translations'
  whisper_api_headers = {'Authorization': 'Bearer ' + WHISPER_API_KEY,
                         'Content-Type': 'application/json'}
  print(whisper_api_headers)
  # Send the audio file for transcription

  payload = {'model': 'whisper-1'}
  files = {'file': ('audio.wav', io.BytesIO(wav_audio), 'audio/wav')}

  # files = {'file': ('audio.wav', io.BytesIO(wav_audio), 'application/octet-stream')}

  # files = {'file': ('audio.mp3', io.BytesIO(mp3_audio), 'audio/mp3')}
  response = requests.post(WHISPER_API_ENDPOINT, headers=whisper_api_headers, data=payload)
  print(response)
  # Get the transcription text
  if response.status_code == 200:
      result = response.json()
      text = result['text']
      print(response, text)
  else:
      print('Error:', response)
      err = response.json()
      print(response.status_code)
      print(err)
      print(response.headers)

transcribe_audio_to_text()


    


    Output :

    


    Error: <response>&#xA;400&#xA;{&#x27;error&#x27;: {&#x27;message&#x27;: "We could not parse the JSON body of your request. (HINT: This likely means you aren&#x27;t using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please send an email to support@openai.com and include any relevant code you&#x27;d like help with.)", &#x27;type&#x27;: &#x27;invalid_request_error&#x27;, &#x27;param&#x27;: None, &#x27;code&#x27;: None}}&#xA;</response>

    &#xA;