
Recherche avancée
Médias (3)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (76)
-
Organiser par catégorie
17 mai 2013, parDans 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, parUtilité
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 (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users.
Sur d’autres sites (7030)
-
Title : Getting "invalid_request_error" when trying to pass converted audio file to OpenAI API
19 avril 2023, par Dummy CronI 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>
400
{'error': {'message': "We could not parse the JSON body of your request. (HINT: This likely means you aren'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'd like help with.)", 'type': 'invalid_request_error', 'param': None, 'code': None}}
</response>


-
How to convert video from mov to mp4 video format through FFMPEG integration in android [closed]
28 septembre 2012, par Sanat PandeyI have a problem that I received a video file from the server which can not be played throgh video view from the app I am making. I don't know what the actaul problem is because all videos are played through same video view but the video received from the server side is not played. So, I think that I have to integrate FFMPEG in our android app, so I can play every video at a runtime conversion. For this I have read much more about FFMPEG Library integration with android through many sites as :
http://www.roman10.net/how-to-build-android-applications-based-on-ffmpeg-by-an-example/
Downloaded some projects from GitHUb (https://github.com/appunite/AndroidFFmpeg) but unable to succeed for building the Library through NDK. Some thing I missed and I am working on Windows machine, probably this might be a problem. I want the exact solution regarding this, means step by step solution for building the android project with FFMPEG Library. If you have some useful suggestion then please share with me.Thanks in advance.
-
Will ffmpeg and moviepy run seamlessly on android ? [closed]
5 février 2024, par RidolaI am building an android and IOS app in KIVY and i am trying to compress a video along other processing using python so I want to ask if moviepy is compatible ?