Me gustaría codificar subtítulos usando FFmpeg , estoy tratando de hacer esto usando el siguiente comando:
ffmpeg -i grdedFinal.mov -vf subtitles=portSbs.srt gradedFinalwithSubs.mov
que devuelve el siguiente error:
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'grdedFinal.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2015-02-28 14:04:35
Duration: 00:18:09.84, start: 0.000000, bitrate: 11270 kb/s
Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:
creation_time : 2015-02-28 14:04:35
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1024x576, 9728 kb/s, 25 fps, 25 tbr, 2500 tbn, 5k tbc (default)
Metadata:
creation_time : 2015-02-28 14:04:35
handler_name : Apple Alias Data Handler
encoder : H.264
[Parsed_subtitles_0 @ 0x7fbeaa50bca0] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 1.1.3 (COMPLEX)
[Parsed_subtitles_0 @ 0x7fbeaa50bca0] Unable to open portSbs.srt
[AVFilterGraph @ 0x7fbeaa50ba80] Error initializing filter 'subtitles' with args 'portSbs.srt'
Error opening filters!
Seguí esas instrucciones al instalar FFmpeg :
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
A juzgar por el mensaje de error, parece que algo puede estar mal con el archivo SRT , ¿no es así?
me-bash-3.2:/Volumes/Duracell$ ffmpeg -i gradedFinal.mov -i portSbs.srt -vf subtitles gradedFinalwithSubs.mov
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'gradedFinal.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2015-02-28 14:04:35
Duration: 00:18:09.84, start: 0.000000, bitrate: 11267 kb/s
Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:
creation_time : 2015-02-28 14:04:35
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1024x576, 9728 kb/s, 25 fps, 25 tbr, 2500 tbn, 5k tbc (default)
Metadata:
creation_time : 2015-02-28 14:04:35
handler_name : Apple Alias Data Handler
encoder : H.264
portSbs.srt: Invalid data found when processing input
El archivo de subtítulos se ve así (extracto):
1
00:02:25,000 —> 00:02:29,000
Falei com um homem que me disse que eu estava a usar
demasiada roupa
2
00:02:29,000 –> 00:02:31,000
Que com isso devo querer proteger-me de alguma coisa
me-bash-3.2:/Volumes/Duracell$ file -I portSbs.srt
portSbs.srt: text/plain; charset=utf-8
me-bash-3.2:/Volumes/Duracell$ ffmpeg -help filter=subtitles
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.0.2 (clang-700.1.81)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Filter subtitles
Render text subtitles onto input video using the libass library.
Inputs:
#0: default (video)
Outputs:
#0: default (video)
subtitles AVOptions:
filename <string> ..FV.... set the filename of file to read
f <string> ..FV.... set the filename of file to read
original_size <image_size> ..FV.... set the size of the original video (used to scale fonts)
fontsdir <string> ..FV.... set the directory containing the fonts to read
charenc <string> ..FV.... set input character encoding
stream_index <int> ..FV.... set stream index (from -1 to INT_MAX) (default -1)
si <int> ..FV.... set stream index (from -1 to INT_MAX) (default -1)
force_style <string> ..FV.... force subtitle style
Parece ser que el archivo de subtítulos no tenía -->
sino un –>
con el –
correspondiente al guión en que se colocó en el archivo, el cual fue editado a mano externamente. Parece que el signo del guión se asignó para escribir --en Mac TextEdit (la funcionalidad se puede desactivar en las preferencias) .
gian
Konrad
/Volumes/Duracell/portSbs.srt
pero llegué al mismo mensaje de error. El archivo parece no estar dañado, puedo abrirlo y editarlo en un editor de texto.gian
ffmpeg -i grdedFinal.mov -i portSbs.srt -vf subtitles gradedFinalwithSubs.mov
y pegue la salida de la consola en su pregunta.Konrad
gian
ffmpeg -help filter=subtitles
<-- ¿eso diceunknown filter
?Konrad
puntapié
Konrad