我需要从不同的视频文件中提取字幕到.srt
格式(在html5视频中使用它)。
我尝试了很多与谷歌发现的变种。但每次我收到此错误:
打开输出流编码器时出错#0:0 - 可能是错误的参数,如bit_rate,rate,width或height
我认为,这个错误意味着ffmpeg可以解码源字幕但不能将其编码为.srt
格式。启用所有编解码器(我使用不同的配置从git编译后来的ffmpeg版本几次)。
这是输出:
# /usr/local/bin/ffmpeg -i /var/video/sources/Balbesy1.m2ts -an -vn -copyinkf -scodec srt -f srt -y sub.srt
ffmpeg version N-49947-g9f16cb9 Copyright (c) 2000-2013 the FFmpeg developers
built on Feb 14 2013 14:26:10 with gcc 4.4.5 (Debian 4.4.5-8)
configuration: --enable-encoder=dvdsub --enable-decoder=dvdsub --enable-decoder=pgssub --enable-encoder=srt --enable-decoder=srt --enable-encoder=srt --enable-decoder=srt
libavutil 52. 17.101 / 52. 17.101
libavcodec 54. 91.103 / 54. 91.103
libavformat 54. 63.100 / 54. 63.100
libavdevice 54. 3.103 / 54. 3.103
libavfilter 3. 37.101 / 3. 37.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
[mpegts @ 0x2719040] Stream #5: not enough frames to estimate rate; consider increasing probesize
[mpegts @ 0x2719040] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x271fec0] start time is not set in estimate_timings_from_pts
Input #0, mpegts, from '/var/video/sources/Balbesy1.m2ts':
Duration: 01:18:11.89, start: 599.958300, bitrate: 37378 kb/s
Program 1
Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Stream #0:1[0x1100]: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), fltp, 768 kb/s
Stream #0:2[0x1101]: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), fltp, 768 kb/s
Stream #0:3[0x1102]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:4[0x1103]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:5[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
Output #0, srt, to 'sub.srt':
Stream #0:0: Subtitle: srt
Stream mapping:
Stream #0:5 -> #0:0 (pgssub -> srt)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
抱歉我的英文