Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (106)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

Sur d’autres sites (5972)

  • yt-dlp how to download a specific video using timestamps, and limiting the download resolution ?

    30 septembre 2023, par ignacM

    I am running a python program to download a video, this is the command I use :

    


    command = ['powershell.exe ffmpeg',
                   '-ss', str(start),
                   '-i', '$(yt-dlp',
                   '-f', 'bestvideo[ext=webm]',

                   '-g', '"%s")' % (url_base + video_identifier),
                   '-t', str(end - start),
                   '-c:v', 'libx264', '-c:a', 'copy', '%s' % output_filename]

command = ' '.join(command)
output = subprocess.check_output(command, shell=True, stderr=subprocess.STDOUT)


    


    This prints something like
powershell.exe ffmpeg -ss 10 -i $(yt-dlp -f bestvideo[ext=webm] -g "https://www.youtube.com/watch?v=Z15erfLqNKo") -t 10 -c:v libx264 -c:a copy C :\Users...\video.mp4

    


    This works perfectly fine. However, I tried to download a video that had very high resolution (4K) and I want to limit the resolution when downloading. I have found that placing [height<=1080] as so should work :

    &#xA;

    powershell.exe ffmpeg -ss 10 -i $(yt-dlp -f bestvideo[ext=webm][height<=1080] -g "https://www.youtube.com/watch?v=Z15erfLqNKo") -t 10 -c:v libx264 -c:a copy C :\Users...\video.mp4

    &#xA;

    However this does not work for me and gives me the error :&#xA;Error command "" returned non-zero exit status 1.&#xA;Output : b'The system cannot find the file specified.\r\n'

    &#xA;

    I also have noticed that only limiting the resolution does not work for me either :

    &#xA;

    powershell.exe ffmpeg -ss 10 -i $(yt-dlp -f bestvideo[height<=1080] -g "https://www.youtube.com/watch?v=Z15erfLqNKo") -t 10 -c:v libx264 -c:a copy C :\Users...\video.mp4

    &#xA;

    Actually, placing [height<=1080] after bestvideo never works, no matter what I do.

    &#xA;

    What could be the problem ? Or what command can I run to achieve both tasks (limit resolution and download specific timeframe (not whole video and cutting it)) ?

    &#xA;

  • How to download audio and video as separate files and specify the output format and filename for each ?

    14 novembre 2023, par Taako

    I'd like to download a video as separate files for both audio and video and have them named [video_id]-audio.wav and [video_id]-video.mp4

    &#xA;

    How do i get yt-dlp to download the video and audio separately, then convert each to the specified output format and rename them as such ?

    &#xA;

    Right now I can get them each downloaded separately but the naming isnt working out.

    &#xA;

    I could also use ffmpeg separately to convert the video and audio formats after they are downloaded, so all i really need is to have the audio and video files downloaded and named

    &#xA;

    Right now my args are

    &#xA;

    YT_OPTIONS = {&#xA;    &#x27;format&#x27;: &#x27;bestvideo[height&lt;=720]&#x2B;bestaudio/best[height&lt;=720]&#x27;,&#xA;    &#x27;extractaudio&#x27;: True,&#xA;    &#x27;keepvideo&#x27;: True,&#xA;    &#x27;outtmpl&#x27;: &#x27;%(id)s-%(format)s.%(ext)s&#x27;,&#xA;    &#x27;restrictfilenames&#x27;: True,&#xA;    &#x27;noplaylist&#x27;: True&#xA;}&#xA;

    &#xA;

    but the format is just coming out as 247_-_1280x720_720p_&#x2B;251_-_audio_only_medium and whats worse is it is the same for both the audio only and video only files just one has 251 and the other has 247.

    &#xA;

  • Download youtube video as stream Readable object

    26 décembre 2023, par Abraam Emad

    in this function it download youtube video as a file out.mp4 on hard disk i need to download it as a Readable Object to upload it

    &#xA;

    private async downloadVideo(videoId: string) {&#xA;// Buildin with nodejs&#xA;const cp = require(&#x27;child_process&#x27;);&#xA;const readline = require(&#x27;readline&#x27;);&#xA;// External modules&#xA;const ytdl = require(&#x27;ytdl-core&#x27;);&#xA;const ffmpeg = require(&#x27;ffmpeg-static&#x27;);&#xA;// Global constants&#xA;const ref = `https://www.youtube.com/watch?v=${videoId}`;&#xA;const tracker = {&#xA;  start: Date.now(),&#xA;  audio: { downloaded: 0, total: Infinity },&#xA;  video: { downloaded: 0, total: Infinity },&#xA;  merged: { frame: 0, speed: &#x27;0x&#x27;, fps: 0 },&#xA;};&#xA;&#xA;// Get audio and video streams&#xA;const audio = ytdl(ref, { quality: &#x27;highestaudio&#x27; })&#xA;  .on(&#x27;progress&#x27;, (_, downloaded, total) => {&#xA;    tracker.audio = { downloaded, total };&#xA;  });&#xA;const video = ytdl(ref, { quality: &#x27;highestvideo&#x27; })&#xA;  .on(&#x27;progress&#x27;, (_, downloaded, total) => {&#xA;    tracker.video = { downloaded, total };&#xA;  });&#xA;&#xA;// Prepare the progress bar&#xA;let progressbarHandle = null;&#xA;const progressbarInterval = 1000;&#xA;const showProgress = () => {&#xA;  readline.cursorTo(process.stdout, 0);&#xA;  const toMB = i => (i / 1024 / 1024).toFixed(2);&#xA;&#xA;  process.stdout.write(`Audio  | ${(tracker.audio.downloaded / tracker.audio.total * 100).toFixed(2)}% processed `);&#xA;  process.stdout.write(`(${toMB(tracker.audio.downloaded)}MB of ${toMB(tracker.audio.total)}MB).${&#x27; &#x27;.repeat(10)}\n`);&#xA;&#xA;  process.stdout.write(`Video  | ${(tracker.video.downloaded / tracker.video.total * 100).toFixed(2)}% processed `);&#xA;  process.stdout.write(`(${toMB(tracker.video.downloaded)}MB of ${toMB(tracker.video.total)}MB).${&#x27; &#x27;.repeat(10)}\n`);&#xA;&#xA;  process.stdout.write(`Merged | processing frame ${tracker.merged.frame} `);&#xA;  process.stdout.write(`(at ${tracker.merged.fps} fps => ${tracker.merged.speed}).${&#x27; &#x27;.repeat(10)}\n`);&#xA;&#xA;  process.stdout.write(`running for: ${((Date.now() - tracker.start) / 1000 / 60).toFixed(2)} Minutes.`);&#xA;  readline.moveCursor(process.stdout, 0, -3);&#xA;};&#xA;&#xA;// Start the ffmpeg child process&#xA;const ffmpegProcess = cp.spawn(ffmpeg, [&#xA;  // Remove ffmpeg&#x27;s console spamming&#xA;  &#x27;-loglevel&#x27;, &#x27;8&#x27;, &#x27;-hide_banner&#x27;,&#xA;  // Redirect/Enable progress messages&#xA;  &#x27;-progress&#x27;, &#x27;pipe:3&#x27;,&#xA;  // Set inputs&#xA;  &#x27;-i&#x27;, &#x27;pipe:4&#x27;,&#xA;  &#x27;-i&#x27;, &#x27;pipe:5&#x27;,&#xA;  // Map audio &amp; video from streams&#xA;  &#x27;-map&#x27;, &#x27;0:a&#x27;,&#xA;  &#x27;-map&#x27;, &#x27;1:v&#x27;,&#xA;  // Keep encoding&#xA;  &#x27;-c:v&#x27;, &#x27;copy&#x27;,&#xA;  // Define output file&#xA;  &#x27;-f&#x27;, &#x27;mpegts&#x27;, // Use MPEG-TS format for streaming&#xA;  &#x27;out.mp4&#x27;&#xA;], {&#xA;  windowsHide: true,&#xA;  stdio: [&#xA;    /* Standard: stdin, stdout, stderr */&#xA;    &#x27;inherit&#x27;, &#x27;inherit&#x27;, &#x27;inherit&#x27;,&#xA;    /* Custom: pipe:3, pipe:4, pipe:5 */&#xA;    &#x27;pipe&#x27;, &#x27;pipe&#x27;, &#x27;pipe&#x27;,&#xA;  ],&#xA;});&#xA;ffmpegProcess.on(&#x27;close&#x27;, () => {&#xA;  console.log(&#x27;done&#x27;);&#xA;  // Cleanup&#xA;  process.stdout.write(&#x27;\n\n\n\n&#x27;);&#xA;  clearInterval(progressbarHandle);&#xA;});&#xA;// Link streams&#xA;// FFmpeg creates the transformer streams and we just have to insert / read data&#xA;ffmpegProcess.stdio[3].on(&#x27;data&#x27;, chunk => {&#xA;  // Start the progress bar&#xA;  if (!progressbarHandle) progressbarHandle = setInterval(showProgress, progressbarInterval);&#xA;  // Parse the param=value list returned by ffmpeg&#xA;  const lines = chunk.toString().trim().split(&#x27;\n&#x27;);&#xA;  const args: any = {};&#xA;  for (const l of lines) {&#xA;    const [key, value] = l.split(&#x27;=&#x27;);&#xA;    args[key.trim()] = value.trim();&#xA;  }&#xA;  tracker.merged = args;&#xA;});&#xA;audio.pipe(ffmpegProcess.stdio[4]);&#xA;video.pipe(ffmpegProcess.stdio[5]);&#xA;

    &#xA;

    }`

    &#xA;