我正在尝试将字幕从scenarist隐藏式字幕(scc)转换为webvtt(vtt)
但是我得到了一些特殊字符,因此请阅读ffmpeg文档https://trac.ffmpeg.org/wiki/ExtractSubtitles 我了解了-txt_format选项。但是当我使用它时,ffmpeg抛出错误,提示
“无法识别的选项'txt_format'。 拆分参数列表时出错:找不到选项”
FFMPEG版本: ffmpeg版本4.1.4版权所有(c)2000-2019 FFmpeg开发人员 使用gcc 9.1.1(GCC)20190716构建
下面是跟踪级别日志:
ffmpeg version 4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.1.1 (GCC) 20190716
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'trace'.
Reading option '-i' ... matched as input url with argument '223163.scc'.
Reading option 'test.vtt' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url 223163.scc.
Successfully parsed a group of options.
Opening an input file: 223163.scc.
[NULL @ 0000025d22799500] Opening '223163.scc' for reading
[file @ 0000025d2279a600] Setting default whitelist 'file,crypto'
Probing scc score:100 size:2048
[scc @ 0000025d22799500] Format scc probed with size=2048 and score=100
[scc @ 0000025d22799500] Before avformat_find_stream_info() pos: 38022 bytes read:38022 seeks:0 nb_streams:1
[scc @ 0000025d22799500] All info found
[scc @ 0000025d22799500] stream 0: start_time: -9223372036854776.000 duration: -9223372036854776.000
[scc @ 0000025d22799500] format: start_time: -9223372036854.775 duration: -9223372036854.775 bitrate=0 kb/s
[scc @ 0000025d22799500] After avformat_find_stream_info() pos: 38022 bytes read:38022 seeks:0 frames:0
Input #0, scc, from '223163.scc':
Duration: N/A, bitrate: N/A
Stream #0:0, 0, 1/1000: Subtitle: eia_608
Successfully opened the file.
Parsing a group of options: output url test.vtt.
Successfully parsed a group of options.
Opening an output file: test.vtt.
File 'test.vtt' already exists. Overwrite ? [y/N] y
[file @ 0000025d227d1c40] Setting default whitelist 'file,crypto'
Successfully opened the file.
Output #0, webvtt, to 'test.vtt':
Metadata:
encoder : Lavf58.20.100
Stream #0:0, 0, 1/1000: Subtitle: webvtt
Metadata:
encoder : Lavc58.35.100 webvtt
Stream mapping:
Stream #0:0 -> #0:0 (eia_608 (cc_dec) -> webvtt (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Last message repeated 1 times
No more output streams to write to, finishing.
size= 19kB time=00:18:28.36 bitrate= 0.1kbits/s speed=2.26e+04x
video:0kB audio:0kB subtitle:10kB other streams:0kB global headers:0kB muxing overhead: 88.647011%
Input file #0 (223163.scc):
Input stream #0:0 (subtitle): 411 packets read (19101 bytes); 349 frames decoded;
Total: 411 packets (19101 bytes) demuxed
Output file #0 (test.vtt):
Output stream #0:0 (subtitle): 349 frames encoded; 349 packets muxed (10244 bytes);
Total: 349 packets (10244 bytes) muxed
349 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0000025d22799c80] Statistics: 0 seeks, 2 writeouts
[AVIOContext @ 0000025d227a2880] Statistics: 38022 bytes read, 0 seeks
答案 0 :(得分:0)
请尝试此选项
ffmpeg -i inputfile -f webvtt outfile