76 lines
1.2 KiB
Plaintext
76 lines
1.2 KiB
Plaintext
## ffmpeg
|
|
|
|
1] Cortar un video
|
|
|
|
```Cortar un video
|
|
|
|
ffmpeg -i ENTRADA.mp4 -ss 00:00:00 -to 00:10:00 -c copy SALIDA.mp4
|
|
|
|
-ss = empezar en
|
|
-to = terminar en
|
|
|
|
```
|
|
|
|
2] Descargar y fusionar un video desde un enlace m3u8, no debe estar encriptado.
|
|
|
|
```Descargar y fusionar un video
|
|
|
|
ffmpeg -i "URL.m3u8" -c copy -bsf:a aac_adtstoasc output.mp4
|
|
|
|
```
|
|
|
|
3] Escalar un video a la mitad
|
|
|
|
```Escalar un video
|
|
|
|
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 -vf "scale=iw/2:ih/2" output.mp4
|
|
|
|
```
|
|
|
|
4] Concatenar videos.
|
|
|
|
```Concatenar videos
|
|
|
|
ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4
|
|
|
|
```
|
|
|
|
El archivo files.txt debe contener las rutas de los videos en el formato:
|
|
|
|
```
|
|
|
|
file 'path/video1.mp4'
|
|
file 'path/video2.mp4'
|
|
|
|
```
|
|
|
|
5] Extraer el audio de un video
|
|
|
|
```Extraer el audio
|
|
|
|
ffmpeg -i video.mp4 -q:a 0 -map a audio.ogg
|
|
|
|
```
|
|
|
|
6] Extraer subtítulos de un video
|
|
|
|
Primero extrae los lenguajes y sus índices
|
|
|
|
```
|
|
|
|
ffprobe -v error -of json VIDEO.mkv -of json -show_entries "stream=index:stream_tags=language" -select_streams s
|
|
|
|
```
|
|
|
|
Ahora extrae por índice:
|
|
|
|
```
|
|
|
|
ffmpeg -i VIDEO.mkv -map "0:2" subtitulo.eng.srt
|
|
|
|
```
|
|
|
|
=> gemini://elmau.net/chuletas.gmi Regresar el índice
|
|
=> gemini://elmau.net Regresar el inicio
|
|
|