
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (64)
-
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...) -
Dépôt de média et thèmes par FTP
31 mai 2013, parL’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...) -
Activation de l’inscription des visiteurs
12 avril 2011, parIl est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)
Sur d’autres sites (6091)
-
avutil/x86/pixelutils : Empty MMX state in ff_pixelutils_sad_8x8_mmxext
1er novembre 2023, par Andreas Rheinhardtavutil/x86/pixelutils : Empty MMX state in ff_pixelutils_sad_8x8_mmxext
We currently mostly do not empty the MMX state in our MMX
DSP functions ; instead we only do so before code that might
be using x87 code. This is a violation of the System V i386 ABI
(and maybe of other ABIs, too) :
"The CPU shall be in x87 mode upon entry to a function. Therefore,
every function that uses the MMX registers is required to issue an
emms or femms instruction after using MMX registers, before returning
or calling another function." (See 2.2.1 in [1])
This patch does not intend to change all these functions to abide
by the ABI ; it only does so for ff_pixelutils_sad_8x8_mmxext, as this
function can by called by external users, because it is exported
via the pixelutils API. Without this, the following fragment will
assert (on x86/x64) :
uint8_t src1[8 * 8], src2[8 * 8] ;
av_pixelutils_sad_fn fn = av_pixelutils_get_sad_fn(3, 3, 0, NULL) ;
fn(src1, 8, src2, 8) ;
av_assert0_fpu() ;[1] : https://raw.githubusercontent.com/wiki/hjl-tools/x86-psABI/intel386-psABI-1.1.pdf
Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
Ffmpeg - transform mulaw 8000khz audio buffer data into valid bytes format
24 décembre 2023, par Bob LozanoI'm trying to read a bytes variable using ffmpeg, but the audio stream I listen to, sends me buffer data in mulaw encoded buffer like this :


https://github.com/boblp/mulaw_buffer_data/blob/main/buffer_data


I'm having trouble running the ffmpeg_read function from the transformers library found here :


def ffmpeg_read(bpayload: bytes, sampling_rate: int) -> np.array:
"""
Helper function to read an audio file through ffmpeg.
"""
ar = f"{sampling_rate}"
ac = "1"
format_for_conversion = "f32le"
ffmpeg_command = [
 "ffmpeg",
 "-i",
 "pipe:0",
 "-ac",
 ac,
 "-ar",
 ar,
 "-f",
 format_for_conversion,
 "-hide_banner",
 "-loglevel",
 "quiet",
 "pipe:1",
]

try:
 with subprocess.Popen(ffmpeg_command, stdin=subprocess.PIPE, stdout=subprocess.PIPE) as ffmpeg_process:
 output_stream = ffmpeg_process.communicate(bpayload)
except FileNotFoundError as error:
 raise ValueError("ffmpeg was not found but is required to load audio files from filename") from error
out_bytes = output_stream[0]
audio = np.frombuffer(out_bytes, np.float32)
if audio.shape[0] == 0:
 raise ValueError(
 "Soundfile is either not in the correct format or is malformed. Ensure that the soundfile has "
 "a valid audio file extension (e.g. wav, flac or mp3) and is not corrupted. If reading from a remote "
 "URL, ensure that the URL is the full address to **download** the audio file."
 )
return audio



But everytime I get :


raise ValueError(
 "Soundfile is either not in the correct format or is malformed. Ensure that the soundfile has "
 "a valid audio file extension (e.g. wav, flac or mp3) and is not corrupted. If reading from a remote "
 "URL, ensure that the URL is the full address to **download** the audio file."
)



If I grab any wav file I can do something like this :


import wave

with open('./emma.wav', 'rb') as fd:
 contents = fd.read()
 print(contents)



And running it through the function does work !


So my question would be :


How can I transform my mulaw encoded buffer data into a valid bytes format that works with
ffmpeg_read()
?

EDIT : I've found a way using pywav (https://pypi.org/project/pywav/)


# 1 stands for mono channel, 8000 sample rate, 8 bit, 7 stands 
for MULAW encoding
wave_write = pywav.WavWrite("filename.wav", 1, 8000, 8, 7)
wave_write.write(mu_encoded_data)

wave_write.close()



This is the result : https://github.com/boblp/mulaw_buffer_data/blob/main/filename.wav


the background noise is acceptable.


However, I want to use a FFMPEG instead to avoid creating a tmp file.


-
avcodec/hashtable : Only free buffer if there is buffer to free
3 juin, par Andreas Rheinhardt