
Recherche avancée
Médias (2)
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
Autres articles (103)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)
Sur d’autres sites (6930)
-
OpenAI Whisper : FileNotFoundError : [WinError 2] The system cannot find the file specified
16 décembre 2023, par AlexI'm not the first to get this error, however, all previous answers relate to ffmpeg not installed. As you can see, I installed ffmpeg so not sure why i still get this error. Moreover, this code works perfectly fine in Google Colab but not in Spyder.


pip install tiktoken

pip install -U openai-whisper

pip install ffmpeg

pip install setuptools-rust

import whisper

model = whisper.load_model("medium")

result = model.transcribe("F:/iim/dahl/01.Projects/20231215_Schlueter/02.Code/01.Data/The Investors Everybody Ignored ft Sallie Krawcheck Whats Your Problem Jacob Goldstein.mp3")
print(result["text"])



 Cell In[13], line 1
 result = model.transcribe("F:/iim/dahl/01.Projects/20231215_Schlueter/02.Code/01.Data/The Investors Everybody Ignored ft Sallie Krawcheck Whats Your Problem Jacob Goldstein.mp3/")

 File F:\iim\dahl\00.Anaconda\Lib\site-packages\whisper\transcribe.py:122 in transcribe
 mel = log_mel_spectrogram(audio, model.dims.n_mels, padding=N_SAMPLES)

 File F:\iim\dahl\00.Anaconda\Lib\site-packages\whisper\audio.py:140 in log_mel_spectrogram
 audio = load_audio(audio)

 File F:\iim\dahl\00.Anaconda\Lib\site-packages\whisper\audio.py:58 in load_audio
 out = run(cmd, capture_output=True, check=True).stdout

 File F:\iim\dahl\00.Anaconda\Lib\subprocess.py:548 in run
 with Popen(*popenargs, **kwargs) as process:

 File F:\iim\dahl\00.Anaconda\Lib\site-packages\spyder_kernels\customize\spydercustomize.py:109 in __init__
 super(SubprocessPopen, self).__init__(*args, **kwargs)

 File F:\iim\dahl\00.Anaconda\Lib\subprocess.py:1026 in __init__
 self._execute_child(args, executable, preexec_fn, close_fds,

 File F:\iim\dahl\00.Anaconda\Lib\subprocess.py:1538 in _execute_child
 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden




-
how to apostrophe with os.system in ffmpeg drawtext in python
28 septembre 2023, par Ishu singhI just want to execute this code with os.system('command') in ffmpeg drawtext() but unable to execute it just because of ' (apostrophe) , it fails


The code goes here ->


the \f is working as \n but I'm using that for seprating word


from PIL import ImageFont
import os

def create_lines(longline, start, end, fontsize=75, fontfile='OpenSansCondensedBold.ttf'):

 fit = fit_text(longline, 700, fontfile)

 texts = []
 now = 0
 # breaking line on basis of '\f'
 for wordIndex in range(len(fit)):
 if fit[wordIndex] == '\f' or wordIndex == len(fit)-1:
 texts.append(fit[now:wordIndex+1].strip('\f'))
 now = wordIndex

 # adding multiple lines to video
 string = ''
 count = 0
 for line in texts:
 string += f''',drawtext=fontfile={fontfile}:fontsize={fontsize}:text='{line[enter image description here](https://i.stack.imgur.com/iuceq.png)}':fontcolor=black:bordercolor=white:borderw=4:x=(w-text_w)/2:y=(h-text_h)/2-100+{count}:'enable=between(t,{start},{end})' '''
 count += 100

 print(string)
 return string

def createVideo(content):
 input_video = 'video.mp4'
 output_video = 'output.mp4'
 font_file = 'BebasKai.ttf'
 text_file = 'OpenSansCondensedBold.ttf'
 font_size = 75
 font_color = 'white'

 part1 = create_lines(content[1], 0.5, 7)
 part2 = create_lines(content[2], 7.5, 10)

 os.system(
 f"""ffmpeg -i {} -vf "drawtext=fontfile={font_file}:fontsize={95}:text={content[0]}:fontcolor={font_color}:box=1:boxcolor=black@0.9:boxborderw=20:x=(w-text_w)/2:y=(h-text_h)/4-100{str(part1)}{str(part2)}" -c:v libx264 -c:a aac -t 10 {output_video} -y""")

my_text =['The Brain', "Your brain can't multitask effectively", "Multitasking is a myth, it's just rapid switching between tasks"]

createVideo(my_text)





what I want is that, I would able to execute this correctly


-
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);

}









-