Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (81)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accé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 (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP 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 (7230)

  • ffmpeg use gpu to encode mpeg4 to ts/m3u8 [closed]

    14 novembre 2024, par danielRICADO

    using ffmpeg I want to trim and transcode a mpeg4 from ts / m3u8

    


    std::string ffmpeg_command = "ffmpeg -hwaccel drm -i " + output_dir + input_file +
                         " -ss 00:00:00.00 -t 31 -c:v " + codec + " -b:v " + std::to_string(bitrate) +
                         " -vf scale=" + std::to_string(width) + "x" + std::to_string(height) +
                         " -hls_time " + std::to_string(30) + " -hls_list_size 0 -hls_segment_filename " +
                         ts_file_pattern + " -f hls " + m3u8_file;


    


    I wanted to choose between codecs based on the system, if gpu is avaiable I'd like to opt to use it, right now I just check if the codec is available

    


    bool is_h264_v4l2m2m_available() {
    std::string result = exec_command("ffmpeg -encoders 2>&1");
    return result.find("h264_v4l2m2m") != std::string::npos;
}


    


    if it is a I wanted to move that process over to the gpu, not just use libx264. Here is the error log. Studying hard on the solution but wold super apperciate any expert advice.

    


    other considerations are - runs in a docker container on a pi5, pibian on the host apline on in the container, container runs in privledged mode

    


    2024-11-14 15:18:41 [INFO]: assigned codec: h264_v4l2m2m
2024-11-14 15:18:41 ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
2024-11-14 15:18:41   built with gcc 13.2.1 (Alpine 13.2.1_git20240309) 20240309
2024-11-14 15:18:41   configuration: --prefix=/usr --disable-librtmp --disable-lzma --disable-static --disable-stripping --enable-avfilter --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libmp3lame --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librist --enable-libsoxr --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-lto=auto --enable-lv2 --enable-openssl --enable-pic --enable-postproc --enable-pthreads --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-vulkan --optflags=-O3 --enable-libjxl --enable-libsvtav1 --enable-libvpl
2024-11-14 15:18:41   libavutil      58. 29.100 / 58. 29.100
2024-11-14 15:18:41   libavcodec     60. 31.102 / 60. 31.102
2024-11-14 15:18:41   libavformat    60. 16.100 / 60. 16.100
2024-11-14 15:18:41   libavdevice    60.  3.100 / 60.  3.100
2024-11-14 15:18:41   libavfilter     9. 12.100 /  9. 12.100
2024-11-14 15:18:41   libswscale      7.  5.100 /  7.  5.100
2024-11-14 15:18:41   libswresample   4. 12.100 /  4. 12.100
2024-11-14 15:18:41   libpostproc    57.  3.100 / 57.  3.100
2024-11-14 15:18:42 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/app/client-data/camera-output/7ea3cbef-4da0-11ed-bdcc-baf70a43c072/1731550687270.mp4':
2024-11-14 15:18:42   Metadata:
2024-11-14 15:18:42     major_brand     : isom
2024-11-14 15:18:42     minor_version   : 512
2024-11-14 15:18:42     compatible_brands: isomiso2avc1mp41
2024-11-14 15:18:42     encoder         : Lavf60.16.100
2024-11-14 15:18:42   Duration: 00:00:31.33, start: 0.000000, bitrate: 678 kb/s
2024-11-14 15:18:42   Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1024x1024, 677 kb/s, 15 fps, 15 tbr, 15360 tbn (default)
2024-11-14 15:18:42     Metadata:
2024-11-14 15:18:42       handler_name    : VideoHandler
2024-11-14 15:18:42       vendor_id       : [0][0][0][0]
2024-11-14 15:18:42 [AVFormatContext @ 0x7f9254dcb4c0] Unable to choose an output format for '678000'; use a standard extension for the filename or specify the format manually.
2024-11-14 15:18:42 [out#0 @ 0x7f9254d70700] Error initializing the muxer for 678000: Invalid argument
2024-11-14 15:18:42 Error opening output file 678000.
2024-11-14 15:18:42 Error opening output files: Invalid argument
2024-11-14 15:18:42 [ERROR]: Failed to generate .ts file for: 1731550687270.mp4


    


  • 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.

    


    @commands.command()
    async def play(self, ctx, url):
        if ctx.author.voice is None:
            await ctx.send("You are not in a voice channel!")
        voice_channel = ctx.author.voice.channel
        if ctx.voice_client is None:
            await voice_channel.connect()
        else:
            await ctx.voice_client.move_to(voice_channel)

        ctx.voice_client.stop()
        FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
        YDL_OPTIONS = {'format':"bestaudio", 'default_search':"ytsearch"}
        vc = ctx.voice_client

        with youtube_dl.YoutubeDL(YDL_OPTIONS) as ydl:
            info = ydl.extract_info(url, download=False)
            if 'entries' in info:
              url2 = info["entries"][0]["formats"][0]
            elif 'formats' in info:
              url2 = info["formats"][0]['url']
            source = await discord.FFmpegOpusAudio.from_probe(url2, **FFMPEG_OPTIONS)
            vc.play(source)


    


    And this is the error message :

    


    Ignoring exception in command play:
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/runner/HandmadeLivelyLines/music.py", line 44, in play
    source = await discord.FFmpegOpusAudio.from_probe(url2, **FFMPEG_OPTIONS)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 387, in from_probe
    return cls(source, bitrate=bitrate, codec=codec, **kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 324, in __init__
    super().__init__(source, executable=executable, args=args, **subprocess_kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 138, in __init__
    self._process = self._spawn_process(args, **kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/player.py", line 144, in _spawn_process
    process = subprocess.Popen(args, creationflags=CREATE_NO_WINDOW, **subprocess_kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1639, in _execute_child
    self.pid = _posixsubprocess.fork_exec(
TypeError: expected str, bytes or os.PathLike object, not dict

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: expected str, bytes or os.PathLike object, not dict


    


    Thanks.

    


  • 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.