
Recherche avancée
Autres articles (44)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (7722)
-
Discord.js "Error : FFMPEG not found" but I'm pretty sure I have it
21 février 2020, par Cole PerryI’m learning Discord.js and following this tutorial : https://discord.js.org/#/docs/main/stable/topics/voice . From the start, when I try to run- npm install ffmpeg-binaries I get a huge error message but it tells me to just use install ffmpeg so I did.
Here is my Index.js page(I’ve replaced my token with * here) :
const Discord = require('discord.js');
const Colesbot = new Discord.Client();
const token = '**********************************';
Colesbot.on('ready', () =>{
console.log('Slamsbot is online.');
})
Colesbot.on('message', msg=>{
if(msg.content == "What up bot?"){
msg.reply("Whats good pimp?")
}
});
Colesbot.on('message', message=>{
if (message.content === '/join') {
// Only try to join the sender's voice channel if they are in one themselves
if (message.member.voiceChannel) {
message.member.voiceChannel.join().then(connection => {
message.reply('I have successfully connected to the channel!');
}).catch(console.log);
} else {
message.reply('You need to join a voice channel first!');
}
}
});
//Event listener for new guild members
Colesbot.on('guildMemberAdd', member =>{
// Send the message to a designated channel on a server:
const channel = member.guild.channels.find(ch => ch.name === 'general');
// Do nothing if the channel wasn't found on this server
if (!channel) return;
// Send the message, mentioning the member
channel.send(`Welcome to the server, ${member}. Please use the bot-commands channel to assign yourself a role.`);
})
Colesbot.login(token);
exports.run = (client, message, args) => {
let user = message.mentions.users.first || message.author;
}If I type "/join" while not connected to a voice channel I get the proper message. However, if I try while I am I get this error message :
Error: FFMPEG not found
task_queues.js:94
message:"FFMPEG not found"
stack:"Error: FFMPEG not found\n at Function.selectFfmpegCommand (c:\Users\bobal\Documents\GitHub\Spotify-Playlist-Discord-bot\node_modules\prism-media\src\transcoders\ffmpeg\Ffmpeg.js:46:13)\n at new FfmpegTranscoder (c:\Users\bobal\Documents\GitHub\Spotify-Playlist-Discord-bot\node_modules\prism-media\src\transcoders\ffmpeg\Ffmpeg.js:7:37)\n at new MediaTranscoder (c:\Users\bobal\Documents\GitHub\Spotify-Playlist-Discord-bot\node_modules\prism-media\src\transcoders\MediaTranscoder.js:10:19)\n at new Prism (c:\Users\bobal\Documents\GitHub\Spotify-Playlist-Discord-bot\node_modules\prism-media\src\Prism.js:5:23)\n at new VoiceConnection (c:\Users\bobal\Documents\GitHub\Spotify-Playlist-Discord-bot\node_modules\discord.js\src\client\voice\VoiceConnection.js:46:18)\n at c:\Users\bobal\Documents\GitHub\Spotify-Playlist-Discord-bot\node_modules\discord.js\src\client\voice\ClientVoiceManager.js:63:22\n at new Promise (<anonymous>)\n at ClientVoiceManager.joinChannel (c:\Users\bobal\Documents\GitHub\Spotif...
</anonymous>So I went to that folder and the file Ffmpeg.js is there and here is its contents :
const ChildProcess = require('child_process');
const FfmpegProcess = require('./FfmpegProcess');
class FfmpegTranscoder {
constructor(mediaTranscoder) {
this.mediaTranscoder = mediaTranscoder;
this.command = FfmpegTranscoder.selectFfmpegCommand();
this.processes = [];
}
static verifyOptions(options) {
if (!options) throw new Error('Options not provided!');
if (!options.media) throw new Error('Media must be provided');
if (!options.ffmpegArguments || !(options.ffmpegArguments instanceof Array)) {
throw new Error('FFMPEG Arguments must be an array');
}
if (options.ffmpegArguments.includes('-i')) return options;
if (typeof options.media === 'string') {
options.ffmpegArguments = ['-i', `${options.media}`].concat(options.ffmpegArguments).concat(['pipe:1']);
} else {
options.ffmpegArguments = ['-i', '-'].concat(options.ffmpegArguments).concat(['pipe:1']);
}
return options;
}
/**
* Transcodes an input using FFMPEG
* @param {FfmpegTranscoderOptions} options the options to use
* @returns {FfmpegProcess} the created FFMPEG process
* @throws {FFMPEGOptionsError}
*/
transcode(options) {
if (!this.command) this.command = FfmpegTranscoder.selectFfmpegCommand();
const proc = new FfmpegProcess(this, FfmpegTranscoder.verifyOptions(options));
this.processes.push(proc);
return proc;
}
static selectFfmpegCommand() {
try {
return require('ffmpeg-binaries');
} catch (err) {
for (const command of ['ffmpeg', 'avconv', './ffmpeg', './avconv']) {
if (!ChildProcess.spawnSync(command, ['-h']).error) return command;
}
throw new Error('FFMPEG not found');
}
}
}
module.exports = FfmpegTranscoder;I also added ffmpeg to system path and it didn’t help :
C:\ffmpeg
C:\Users\bobal\Documents\GitHub\Spotify-Playlist-Discord-bot\ffmpegI’m not quite sure what to do from here. If you need any other info I’d be glad to give it.
-
Unable to livestream dynamically created data
18 mars 2020, par CaltropI’m trying to livestream dynamically created data on youtube using ffmpeg and node.js.
The example below is supposed to stream random noise, however it just throws errors and doesn’t quite work.
const height = 512,
width = 512,
cp = require('child_process'),
command = `cd ffmpeg/bin && ffmpeg -hide_banner -f rawvideo -pix_fmt rgb24 -s ${width}x${height} -i - rtmp://a.rtmp.youtube.com/live2/${loginCredentials.streamKey}`,
proc = cp.spawn(command, [], { shell: true });
(f = () => {
setTimeout(f, 1000/60);
const data = new Uint8ClampedArray(width * height * 3).map(()=>Math.random()*255);
proc.stdin.write(Buffer.from(data));
})();
proc.stderr.pipe(process.stdout);Apologies, I’m quite inexperienced with ffmpeg
edit : full log below
Input #0, rawvideo, from 'pipe:':
Duration: N/A, start: 0.000000, bitrate: 157286 kb/s
Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 512x512, 157286 kb/s, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
events.js:174
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at afterWriteDispatched (internal/stream_base_commons.js:78:25)
at writevGeneric (internal/stream_base_commons.js:67:3)
at Socket._writeGeneric (net.js:711:5)
at Socket._writev (net.js:720:8)
at doWrite (_stream_writable.js:413:12)
at clearBuffer (_stream_writable.js:522:5)
at onwrite (_stream_writable.js:470:7)
at WriteWrap.afterWrite [as oncomplete] (net.js:800:19)
Emitted 'error' event at:
at errorOrDestroy (internal/streams/destroy.js:107:12)
at onwriteError (_stream_writable.js:430:5)
at onwrite (_stream_writable.js:461:5)
at _destroy (internal/streams/destroy.js:49:7)
at Socket._destroy (net.js:613:3)
at Socket.destroy (internal/streams/destroy.js:37:8)
at afterWriteDispatched (internal/stream_base_commons.js:78:17)
at writevGeneric (internal/stream_base_commons.js:67:3)
at Socket._writeGeneric (net.js:711:5)
at Socket._writev (net.js:720:8) -
Libav (ffmpeg) HW decoding problem with frames at the end of file - missing or corrupted
25 mars 2020, par HitokageMy goal is to utilize HW accelerated decoding (using vdpau, h265 and Nvidia RTX) getting number of frames from video. Everything works unless the frames get to the end of the video. I am getting less frames than I try to decode usually the last but one is missing (I know strange, the last one is OK just not getting all of them) and sometimes neighboring frames are corrupted. I followed the docs regarding end of file situation. Here is the code :
//getting first packet
if (!packet.data)
av_read_frame(formatContext, & packet);
AVFrame * frame = av_frame_alloc();
if (!frame)
throw std::runtime_error("Cannot allocate packet/frame");
//now trying to get frames from the video
for (int i = 0; i < number; i++) {
int err = 0;
//feeding the codec
while (err == 0) {
if (packet.stream_index == videoStreamId)
if ((err = avcodec_send_packet(codecContext, & packet)) != 0)
break;
av_packet_unref( & packet);
err = av_read_frame(formatContext, & packet);
//sending null packet to flush the buffers
if (err == AVERROR_EOF) {
packet.data = NULL;
packet.size = 0;
}
}
bool waitForFrame = true;
while (waitForFrame) {
int err = avcodec_receive_frame(codecContext, frame);
if (err == AVERROR_EOF)
waitForFrame = false;
else if (err < 0)
throw std::runtime_error("Cannot receive frame");
if (frame -> format == pixFmt)
//I get here only number-1 timesPlease note that the problem is happening only when I request the same number of frames as is the length of the video. Seems like the end of file situation is not handled properly. The frames get decoded ok if I try to get for example length-1 frames.
I also tried to log the events and everything looks OK, just one frame is not there. This is a case where 64 frames long video is being decoded asking for 64 frames :
Send packet 0 == 0
Read frame status: Success
Send packet 1 == 0
Read frame status: Success
Send packet 2 == 0
Read frame status: Success
Send packet 3 == 0
Read frame status: Success
Send packet 4 !=0
Send packet status: Resource temporarily unavailable
Processing frame:0
Send packet 4 !=0
Send packet status: Resource temporarily unavailable
Processing frame:1
Send packet 4 == 0
Read frame status: Success
Send packet 5 == 0
Read frame status: Success
Send packet 6 !=0
Send packet status: Resource temporarily unavailable
Processing frame:2
Send packet 6 !=0
Send packet status: Resource temporarily unavailable
Processing frame:3
...
Processing frame:56
Send packet 60 !=0
Send packet status: Resource temporarily unavailable
Processing frame:57
Send packet 60 == 0
Read frame status: Success
Send packet 61 == 0
Read frame status: Success
Send packet 62 !=0
Send packet status: Resource temporarily unavailable
Processing frame:58
Send packet 62 !=0
Send packet status: Resource temporarily unavailable
Processing frame:59
Send packet 62 == 0
Read frame status: Success
Send packet 63 == 0
Read frame status: End of file
Set null packet
Processing frame:60
Send packet 64 == 0
Read frame status: End of file
Set null packet
Processing frame:61
Send packet 65 !=0
Send packet status: End of file
Processing frame:62
Send packet 65 !=0
Send packet status: End of file
End of file at receive frame