
Recherche avancée
Autres articles (16)
-
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...) -
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)
Sur d’autres sites (3695)
-
node-fluent-ffmpeg conversion to mp3 does not fire any "end" or "finish" event
27 février 2024, par 1voyI am downloading a video using ytdl-core and converting it to mp3 using node-fluent-ffmpeg. It seems that the code after the ffmpeg conversion gets executed before the conversion finishes as trying to upload the .mp3 file to a Google Cloud Storage bucket throws an error. I am trying to detect 'end' or 'finish' events but none are being triggered.


Code :


ytdl(url?.toString() as string)
 .once('data', (data) => {
 console.log('start', data);
 })
 .on('progress', async function (progress, downloaded, total) {
 console.log(parseInt(((downloaded / total) * 100).toString()) + '%');
 
 })
 .on('finish', async function () {
 console.log('Download finished...');
 
 console.log('using ffmpeg to convert into mp3');
 Ffmpeg({ source: `/Users/user/project/server/output/${videoId}.mp4` })
 .setFfmpegPath(ffmpeg.path)
 .toFormat('mp3')
 .saveToFile(`/Users/user/project/server/output/${videoId}.mp3`)
 .on('finish', () => {
 console.log('finished conversion');
 });
 console.log('after ffmpeg mp3 conversion');

 const storage = new Storage({
 keyFilename: `./key.json`,
 });

 const bucketName = 'bucketname';
 const bucket = storage.bucket(bucketName);
 let mp3_url;
 console.log(
 fs.existsSync(`/Users/user/project/server/output/${videoId}.mp3`)
 ); // returns false
 bucket.upload(
 `/Users/user/project/server/output/${videoId}.mp3`,
// Error uploading: Error: ENOENT: no such file or directory, open '/Users/me/project/server/output/RMvenf7E-Dg.mp3'
 {
 destination: `${userId}/${videoId}.mp3`,
 },
 function (err, file) {
 if (err) {
 console.error(`Error uploading: ${err}`);
 } else {
 console.log(`mp3 uploaded to ${bucketName}.`);
 console.log(file?.publicUrl());
 }
 }
 );

 
 .pipe(
 fs.createWriteStream(`/Users/me/project/server/output/${videoId}.mp4`)
 );

 console.log('after download and conversion');

 req.on('close', async () => {
 res.end();
 });



Error uploading: Error: ENOENT: no such file or directory, open '/Users/polo/makeklips/server/output/RMvenf7E-Dg.mp3'
[1] /Users/me/project/server/node_modules/.pnpm/fluent-ffmpeg@2.1.2/node_modules/fluent-ffmpeg/lib/processor.js:182
[1] handleExit(new Error('ffmpeg exited with code ' + code));
[1] ^
[1] Error: ffmpeg exited with code 1: Output #0, mp3, to '/Users/me/project/server/output/RMvenf7E-Dg.mp3':
[1] Output file #0 does not contain any stream



-
prevent ffmpeg from opening console window
10 février 2020, par YesubI have a node/express server which is used to give streams from IP camera to a website. Everything is working well. I run that webserver with PM2 on a windows server.
The problem : for each stream I have a windows console opening with just nothing logged in. The console reopen when I try to close it.
Is there a way to prevent those console to open ?
Here is the related node.js code :
const { NodeMediaServer } = require('node-media-server');
private _initiate_streams(): void{
DatabaseProvider.instance.camerasDao.getCamerasList().pipe(
take(1)
).subscribe(
(databaseReadOperationResult: DatabaseReadOperationResult) => {
if (databaseReadOperationResult.successful === true){
const cameras = databaseReadOperationResult.result;
const tasks = [];
cameras.forEach( camera => {
tasks.push(
{
app : config.get('media_server.app_name'),
mode: 'static',
edge: camera.rtsp_url,
name: camera.stream_name,
rtsp_transport: 'tcp'
}
)
});
const configMediaServer = {
logType: 3, // 3 - Log everything (debug)
rtmp: {
port: 1935,
chunk_size: 60000,
gop_cache: true,
ping: 60,
ping_timeout: 30
},
http: {
port: config.get('media_server.port'),
allow_origin: '*'
},
auth: {
play: true,
api: true,
publish: true,
secret: config.get('salt'),
api_user: 'user',
api_pass: 'password',
},
relay: {
ffmpeg: 'C:\\FFmpeg\\bin\\ffmpeg.exe',
tasks: tasks
}
};
var nms = new NodeMediaServer(configMediaServer)
nms.run();
} else {
// catch exception
}
}
);
} -
Why does this ffmpeg,exe window keep opening when I run my command ?
5 avril 2020, par JohnI'm making a discord bot and for this aspect of the bot, I wanted it to play music in the voice channel. Here is my code for it :



@client.command(pass_context=True)
async def play(ctx, url: str):

 song_there = os.path.isfile("song.mp3")
 try:
 if song_there:
 os.remove("song.mp3")
 print("Removed old song file")
 except PermissionError:

 await ctx.send("`There's already a song playing, request your song after!`")
 return

 await ctx.send("`Getting your song ready...`")

 voice = get(client.voice_clients, guild=ctx.guild)

 ydl_opts = {
 'format': 'bestaudio/best',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }],
 }

 with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 try:
 print("Downloading audio now\n")
 ydl.download([url])
 except:
 await ctx.send("`Error, that was not a valid url.`")
 return

 for file in os.listdir("./"):
 if file.endswith(".mp3"):
 name = file
 os.rename(file, "song.mp3")

 voice.play(discord.FFmpegPCMAudio("song.mp3"), after=lambda e: print("Song done!"))
 await ctx.send("`Everything went well. Enjoy!`")
 voice.source = discord.PCMVolumeTransformer(voice.source)
 voice.source.volume = 0.07

 nname = name.rsplit("-", 2)
 await ctx.send(f"`Playing: {nname[0]}`")
 print("playing\n")




I got most of it from online sources to be honest. However, whenever someone plays a song, this pops up throughout the song download process. It can be seen here : https://imgur.com/a/iRr0qwj



I don't mind them coming up, but when they do, they override all of my other tabs and pop up so they're the main screen. I'd like for them to pop up in the background, if I can't remove them fully. Can anyone help ? This would be pretty unpractical for me for when multiple use the function, and I can't use my computer anymore (as of now the bot is ran on my computer) without constantly minimizing that screen.



I'm using windows 10, Python 3.7