Estoy intentando normalizar el audio de un archivo de video (mp4), pero ffmpeg arroja un error.
El comando:
ffmpeg -i input.mp4 -af "[0:a]compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/ -20:6:0:-90:0.2[audio]" -map 0:v -map "[audio]" -codec:v copy output.mp4
La salida :
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 13 2013 21:26:48 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 19.100 / 52. 19.100
libavcodec 55. 0.100 / 55. 0.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 54. 4.100 / 54. 4.100
libavfilter 3. 45.103 / 3. 45.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'filename.mp4':
Metadata:
major_brand : isom
minor_version : 1
compatible_brands: isomavc1
creation_time : 2015-03-15 13:31:29
Duration: 02:49:04.00, start: 0.000000, bitrate: 1917 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 1819 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
Metadata:
creation_time : 2015-03-15 13:31:29
handler_name : video.264#trackID=1:fps=23.976 - Imported with GPAC 0.5.0-rev
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 93 kb/s
Metadata:
creation_time : 2015-03-15 13:31:43
handler_name : GPAC ISO Audio Handler
El error:
Output with label 'audio' does not exist in any defined filter graph, or was already used elsewhere.
¿Supongo que es una simple cuestión de sintaxis? Pero eso es lo que ha probado varias variaciones sin encontrar solución.
Respuesta1
Necesitas usar -filter_complex
en lugar de -af
(o -filter:a
). El primero es necesario para filtros con etiquetas y más de una entrada/salida.
ffmpeg -i input.mp4 -filter_complex "[0:a]compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/ -20:6:0:-90:0.2[audio]" -map 0:v -map "[audio]" -codec:v copy output.mp4