Recherche avancée

Médias (2)

Mot : - Tags -/plugins

Autres articles (94)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (9893)

  • how to remove multiple parts from a video, using ffmpeg ?

    26 septembre 2023, par jojo

    how to remove multiple parts from a video ?
for example i have a video of one minute and i want to delete following segments :

    


    from second 0.0 to second 10.0
from second 20.0 to second 30.0
from second 40.0 to second 45.0

    


    please remember i want to delete above mentioned segments, the output should not include these segments.
i have already tried all the answers, but they are all joining the trimmed segments, which i don't want.e.g :

    


    ffmpeg -i foo.mp4 -filter_complex "[0:v]trim=duration=30[av];[0:a]atrim=duration=30[aa];[0:v]trim=start=40:end=50,setpts=PTS-STARTPTS[bv];[0:a]atrim=start=40:end=50,asetpts=PTS-STARTPTS[ba];[0:v]trim=start=80,setpts=PTS-STARTPTS[cv];[0:a]atrim=start=80,asetpts=PTS-STARTPTS[ca];[av][aa][bv][ba][cv][ca]concat=n=3:v=1:a=1" out.mp4


    


    thank you.
note :(python version also accepted.)

    


  • How to crop and scale multiple landscape regions into a new portrait video ? FFmpeg

    27 août 2023, par 3V1LXD

    I have an electron program that selects multiple regions of a landscape video and lets you rearrange them in a portrait canvas. I'm having trouble building the proper ffmpeg command to create the video. I have this somewhat working. I can export 2 layers, but i can't export if i only have 1 layer or if i have 3 or more layers selected.

    


    2 regions of video selected

    


    layers [
  { top: 0, left: 658, width: 576, height: 1080 },
  { top: 262, left: 0, width: 576, height: 324 }
]
newPositions [
  { top: 0, left: 0, width: 576, height: 1080 },
  { top: 0, left: 0, width: 576, height: 324 }
]
filtergraph [0]crop=576:1080:658:0,scale=576:1080[v0];[0]crop=576:324:0:262,scale=576:324[v1];[v0][v1]overlay=0:0:0:0[out]

No Error export successful


    


    1 region selected

    


    layers [ { top: 0, left: 650, width: 576, height: 1080 } ]
newPositions [ { top: 0, left: 0, width: 576, height: 1080 } ]
filtergraph [0]crop=576:1080:650:0,scale=576:1080[v0];[v0]overlay=0:0[out]

