
Recherche avancée
Autres articles (31)
-
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 (...) -
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 (...) -
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...)
Sur d’autres sites (5154)
-
Introducing Updates to the Funnels Feature
29 mai 2024, par Erin -
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");
 }
 });
 }
 
 }
}



-
FFMpeg C++ encoder fails with hardware acceleration quick sync intel
28 août 2022, par tealsI am trying to debug an issue I have with a simple C++ encoder using FFMmpeg. The following code below works correctly on these other hardware acceleration systems/platforms :


- 

- Mac/VideoToolbox,
- Cuda/NVEnc
- Raspberry pi/h264_v4l2m2m.








It fails on intel quick sync at
avcodec_open2
. I'm using Ubuntu 22.04. I built FFMpeg from source with the Intel Media SDK installed and configured. I verified that the QuickSync install works. I also have a corresponding decoder implementation that works correctly using intel quick sync. So I know everything properly installed. I am also running this on an 11th Gen Intel CPU.

[hevc_qsv @ 0x564b0d34f0c0] Low power mode is unsupported (This sometimes shows up)
[hevc_qsv @ 0x563691234000] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height



This is the only error that I get and I haven't found any helpful resources. I tried playing around with different parameters but nothing seems to work. Any help or insight would be extremely helpful.


bool VideoEncoder::create() {
 char const* outfile = filePath.c_str();

 // open output format context
 int ret = avformat_alloc_output_context2(&ofctx, nullptr, nullptr, outfile);
 if (ret < 0) {
 std::cerr << "fail to avformat_alloc_output_context2(" << outfile << "): ret=" << ret;
 return false;
 }

 // create new video stream
 const AVCodec* codec = avcodec_find_encoder_by_name(encoderName.c_str());
 vstrm = avformat_new_stream(ofctx, codec);
 if (!vstrm) {
 std::cerr << "fail to avformat_new_stream";
 return false;
 }

 // open video encoder
 cctx = avcodec_alloc_context3(codec);
 if (!vstrm) {
 std::cerr << "fail to avcodec_alloc_context3";
 return false;
 }
 const AVRational dst_fps = {fps, 1};
 cctx->width = width;
 cctx->height = height;
 if(pixel_format != AV_PIX_FMT_NONE) {
 cctx->pix_fmt = pixel_format;
 }
 else {
 cctx->pix_fmt = codec->pix_fmts[0];
 }
 cctx->time_base = av_inv_q(dst_fps);
 cctx->framerate = dst_fps;
 cctx->bit_rate = bitrate * 1000000;


 AVDictionary* options = nullptr;
 if(gpu_id >= 0) {
 av_dict_set_int(&options, "gpu", gpu_id, 0);
 }

 
 if (ofctx->oformat->flags & AVFMT_GLOBALHEADER)
 cctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 ret = avcodec_open2(cctx, codec, &options);
 if (ret < 0) {
 std::cerr << "fail to avcodec_open2: ret=" << ret;
 return false;
 }
 avcodec_parameters_from_context(vstrm->codecpar, cctx);

 //For mac/quicktime we need to add hvc1 tag.
 if (encoderName.find("hevc") != std::string::npos) {
 vstrm->codecpar->codec_tag = MKTAG('h', 'v', 'c', '1');
 }

 /*
 std::cout
 << "outfile: " << outfile << "\n"
 << "format: " << ofctx->oformat->name << "\n"
 << "vcodec: " << codec->name << "\n"
 << "size: " << width << 'x' << height << "\n"
 << "fps: " << av_q2d(cctx->framerate) << "\n"
 << "pixfmt: " << av_get_pix_fmt_name(cctx->pix_fmt) << "\n"
 << std::flush;*/

 // initialize sample scaler
 swsCtx = sws_getContext(
 width, height, AV_PIX_FMT_BGR24,
 width, height, cctx->pix_fmt,
 SWS_BILINEAR, nullptr, nullptr, nullptr);
 if (!swsCtx) {
 std::cerr << "fail to sws_getContext";
 return false;
 }

 // allocate frame buffer for encoding
 frame = av_frame_alloc();
 frame->width = width;
 frame->height = height;
 frame->format = static_cast<int>(cctx->pix_fmt);
 ret = av_frame_get_buffer(frame, 32);
 if (ret < 0) {
 std::cerr << "fail to av_frame_get_buffer: ret=" << ret;
 return false;
 }

 // allocate packet to retrive encoded frame
 pkt = av_packet_alloc();
 // open output IO context
 ret = avio_open2(&ofctx->pb, outfile, AVIO_FLAG_WRITE, nullptr, nullptr);
 if (ret < 0) {
 std::cerr << "fail to avio_open2: ret=" << ret;
 return false;
 }

 // write media container header (if any)
 ret = avformat_write_header(ofctx, nullptr);
 if (ret < 0) {
 std::cerr << "fail to avformat_write_header: ret=" << ret;
 return false;
 }

 return true;
}
</int>