
Recherche avancée
Médias (33)
-
Stereo master soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (63)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...)
Sur d’autres sites (10295)
-
Revision da9db83270 : Revert "Fill buffer speed up" This reverts commit 9b4f9f45eee4d63cef3cd10f24923
13 juillet 2015, par Jim BankoskiChanged Paths :
Modify /vp9/decoder/vp9_reader.c
Delete /vpx_util/endian_inl.h
Modify /vpx_util/vpx_util.mk
Revert "Fill buffer speed up"This reverts commit 9b4f9f45eee4d63cef3cd10f24923ed0bdd5ab7b.
Change-Id : I23545ac8c7464127f7466fc6a58de517874fe0cf
-
avfilter/vf_fillborders : add more fill modes
18 décembre 2020, par Paul B Mahol -
How to run ffmpeg as a subprocess and wait for the task to finish (fastapi)
4 octobre 2023, par leejhI'm creating a site that runs ffmpeg on the web using fastapi.


@router.post("/dir/Conver") 
async def ffmpeg_Conversion(request: Request):
 data = await request.json()

 file_path = data.get('file_path')
 saturation = float(data.get('saturation', 1.0)) 
 brightness = float(data.get('brightness', 0.0)) 
 contrast = float(data.get('contrast', 1.0))
 size = data.get('size','3840x2160')
 bitlayer = data.get('bitlayer',8000)
 codec = data.get('codec','libx264')
 formatstr=data.get('format','MP4')


 savepath = './UserFolder' + file_path

 directory = os.path.dirname(savepath)
 last_directory = os.path.basename(savepath)
 
 last_directory=str(last_directory).split('.')[0]
 print("last_directory : ---------------------" + last_directory)

 current_datetime = datetime.datetime.now()
 formatted_datetime = current_datetime.strftime('%Y-%m-%d-%H-%M-%S-%f')


 ffmpeg_command = [
 'ffmpeg',
 '-i', savepath,
 '-vf', f'eq=saturation={1+saturation/100}:brightness={brightness/100}:contrast={1+contrast/100}',
 '-s', size,
 '-c:v', codec,
 '-preset', 'medium',
 '-b:v', bitlayer,
 directory+'/'+last_directory+"_"+formatted_datetime+"."+formatstr
 ]

 subprocess.check_output(ffmpeg_command, text=True)




Using the code above, I created a function to convert the video.
And this function was given to a button on the web.


FileChan_yes.addEventListener('click', async () => { 
 startRotation();


 const file_path = 'path_to_your_file'; 
 const contrastValue = contrastSlider.value;
 const brightnessValue = lightnessSlider.value;
 const saturationValue = saturationSlider.value;

 const Dir=document.getElementById('last_action_link');
 const savepath = Dir.value;

 const codecDropValue = codecDrop.value; 
 const formatDropValue = formatDrop.value;
 const FileSizeDropValue = FileSizeDrop.value;
 const bitDropValue = bitDrop.value;


 try {
 const response = await fetch(`/dir/Conver`, {
 method: 'POST',
 headers: {
 'Content-Type': 'application/json'
 },
 body: JSON.stringify({
 file_path: savepath,
 saturation: saturationValue,
 brightness: brightnessValue,
 contrast: contrastValue,
 size: FileSizeDropValue,
 bitlayer : bitDropValue,
 codec : codecDropValue,
 formatstr : formatDropValue
 })
 
 });

 
 if (response.ok) {
 const result = await response.json();
 console.log("Conversion successful:", result);
 } else {
 throw new Error("Failed to convert the file.");
 }

 } catch (error) {
 console.error("Error converting the file:", error);
 } finally {
 stopRotation();
 }
 

 });




When you press the button, first
startRotation() ; the function is executed


When all tasks are completed, the stopRotation() ; function is configured to be executed.


But currently it's not working properly...


stopRotation() ; The function is executed as soon as the button is pressed.


await doesn't seem to work. What is the problem ?