FFmpeg error: [fc#0 @ 000001dd3b6db0c0] Cannot find a matching stream for unlabeled input pad overlay
Error initializing complex filters: Invalid argument


    


    3 regions of video selected

    


    layers [
  { top: 0, left: 641, width: 576, height: 1080 },
  { top: 250, left: 0, width: 576, height: 324 },
  { top: 756, left: 0, width: 576, height: 324 }
]
newPositions [
  { top: 0, left: 0, width: 576, height: 1080 },
  { top: 0, left: 0, width: 576, height: 324 },
  { top: 756, left: 0, width: 576, height: 324 }
]
filtergraph [0]crop=576:1080:641:0,scale=576:1080[v0];[0]crop=576:324:0:250,scale=576:324[v1];[0]crop=576:324:0:756,scale=576:324[v2];[v0][v1][v2]overlay=0:0:0:0:0:756[out]

FFmpeg error: [AVFilterGraph @ 0000018faf2189c0] More input link labels specified for filter 'overlay' than it has inputs: 3 > 2
[AVFilterGraph @ 0000018faf2189c0] Error linking filters

FFmpeg error: Failed to set value '[0]crop=576:1080:698:0,scale=576:1080[v0];[0]crop=576:324:0:264,scale=576:324[v1];[0]crop=576:324:0:756,scale=576:324[v2];[v0][v1][v2]overlay=0:0:0:0:0:0[out]' for option 'filter_complex': Invalid argument
Error parsing global options: Invalid argument


    


    I can't figure out how to construct the proper overlay command. Here is the js code i'm using from my electron app.

    


    ipcMain.handle('export-video', async (_event, args) => {
  const { videoFile, outputName, layers, newPositions } = args;
  const ffmpegPath = path.join(__dirname, 'bin', 'ffmpeg');
  const outputDir = checkOutputDir();
  
  // use same video for each layer as input
  // crop, scale, and position each layer
  // overlay each layer on top of each other

  // export video
  console.log('layers', layers);
  console.log('newPositions', newPositions);

  let filtergraph = '';

  for (let i = 0; i < layers.length; i++) {
    const { top, left, width, height } = layers[i];
    const { width: newWidth, height: newHeight } = newPositions[i];
    const filter = `[0]crop=${width}:${height}:${left}:${top},scale=${newWidth}:${newHeight}[v${i}];`;
    filtergraph += filter;
  }

  for (let i = 0; i < layers.length; i++) {
    const filter = `[v${i}]`;
    filtergraph += filter;
  }

  filtergraph += `overlay=`;
  for (let i = 0; i < layers.length; i++) {
    const { top: newTop, left: newLeft } = newPositions[i];
    const overlay = `${newLeft}:${newTop}:`;
    filtergraph += overlay;
  }

  filtergraph = filtergraph.slice(0, -1); // remove last comma
  filtergraph += `[out]`;
  
  console.log('filtergraph', filtergraph);

  const ffmpeg = spawn(ffmpegPath, [
    '-i', videoFile,
    '-filter_complex', filtergraph,
    '-map', '[out]',
    '-c:v', 'libx264',
    '-preset', 'ultrafast',
    '-crf', '18',
    '-y',
    path.join(outputDir, `${outputName}`)
  ]);  

  ffmpeg.stdout.on('data', (data) => {
    console.log(`FFmpeg output: ${data}`);
  });

  ffmpeg.stderr.on('data', (data) => {
    console.error(`FFmpeg error: ${data}`);
  });

  ffmpeg.on('close', (code) => {
    console.log(`FFmpeg process exited with code ${code}`);
    // event.reply('ffmpeg-export-done'); // Notify the renderer process
  });
});


    


    Any advice might be helpful, The docs are confusing, Thanks.

    


  • FFMPEG - Multiple filters at same time (add background, draw text, add overlay) [closed]

    11 août 2023, par Jason z
      

    1. I am adding a bitmap in start of a video, remains there for 2 seconds, then actual video starts, using following command
    2. 


    


    


    ffmpeg -i SRC.mp4 -framerate 25 -loop 1 -t 2 -i first-bg.png -f lavfi -t 2 -i anullsrc -filter_complex "[0:v]trim=0:2,drawbox=t=fill[base] ;[1][base]scale2ref=iw:ih:force_original_aspect_ratio=decrease:flags=spline[2nd][base2] ;[base2][2nd]overlay='(W-w)/2' :'(H-h)/2'[padded] ;[padded][2:a][0:v][0:a]concat=n=2:v=1:a=1[v][a]" -c:v libx264 -c:a aac -map "[v]" -map "[a]" -to 0:05 -y z_with_intro.mp4

    


    


      

    1. Then am drawing text on video for first 2 seconds using this :
    2. 


    


    


    ffmpeg -i z_with_intro.mp4 -filter_complex "drawtext=text='Structures in C Language':line_spacing=30:x=100:y=100:fontcolor=#FFFFFF:fontsize=96:fontfile=arial.TTF:enable='between(t,0,2)'" -to 0:05 -c:v libx264 -c:a aac -y z_with_text.mp4

    


    


    Problem :
I tried combining both of commands by repeating -filter_complex in command, it didn't work, neither when I used comma and append draw text like this :
....:a=1[v][a],drawtext=text.....

    


    Additionally : I also want to add audio from e.g. SRC.m4a for 2 seconds in the beginning of target file where I added intro in first command, how will I do that too, all in single command.

    


    thanks