
Recherche avancée
Autres articles (74)
-
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 (...) -
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 -
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 (...)
Sur d’autres sites (9081)
-
build video from images with a bash for loop using ffmpeg
10 septembre 2021, par TheCodeNoviceI am trying to take 50K images and turn them into a movie using ffmpeg. I am running this on a HPC setup, hence the slurm commands. My attempt does not work since I am running into a hard limit due to the shear volume of images. I cannot just list a start number since the pipeline will reject some images so I do not have a proper sequence.


I know a loop could circumvent both issues but I am not sure how to use that with ffmpeg so that it builds one long movie.


The cat command has worked for shorter movies but i just have too many images now.


#!/bin/bash

img_dir='foo/bar/1/2/123456'
folder='fooo'
#BATCH -p general
#SBATCH -N 1
#SBATCH -t 03-00:00:00
#SBATCH --mem=8g
#SBATCH -n 1
#SBATCH --mail-type=BEGIN,REQUEUE,END,FAIL,REQUEUE 
#SBATCH --mail-user=<snip>

singularity exec /$img_dir/foo_container cat /$img_dir/processed_images/$folder/*.jpeg | ffmpeg -f image2pipe -i pipe:.jpeg -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" /$img_dir/processed_images/$folder/$folder.mp4

</snip>


-
ffmpeg audio convert not working
11 janvier 2012, par AndrewI cannot get the ffmpeg audio convert working on my site. The idea is that file should be converted when it's uploaded on the site.
I've got this on my upload form determining the audio file's format :
if(isset($_POST['audio']) && $_POST['audio'] != ''){
$ext1 = substr($_POST['audio'], -4);This is the best I've come up with for converting m4a to mp3 :
if(isset($_POST['audio']) && $_POST['audio'] != ''){ $file = $_POST['audio']; if($ext1==".m4a"){ $call="/usr/local/bin/ffmpeg -i ".$file." -ab 192k -f -acodec mp3";}
$convert = (popen("start /b ".$call, "r")); pclose($convert);The problem is, it won't convert. The path to ffmpeg is correct.
Now I may be way over my head with this one, but if there's a simple solution for this, I'd love to hear it.
EDIT.
With this :
if(isset($_POST['audio']) && $_POST['audio'] != ''){
$file = $_POST['audio'];
$ext1 = substr($_POST['audio'], -4); /*get the last 4 chars*/
$mp3 = echo 'mp3';
if($ext1=".m4a"){
"/usr/local/bin/ffmpeg -i \"". $file . "\" -ab 192k -y -f mp3 \"".ext1.$mp3."\"";
}
}I think I'm right on the money with conversion itself, but the form just loads infinitly when submitted. So I'm guessing the conversion is happening, but the form does not know when it's done. Any ideas on that ?
-
Discord bot stop playing music in random time of song
25 janvier 2021, par JusmejtrI have a discord to let me play a random song from the list.


How bot works :
Bot IS connected to firestore Cloud (firebase) where i have economy data from my server. Price for playing random song is 75 coins.


Everything worked as it should, but yesterday I used command, the bot started playing and after a while it stopped playing music and also no other commands worked, bot probably get freezed.


I have no errors in the console until after a minute it showed me this error.




The bot is hosted on Heroku and I also added this buildpack to ffmpeg in the settings.


https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest


This is my code :


module.exports = {
 name: "buy-music",
 description: "buy a music",

 async execute(message, config, db){
 const PREFIX = (config.prefix);

 if(message.content === PREFIX + "buy music"){
 const ytdl = require("ytdl-core");
 message.delete();
 let uzivatel = message.author.tag;

 let voiceChannel = message.member.voice.channel;
 if(!voiceChannel) return message.reply("Musíš byť vo voice roomke");

 let cena = 75;
 
 db.collection('economy').doc(uzivatel).get().then(async (q) => {
 if(!q.exists) return message.reply("Nemáš vytvorený účet");
 var hodnota = q.data().money;
 if(hodnota < cena) return message.reply("Nemáš dostatok financií");

 db.collection('statusy').doc('music').get().then(async (asaj) => {
 let stav = asaj.data().stav;
 if(stav == "off"){
 db.collection('statusy').doc('music').update({
 "stav": "on",
 "autor": message.author.tag,
 });
 hodnota -= cena;
 db.collection('economy').doc(uzivatel).update({
 'money': hodnota
 });
 function randomhraj(){
 var pole = [
 My YT links

 ]
 let rnd = Math.floor(Math.random() * pole.length);
 let output = pole[rnd];
 return output;
 }
 
 try{
 var pripojenie = await voiceChannel.join();
 message.reply(`Úspešne si si kúpil chuťovečku`);
 }catch(error){
 console.log(`Error pri pripajani do room (music join) ${error}`);
 }
 
 const dispatcher = pripojenie.play(ytdl(randomhraj())).on("finish", async() => {
 await voiceChannel.leave();
 await db.collection('statusy').doc('music').update({
 "stav": "off",
 "autor": "nikto",
 });
 }).on("error", error => {
 console.log(error)
 })
 dispatcher.setVolumeLogarithmic(5 / 5)
 }else{
 message.reply("Momentálne si hudbu kúpil niekto iný alebo ak si hudbu kúpil a chceš ju zastaviť použi príkaz *stop");
 }
 
 });
 });
 
 }else if(message.content === PREFIX + "stop"){
 message.delete();
 db.collection('statusy').doc('music').get().then((n) => {
 let kto = n.data().autor;
 let meno = message.author.tag;
 if(!message.member.voice.channel) return message.channel.send("Musíš byť vo voice roomke pre stopnutie hudby");
 if(kto == meno){
 message.member.voice.channel.leave();
 message.channel.send("Úspešne odpojený");
 db.collection('statusy').doc('music').update({
 "stav": "off",
 "autor": "nikto",
 });
 }else{
 message.reply("Zastaviť hudbu môže len ten kto si ju kúpil");
 }
 });
 }
 
 }
}