Recherche avancée

Médias (29)

Mot : - Tags -/Musique

Autres articles (56)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (8224)

  • Is it possible to generate a keyframe to start a spliced H.264 video segment ?

    3 janvier 2015, par Ethan T

    When segmenting files with ffmpeg, I am currently only able to splice on keyframe boundaries if I don’t want to reencode. This presents issues if I want to control timing down to a specific frame. To my knowledge, you can only start on a keyframe if you’re performing a stream copy. If you want to start on an arbitrary frame, you must reencode.

    However, for codecs that ffmpeg understands (like H.264), it seems like it would be technically possible to replace the desired first frame with a newly created keyframe without reencoding the rest of the video. This would represent a "smart copy" sort of behavior. For example, say my video consists of these frames and types :

    Frame number:  0         1         2         3
                  0123456789012345678901234567890123
    Frame type:    IppbppbppbppbIppbppbppbppbIppbppbp
    Keyframes:     ^            ^            ^

    (I frames are keyframes while p and b frames are not)

    Currently, if I want to remove the first few frames and start on exactly frame 20, I must reencode the entire stream beginning with that input frame. This would cause an undesired degradation in quality. Instead, if I perform a copy, ffmpeg would begin at the most recent keyframe :

    Frame number:  0         1         2         3
                  0123456789012345678901234567890123
    Frame type:    IppbppbppbppbIppbppbppbppbIppbppbp
    Desired start:                     ^
    Actual start:               ^

    Why can’t ffmpeg seek to frame 13 (the last complete keyframe prior to the cut point), fully calculate frame 20, and recreate frame 20 as an I frame ? It would then copy the remaining frames as before. Like this :

    Frame number:  0         1         2         3
                  0123456789012345678901234567890123
    Input type:    IppbppbppbppbIppbppbppbppbIppbppbp
    Output type:                       IpbppbIppbppbp

    It seems like this would be a very useful feature for splicing videos without losing quality. Is there any technical barrier (e.g. the H.264 spec or any other common codec) that prevents this approach ?

  • Trying to understand the ffmpeg seek cut functionality

    13 février 2020, par user3841429

    I have a video where I would like to cut a part from. The command I use :

    ffmpeg -ss 526.623 -t 347.986 -i 'example.mp4' -c copy -avoid_negative_ts 1 -y res.mp4

    Where expected length is 00:05:47.99. The process log shows the following :

    ...
    frame=10582 fps=8258 q=-1.0 Lsize= 1061446kB time=00:05:47.98 bitrate=24987.8kbits/s speed= 272x    
    video:1044531kB audio:16556kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.033789%

    As you can see time=00:05:47.98 as expected, but when I play this video in player I see that it has extra 5 seconds of video at the end. I check the playtime length :

    $ ffmpeg -i 'res.mp4' 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,//
    00:05:53.11

    What the... My clue was the GOP’s I-frame, but when I modify my commands as :

    ffmpeg -ss 526.623 -t 347 -i 'example.mp4' -c copy -avoid_negative_ts 1 -y res.mp4

    Output shows time=00:05:46.99 and actual video length is 00:05:52.13

    In the first case it added 5.13sec, in the second 5.14. Let’s take 5.14 for both cases that show that it has nothing to do with I-frame. There is no magic in this world (I guess). But what then ?

    UPD : It is GOP in the begging of the video. For this video it’s about 7 seconds.

  • How do I get videoshow (or any other js package) to merge image and sound files to the length I specify rather than a constant length of 5 seconds ?

    5 décembre 2023, par Bragon

    I’m trying to take an image file and a sound file and merge them together into an mp4 file. To this end, I use videoshow.js which is basically a wrapper for fluent-ffmpeg.js. For some reason, videoshow always sets the duration of the output file to 5 seconds regardless of what I set the loop parameter to. And to top it all off, it fades out the sound towards the end of the clip.

    


    I’m happy for any solution to this even if it doesn’t include the use of videoshow or fluent-ffmpeg.

    


    const url = require('url');
const { smartLog } = require('../services/smart-log');
const { getFile, getDuration } = require('../services/file-service');
const videoshow = require('videoshow');
const path = require('path');
const FFmpeg = require('fluent-ffmpeg');
const fs = require('fs');

const imgToMP4 = (caption, sound, image, duration, output) => {
  smartLog('info', `Converting ${image}`);
  const images = [image];

  const videoOptions = {
    fps: 10,
    loop: duration,
    transition: false,
    videoBitrate: 1024,
    videoCodec: 'libx264',
    size: '640x?',
    audioBitrate: '128k',
    audioChannels: 2,
    format: 'mp4',
    pixelFormat: 'yuv420p',
  };

  videoshow([
    {
      path: image,
    },
  ])
    .audio(sound)
    .save(output)
    .on('start', function (command) {
      smartLog('info', `ffmpeg process started: ${image}`);
    })
    .on('error', function (err) {
      smartLog('error', err);
    })
    .on('end', function (output) {
      smartLog('info', `Video created: ${output}`);
    });
};