User Tools

Site Tools


informatica:linux:edicion_de_video:ffmpeg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatica:linux:edicion_de_video:ffmpeg [2023/10/22 20:45] joseinformatica:linux:edicion_de_video:ffmpeg [2024/01/23 16:19] (current) jose
Line 8: Line 8:
   ffmpeg -i input.mp4 -vf "select=eq(n\,325)" -vframes 1 output.png   ffmpeg -i input.mp4 -vf "select=eq(n\,325)" -vframes 1 output.png
  
 +Extraer 250 frames de un vídeo
 +<code>
 +#!/bin/bash
 +video=$1
 +n=`ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 $video`
 +factor=$(echo "scale=4; $n / 250" | bc)
 +echo $factor
 +for ((i=1; i<=249; i++)); do
 +  frame_decimal=$(echo "$i * $factor" | bc)
 +  frame=$(echo "$frame_decimal" | cut -d'.' -f1)
 +  fitxer=`printf "%03d\n" "$i"`
 +  ffmpeg -i $video -vf "select=eq(n\,${frame})" -vframes 1 jur/${fitxer}.png
 +done
 +ffmpeg -i ${video} -vf "select=eq(n\,$((n - 1)))" -vframes 1 jur/250.png
 +
 +</code>
 +
 +====== Cortar vídeo ======
 +Minuto y segundo de inicio y de fin. Corta del 0:15 al 0:25 total 10 segundos de vídeo
 +  ffmpeg -i original.mp4 -ss 00:00:15 -to 00:25 cortado.mp4
informatica/linux/edicion_de_video/ffmpeg.1698007547.txt.gz · Last modified: 2023/10/22 20:45 by jose