Recherche avancée

Médias (1)

Mot : - Tags -/vidéo

Autres articles (46)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • MediaSPIP Player : problèmes potentiels

    22 février 2011, par

    Le lecteur ne fonctionne pas sur Internet Explorer
    Sur Internet Explorer (8 et 7 au moins), le plugin utilise le lecteur Flash flowplayer pour lire vidéos et son. Si le lecteur ne semble pas fonctionner, cela peut venir de la configuration du mod_deflate d’Apache.
    Si dans la configuration de ce module Apache vous avez une ligne qui ressemble à la suivante, essayez de la supprimer ou de la commenter pour voir si le lecteur fonctionne correctement : /** * GeSHi (C) 2004 - 2007 Nigel McNie, (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (6898)

  • How do I stop ffmpeg from spamming itself when I auto restart ?

    15 décembre 2019, par billy61300
    const fs = require("fs");
    const express = require("express");
    const app = express();
    const path = require("path");
    const ffmpeg = require("fluent-ffmpeg");
    const md5 = require("md5");
    const readline = require("readline");
    const formidable = require("formidable");

    const dir = "Custom/Dir";
    const thumb = __dirname + "/thumb";
    const ph = __dirname + "/placeholder";

    app.use("/serve", express.static(dir));
    app.use("/thumb", express.static(thumb));
    app.use("/ph", express.static(ph));

    const list = [];
    const listThumb = [];

    process.on("uncaughtException", (err) => {
       console.log("Caught Exception: " + err);
    });

    let passwords = fs.readFileSync("passwords.txt").toString().split("\n");

    app.get("/", (req, res) => {
       res.sendFile(__dirname + "/index.html")
    });

    app.get("/upload", (req, res) => {
       res.sendFile(__dirname + "/upload.html");
    });

    app.post("/uploadFile", (req, res) => {
       let form = new formidable.IncomingForm();
       form.parse(req, (err, fields, files) => {
           if (passwords.includes(md5(fields.password))) {
               fs.readFile(files.filetoupload.path, (err, data) => {
                   let newPath = dir + "/" + files.filetoupload.name;
                   if (!fs.existsSync(newPath)) {
                       fs.writeFile(newPath, data, (err) => {
                           res.writeHead(200, {"Content-Type": "text/html"});
                           res.write("<h1>File Uploaded</h1>");
                           res.end();
                       });
                   } else {
                       res.writeHead(200, {"Content-Type": "text/html"});
                       res.write("<h1>File already exists. Upload with a different name please.</h1>");
                       res.end();
                   }
               });
           }
       });
    });

    fs.readdir(dir, (err, files) => {
       if (err) {
           throw err;
       } else {
           let i = 0;
           files.forEach((file) => {
               list[i] = path.basename(file);
               if (!fs.existsSync(__dirname + "\\thumb\\" + list[i] + ".png")) {
                   console.log("Generating: " + list[i] + ".png");
                   let proc = new ffmpeg({source: dir + "/" + file, nolog: true});
                   proc.setFfmpegPath(__dirname + "\\ffmpeg.exe");
                   proc.screenshots({
                       timestamps: [0.0],
                       filename: list[i] + ".png",
                       folder: __dirname + "\\thumb\\",
                       size: "100x100"
                   });
               }
               i++;
           });
           let serveDoc = "";
           for (let j = 0; j &lt; list.length; j++) {
               if (path.extname(list[j]).toLowerCase() !== ".jpg" &amp;&amp; path.extname(list[j]).toLowerCase() !== ".jpeg" &amp;&amp; path.extname(list[j]).toLowerCase() !== ".png") {
                   if (path.extname(list[j]).toLowerCase() == ".mp3" || path.extname(list[j]).toLowerCase() == ".wav") {
                       serveDoc += "<a href="http://stackoverflow.com/feeds/tag/address&#034; + list[j] + &#034;">" + "<img width='100' height='100' src="http://stackoverflow.com/feeds/tag/address" />" + "</a> ";;
                   }/* else if (path.extname(list[j]).toLowerCase() == ".webm") {
                       serveDoc += "<a href="http://stackoverflow.com/feeds/tag/address&#034; + list[j] + &#034;">" + "<img width='100' height='100' src="http://stackoverflow.com/feeds/tag/address" />" + "</a> ";;
                   }*/ else {
                       serveDoc += "<a href="http://stackoverflow.com/feeds/tag/address&#034; + list[j] + &#034;">" + "<img width='100' height='100' src="http://stackoverflow.com/feeds/tag/address&#034; + list[j] + &#034;.png" />" + "</a> ";
                   }
               } else {
                   serveDoc += "<a href="http://stackoverflow.com/feeds/tag/address&#034; + list[j] + &#034;">" + "<img width='100' height='100' src="http://stackoverflow.com/feeds/tag/address&#034; + list[j] + &#034;" />" + "</a> ";
               }
           }
           serveDoc += "";
           fs.writeFile("index.html", serveDoc, (err) => {
               if (err) throw err;
           });
       }
    });

    setTimeout(() => {
       process.exit(0);
    }, 1000 * 60 * 30);

    app.listen(80, (err) => {
       if (err) {
           throw err;
       } else {
           console.log("Listening on port 80.");
       }
    });

    Issue is that the program needs to be restarted every X minutes so that the list of media will update on it’s own. However, upon a restart, ffmpeg goes crazy and starts to spam a batch window under it’s name repeatedly over and over again without stopping. The only way out of it is to restart my computer.

    I’ve tried to use PM2, Forever, Supervisor. Nodemon afaik won’t auto restart.

  • How do I make my discord bot play music by using youtubedl's search function instead of url ? (Python)

    28 septembre 2021, par PypypieYum

    I want it to search for the video and play it, how can i change the following code to achieve that ? Every time I use the ytsearch function in ytdl, I notice that it only searches for the first word of the title and download it, however, it causes error later on and do nothing.

    &#xA;

    @commands.command()&#xA;    async def play(self, ctx, url):&#xA;        if ctx.author.voice is None:&#xA;            await ctx.send("You are not in a voice channel!")&#xA;        voice_channel = ctx.author.voice.channel&#xA;        if ctx.voice_client is None:&#xA;            await voice_channel.connect()&#xA;        else:&#xA;            await ctx.voice_client.move_to(voice_channel)&#xA;&#xA;        ctx.voice_client.stop()&#xA;        FFMPEG_OPTIONS = {&#x27;before_options&#x27;: &#x27;-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5&#x27;, &#x27;options&#x27;: &#x27;-vn&#x27;}&#xA;        YDL_OPTIONS = {&#x27;format&#x27;:"bestaudio", &#x27;default_search&#x27;:"ytsearch"}&#xA;        vc = ctx.voice_client&#xA;&#xA;        with youtube_dl.YoutubeDL(YDL_OPTIONS) as ydl:&#xA;            info = ydl.extract_info(url, download=False)&#xA;            if &#x27;entries&#x27; in info:&#xA;              url2 = info["entries"][0]["formats"][0]&#xA;            elif &#x27;formats&#x27; in info:&#xA;              url2 = info["formats"][0][&#x27;url&#x27;]&#xA;            source = await discord.FFmpegOpusAudio.from_probe(url2, **FFMPEG_OPTIONS)&#xA;            vc.play(source)&#xA;

    &#xA;

    And this is the error message :

    &#xA;

    Ignoring exception in command play:&#xA;Traceback (most recent call last):&#xA;  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped&#xA;    ret = await coro(*args, **kwargs)&#xA;  File "/home/runner/HandmadeLivelyLines/music.py", line 44, in play&#xA;    source = await discord.FFmpegOpusAudio.from_probe(url2, **FFMPEG_OPTIONS)&#xA;  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 387, in from_probe&#xA;    return cls(source, bitrate=bitrate, codec=codec, **kwargs)&#xA;  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 324, in __init__&#xA;    super().__init__(source, executable=executable, args=args, **subprocess_kwargs)&#xA;  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 138, in __init__&#xA;    self._process = self._spawn_process(args, **kwargs)&#xA;  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 144, in _spawn_process&#xA;    process = subprocess.Popen(args, creationflags=CREATE_NO_WINDOW, **subprocess_kwargs)&#xA;  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__&#xA;    self._execute_child(args, executable, preexec_fn, close_fds,&#xA;  File "/usr/lib/python3.8/subprocess.py", line 1639, in _execute_child&#xA;    self.pid = _posixsubprocess.fork_exec(&#xA;TypeError: expected str, bytes or os.PathLike object, not dict&#xA;&#xA;The above exception was the direct cause of the following exception:&#xA;&#xA;Traceback (most recent call last):&#xA;  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke&#xA;    await ctx.command.invoke(ctx)&#xA;  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke&#xA;    await injected(*ctx.args, **ctx.kwargs)&#xA;  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped&#xA;    raise CommandInvokeError(exc) from exc&#xA;discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: expected str, bytes or os.PathLike object, not dict&#xA;

    &#xA;

    Thanks.

    &#xA;

  • FFMPEG Link error

    30 novembre 2014, par Thomas

    I’m trying to compile a modified version of this transcoding example from the FFMPEG site, I’ve used all the required includes and joined the libs using this :

    INCLUDEPATH += $$(FFMPEG_DEV_PATH)\include
       LIBS += -L$$(FFMPEG_DEV_PATH)\lib -lavformat -lavcodec -lavutil -lswscale -liconv -lz -lavfilter

    but I get this linking error that I can’t understand :

     "avio_close(AVIOContext*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "av_strerror(int, char*, unsigned long)", referenced from:
         av_make_error_string(char*, unsigned long, int) in PhVideoEncoder.o
     "av_rescale_q(long long, AVRational, AVRational)", referenced from:
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "av_frame_free(AVFrame**)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "av_read_frame(AVFormatContext*, AVPacket*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avcodec_close(AVCodecContext*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avcodec_open2(AVCodecContext*, AVCodec const*, AVDictionary**)", referenced from:
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "av_dump_format(AVFormatContext*, int, char const*, int)", referenced from:
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "av_frame_alloc()", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
     "av_free_packet(AVPacket*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "av_init_packet(AVPacket*)", referenced from:
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "av_opt_set_bin(void*, char const*, unsigned char const*, int, int)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "av_register_all()", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "av_rescale_q_rnd(long long, AVRational, AVRational, AVRounding)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "av_write_trailer(AVFormatContext*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avfilter_graph_free(AVFilterGraph**)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avfilter_inout_free(AVFilterInOut**)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avformat_new_stream(AVFormatContext*, AVCodec const*)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "avformat_open_input(AVFormatContext**, char const*, AVInputFormat*, AVDictionary**)", referenced from:
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
     "avcodec_copy_context(AVCodecContext*, AVCodecContext const*)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "avcodec_find_decoder(AVCodecID)", referenced from:
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
     "avcodec_find_encoder(AVCodecID)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "avfilter_get_by_name(char const*)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avfilter_graph_alloc()", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avfilter_inout_alloc()", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avformat_close_input(AVFormatContext**)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avcodec_decode_audio4(AVCodecContext*, AVFrame*, int*, AVPacket const*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avcodec_decode_video2(AVCodecContext*, AVFrame*, int*, AVPacket const*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avcodec_encode_audio2(AVCodecContext*, AVPacket*, AVFrame const*, int*)", referenced from:
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "avcodec_encode_video2(AVCodecContext*, AVPacket*, AVFrame const*, int*)", referenced from:
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "avfilter_graph_config(AVFilterGraph*, void*)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avfilter_register_all()", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avformat_free_context(AVFormatContext*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "avformat_write_header(AVFormatContext*, AVDictionary**)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "av_get_sample_fmt_name(AVSampleFormat)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "av_buffersink_get_frame(AVFilterContext*, AVFrame*)", referenced from:
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
     "avfilter_graph_parse_ptr(AVFilterGraph*, char const*, AVFilterInOut**, AVFilterInOut**, void*)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avformat_find_stream_info(AVFormatContext*, AVDictionary**)", referenced from:
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
     "av_interleaved_write_frame(AVFormatContext*, AVPacket*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
     "av_buffersrc_add_frame_flags(AVFilterContext*, AVFrame*, int)", referenced from:
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
     "avfilter_graph_create_filter(AVFilterContext**, AVFilter const*, char const*, char const*, void*, AVFilterGraph*)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "av_get_default_channel_layout(int)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avformat_alloc_output_context2(AVFormatContext**, AVOutputFormat*, char const*, char const*)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "av_get_channel_layout_nb_channels(unsigned long long)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
     "av_frame_get_best_effort_timestamp(AVFrame const*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "av_log(void*, int, char const*, ...)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
         PhVideoEncoder::flush_encoder(unsigned int) in PhVideoEncoder.o
         PhVideoEncoder::open_input_file(char const*) in PhVideoEncoder.o
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
         PhVideoEncoder::encode_write_frame(AVFrame*, unsigned int, int*) in PhVideoEncoder.o
         ...
     "av_free(void*)", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "av_malloc(unsigned long)", referenced from:
         av_malloc_array(unsigned long, unsigned long) in PhVideoEncoder.o
     "av_strdup(char const*)", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "avio_open(AVIOContext**, char const*, int)", referenced from:
         PhVideoEncoder::open_output_file(char const*) in PhVideoEncoder.o

    I tried looking for missing libraries but with no luck... What am I missing ?

    EDIT

    Thanks to the first answer, I added the extern C stuff but I still face a few errors :

    Undefined symbols for architecture x86_64:
     "_av_buffersink_get_frame", referenced from:
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
     "_av_buffersrc_add_frame_flags", referenced from:
         PhVideoEncoder::filter_encode_write_frame(AVFrame*, unsigned int) in PhVideoEncoder.o
     "_avfilter_get_by_name", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_graph_alloc", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_graph_config", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_graph_create_filter", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_graph_free", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
     "_avfilter_graph_parse_ptr", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_inout_alloc", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_inout_free", referenced from:
         PhVideoEncoder::init_filter(FilteringContext*, AVCodecContext*, AVCodecContext*, char const*) in PhVideoEncoder.o
     "_avfilter_register_all", referenced from:
         PhVideoEncoder::PhVideoEncoder(QString) in PhVideoEncoder.o
    ld: symbol(s) not found for architecture x86_64