Por favor, tenha paciência comigo; Eu ainda estou aprendendo as complexidades do ffmpeg e tenho um problema com legendas.
Então, estou tentando alterar o conteúdo de um vídeo de mkv para mp4 e, simultaneamente, codificar as legendas no vídeo para que meu Playstation as aceite.
O mkv é estruturado da seguinte forma:
ffmpeg version git-2013-09-23-34b429d Copyright (c) 2000-2013 the FFmpeg developers
built on Sep 23 2013 18:16:42 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
configuration: --prefix=/home/seb/ffmpeg_build --extra-cflags=-I/home/seb/ffmpeg_build/include --extra-ldflags=-L/home/seb/ffmpeg_build/lib --bindir=/home/seb/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
libavutil 52. 46.100 / 52. 46.100
libavcodec 55. 33.100 / 55. 33.100
libavformat 55. 18.102 / 55. 18.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 87.100 / 3. 87.100
libswscale 2. 5.100 / 2. 5.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100
[matroska,webm @ 0xa52ce60] Could not find codec parameters for stream 2 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, matroska,webm, from 'entirely-innocent-video.mkv':
Metadata:
creation_time : 2014-11-15 09:27:00
Duration: 02:10:24.29, start: 0.000000, bitrate: 3838 kb/s
<--BLAH BLAH BLAH CHAPTERS -->
Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709), 1280x690 [SAR 1:1 DAR 128:69], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
Metadata:
BPS : 3196139
BPS-eng : 3196139
DURATION : 02:10:24.233000000
DURATION-eng : 02:10:24.233000000
NUMBER_OF_FRAMES: 187594
NUMBER_OF_FRAMES-eng: 187594
NUMBER_OF_BYTES : 3125917529
NUMBER_OF_BYTES-eng: 3125917529
_STATISTICS_WRITING_APP: mkvmerge v7.3.0 ('Nouages') 32bit built on Oct 22 2014 18:44:01
_STATISTICS_WRITING_APP-eng: mkvmerge v7.3.0 ('Nouages') 32bit built on Oct 22 2014 18:44:01
_STATISTICS_WRITING_DATE_UTC: 2014-11-15 09:27:00
_STATISTICS_WRITING_DATE_UTC-eng: 2014-11-15 09:27:00
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
Metadata:
BPS : 640000
BPS-eng : 640000
DURATION : 02:10:24.288000000
DURATION-eng : 02:10:24.288000000
NUMBER_OF_FRAMES: 244509
NUMBER_OF_FRAMES-eng: 244509
NUMBER_OF_BYTES : 625943040
NUMBER_OF_BYTES-eng: 625943040
_STATISTICS_WRITING_APP: mkvmerge v7.3.0 ('Nouages') 32bit built on Oct 22 2014 18:44:01
_STATISTICS_WRITING_APP-eng: mkvmerge v7.3.0 ('Nouages') 32bit built on Oct 22 2014 18:44:01
_STATISTICS_WRITING_DATE_UTC: 2014-11-15 09:27:00
_STATISTICS_WRITING_DATE_UTC-eng: 2014-11-15 09:27:00
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:2(eng): Subtitle: hdmv_pgs_subtitle (default) (forced)
Metadata:
BPS : 840
BPS-eng : 840
DURATION : 01:40:03.622000000
DURATION-eng : 01:40:03.622000000
NUMBER_OF_FRAMES: 252
NUMBER_OF_FRAMES-eng: 252
NUMBER_OF_BYTES : 630808
NUMBER_OF_BYTES-eng: 630808
_STATISTICS_WRITING_APP: mkvmerge v7.3.0 ('Nouages') 32bit built on Oct 22 2014 18:44:01
_STATISTICS_WRITING_APP-eng: mkvmerge v7.3.0 ('Nouages') 32bit built on Oct 22 2014 18:44:01
_STATISTICS_WRITING_DATE_UTC: 2014-11-15 09:27:00
_STATISTICS_WRITING_DATE_UTC-eng: 2014-11-15 09:27:00
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Eu então uso o seguinte comando:
ffmpeg -i entirely-innocent-video -c:v copy -c:a copy -c:s mov_text entirely-innocent-video.mp4
Que, até onde eu posso ver, codifique novamente o vídeo, deixando o áudio e o vídeo intocados, mas codifique nas legendas ... Mas isso não ... Ele falha com a seguinte mensagem:
Error while opening encoder for output stream #0:2 - maybe incorrect parameters such as bit_rate, rate, width or height
E eu não consigo descobrir o porquê! Eu tentei todos os tipos de permutações no comando -c: s mov_text mas continue recebendo mensagens de erro!
Suponho que tenha algo a ver com esta mensagem:
[matroska,webm @ 0xa52ce60] Could not find codec parameters for stream 2 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Mas eu não tenho experiência suficiente com o ffmpeg para saber por onde começar a fazer algo sobre isso ...
Algum de vocês, pessoas inteligentes e experientes, pode me ajudar a desvendar o que está acontecendo? :)
Obrigado!
Seb