
Recherche avancée
Autres articles (69)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit 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 (6876)
-
FFMPEG : How to extract multichannel track from m4v, mix it down and save the stereo downmix as "left" and "right" ?
1er juin 2017, par chillynillyjust like the title already says : I want to extract a multichannel track (5.1) from an .m4v, mix this track down and save the output as separate files, so in the end I want to have something like ’downmix_left.wav’ and ’downmix_right.wav’
I know how to do a downmix and I know how to split the audio, but I do not know how to do it in one step, which would save me a lot of time.This is the command I use for splitting :
ffmpeg -i "video.m4v" -vn -filter_complex \
"[0:2]channelsplit=channel_layout=5.1(side)[FL][FR][FC][LFE][SL][SR]" \
-map "[FL]" video_left.wav \
-map "[FR]" video_right.wav \
-map "[FC]" video_center.wav \
-map "[LFE]" video_lfe.wav \
-map "[SL]" video_back_left.wav \
-map "[SR]" video_back_right.wavAnd this is the command for the downmix of a multichannel track :
ffmpeg -i "video.m4v" -vn -map 0:2 -ac 2 \
-af "aresample=matrix_encoding=dplii" video_downmix.wavIs it possible to combine these and if so, how can it be done :D ? I would appreciate it very much if you could help me out here.
-
FFMPEG : How to extract multichannel track from m4v, mix it down and save the stereo downmix as "left" and "right" ?
30 septembre 2015, par chillynillyjust like the title already says : I want to extract a multichannel track (5.1) from an .m4v, mix this track down and save the output as separate files, so in the end I want to have something like ’downmix_left.wav’ and ’downmix_right.wav’
I know how to do a downmix and I know how to split the audio, but I do not know how to do it in one step, which would save me a lot of time.This is the command I use for splitting :
ffmpeg -i "video.m4v" -vn -filter_complex \
"[0:2]channelsplit=channel_layout=5.1(side)[FL][FR][FC][LFE][SL][SR]" \
-map "[FL]" video_left.wav \
-map "[FR]" video_right.wav \
-map "[FC]" video_center.wav \
-map "[LFE]" video_lfe.wav \
-map "[SL]" video_back_left.wav \
-map "[SR]" video_back_right.wavAnd this is the command for the downmix of a multichannel track :
ffmpeg -i "video.m4v" -vn -map 0:2 -ac 2 \
-af "aresample=matrix_encoding=dplii" video_downmix.wavIs it possible to combine these and if so, how can it be done :D ? I would appreciate it very much if you could help me out here.
-
Save FFMpeg conversion to PHP variable vs. File System for use with Whisper API ?
13 avril 2023, par SScottiI just started working on a little demo to transalte audio captured from the front-end as audio/webm using JS and then sent the back-end in a Laravel App. I guess there are JS libraries that can handle the conversion, but I'd rather use a server side solution with FFMPEG, which I am doing.


The backend code is below. It seems to be working after playing around with the PHP composer package that I'm using vs. one for Laravel that is also there. I'd rather use this one because I have other PHP apps that are not Laravel.


Questions :


- 

-
With the FFMpeg library, is there a way to capture the converted .mp3 file to a PHP variable in the script rather than saving it to the file system and then reading it back in later ?


-
For the OpenAI call, I'd like to catch exceptions there also. I just sort of have a placeholder there for now.


protected function whisper(Request $request) {

 $yourApiKey = getenv('OPENAI_API_KEY');
 $client = OpenAI::client($yourApiKey);

 $file = $request->file('file');
 $mimeType = $request->file('file')->getMimeType();
 $audioContents = $file->getContent();

 try {

 FFMpeg::open($file)
 ->export()
 ->toDisk('public')
 ->inFormat(new \FFMpeg\Format\Audio\Mp3)
 ->save('song_converted.mp3');
 }
 catch (EncodingException $exception) {
 $command = $exception->getCommand();
 $errorLog = $exception->getErrorOutput();
 }

 $mp3 = Storage::disk('public')->path('song_converted.mp3');
 try {
 $response = $client->audio()->transcribe([
 'model' => 'whisper-1',
 'file' => fopen($mp3, 'r'),
 'response_format' => 'verbose_json',
 ]);
 }
 catch (EncodingException $exception) {
 $command = $exception->getCommand();
 $errorLog = $exception->getErrorOutput();
 }

 echo json_encode($response);

}









-