20221103使用ffmpeg提取mp4视频的字幕

20221103使用ffmpeg提取mp4视频的字幕
2022/11/3 12:19


百度搜索:
MP4 内置字幕 提取

https://www.6yxk.com/ruanjianjiaocheng/224526.html
提取mp4格式视频字幕的方法(工具)
ffmpeg -i D:\temp\001.mp4 -map 0:s:0 sub1.srt


百度搜索:
ffmpeg-iD:\temp\001.mp4-map0:s:0sub1.srt

https://blog.csdn.net/achang21/article/details/49128785?t=1504104504947
ffmpeg 提取 视频,音频,字幕 方法

https://www.cnblogs.com/lykbk/p/uyiuyuiyu343434.html
https://blog.csdn.net/liuyaokai1990/article/details/110417530
FFmpeg 添加 提取mkv视频字幕
微笑点燃希望
于 2020-08-13 16:25:00 发布

ffmpeg -i input.mkv -map 0:s:0 out.ass

这将下载第一个字幕轨。如果有几个,使用0:s:1下载第二个,0:s:2下载第三个,等等。

字幕格式是srt或者ass修改后缀名就可以了;

法二、视频添加提取字幕:
ffmpeg -i F:\472ca95769ddf65f288ed6da2602ef89.mp4 -i F:\lc.srt -map 0:0 -map 0:1 -map 1 -c:a copy -c:v copy -c:s copy F:\video.mkv
ffmpeg -i F:\video.mkv -vn -an -codec:s:0 srt F:\subtitle.srt

Q:\Downloads\【纪录片】机器人时代 The Age Of Robots 2016-云下载>dir
 驱动器 Q 中的卷是 8TB-Q
 卷的序列号是 5695-034C

 Q:\Downloads\【纪录片】机器人时代 The Age Of Robots 2016-云下载 的目录

2022/11/03  12:27    <DIR>          .
2022/11/03  12:27    <DIR>          ..
2022/11/03  12:27                 2 1chapter.txt
2022/11/03  12:27            71,832 2_3_text.srt
2022/11/03  12:27           101,976 sub1.srt
2022/11/03  09:59     1,444,189,179 The.Age.Of.Robots.1of6.Humanoid.Robots.1080p.HDTV.x264.AAC.MVGroup.org.mp4
2022/11/03  10:03     1,460,834,933 The.Age.Of.Robots.2of6.Bioinspired.Robots.1080p.HDTV.x264.AAC.MVGroup.org.mp4
2022/11/03  10:07     1,474,906,415 The.Age.Of.Robots.3of6.City.Of.The.Future.1080p.HDTV.x264.AAC.MVGroup.org.mp4
2022/11/03  10:11     1,477,603,104 The.Age.Of.Robots.4of6.Robot.Explorers.1080p.HDTV.x264.AAC.MVGroup.org.mp4
2022/11/03  10:16     1,533,676,355 The.Age.Of.Robots.5of6.The.Bionic.Man.1080p.HDTV.x264.AAC.MVGroup.org.mp4
2022/11/03  10:21     1,521,713,917 The.Age.Of.Robots.6of6.Entertainment.Robots.1080p.HDTV.x264.AAC.MVGroup.org.mp4
               9 个文件  8,913,097,713 字节
               2 个目录 4,910,263,803,904 可用字节

Q:\Downloads\【纪录片】机器人时代 The Age Of Robots 2016-云下载>ffmpeg -i The.Age.Of.Robots.1of6.Humanoid.Robots.1080p.HDTV.x264.AAC.MVGroup.org.mp4 -map 0:s:0
1.srt
ffmpeg version git-2020-06-28-4cfcfb3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200621
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libb
luray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --e
nable-libsnappy --enable-libsoxr --enable-libsrt --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-libvmaf --enable-libvorbis --enable-libvo
-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable
-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 55.100 / 56. 55.100
  libavcodec     58. 93.100 / 58. 93.100
  libavformat    58. 47.100 / 58. 47.100
  libavdevice    58. 11.100 / 58. 11.100
  libavfilter     7. 86.100 /  7. 86.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'The.Age.Of.Robots.1of6.Humanoid.Robots.1080p.HDTV.x264.AAC.MVGroup.org.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    creation_time   : 2017-07-26T11:25:17.000000Z
    encoder         : My MP4Box GUI 0.6.0.6 <http://my-mp4box-gui.zymichost.com>
  Duration: 00:51:30.97, start: 0.000000, bitrate: 3737 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 3573 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94
tbc (default)
    Metadata:
      creation_time   : 2017-07-26T00:24:48.000000Z
      handler_name    : The.Age.Of.Robots.1of6.Humanoid.Robots.1080p.HDTV.x264.AAC.MVGroup.org.mp4
      encoder         : JVT/AVC Coding
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 159 kb/s (default)
    Metadata:
      creation_time   : 2017-07-26T11:25:44.000000Z
      handler_name    : The.Age.Of.Robots.1of6.Humanoid.Robots.1080p.HDTV.x264.AAC.MVGroup.org.mp4
    Stream #0:2(und): Subtitle: mov_text (tx3g / 0x67337874), 1920x1080, 0 kb/s (default)
    Metadata:
      creation_time   : 2017-07-26T11:25:48.000000Z
      handler_name    : The.Age.Of.Robots.1of6.Humanoid.Robots.1080p.HDTV.x264.AAC.MVGroup.org.srt
Output #0, srt, to '1.srt':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    encoder         : Lavf58.47.100
    Stream #0:0(und): Subtitle: subrip (srt), 1920x1080 (default)
    Metadata:
      creation_time   : 2017-07-26T11:25:48.000000Z
      handler_name    : The.Age.Of.Robots.1of6.Humanoid.Robots.1080p.HDTV.x264.AAC.MVGroup.org.srt
      encoder         : Lavc58.93.100 srt
Stream mapping:
  Stream #0:2 -> #0:0 (mov_text (native) -> subrip (srt))
Press [q] to stop, [?] for help
size=     100kB time=00:48:52.61 bitrate=   0.3kbits/s speed= 796x
video:0kB audio:0kB subtitle:67kB other streams:0kB global headers:0kB muxing overhead: 49.586342%

Q:\Downloads\【纪录片】机器人时代 The Age Of Robots 2016-云下载>


参考资料:
https://weibo.com/ttarticle/p/show?id=2309404367345459049407
如何提取MP4中的内挂(内封)字幕


https://www.bilibili.com/read/cv4720391/
(六)-map参数的学习,如何用ffmpeg提取替换合并轨道流、压制字幕


https://www.zhihu.com/question/35252446
有哪些提取视频内嵌字幕的方法?
https://github.com/apm1467/videocr

葛易
大概善意
124 人赞同了该回答
apm1467/videocr
​github.com/apm1467/videocr
一个我写的开源 Python 库,用图像识别技术提取视频中的画面内嵌字幕,输出成带时间轴的 SRT 文本字幕。使用了开源的 Tesseract 神经网络 OCR 引擎,支持识别几乎任何语言文字,包括英文、中文和日文。
在我自己的测试中准确度不错,就是比较吃 CPU 资源。
发布于 2019-05-01 22:14


2.video-subtitle-extractor(视频字幕提取器)https://github.com/YaoFANGUK/video-subtitle-extractor​github.com/YaoFANGUK/video-subtitle-extractor
【请确保已经安装 python 3.8+,使用conda创建项目虚拟环境并激活环境 (建议创建虚拟环境运行,操作较为繁琐,剪辑新手需细细研究下】
video-subtitle-extractor是一款小众的开源视频字幕提取器,本身无需申请第三方API,便可本地实现文本识别,从视频中提取硬编码字幕(hardsub)并生成srt文件的GUI工具。导入文件后选择视频中的字幕区域,进行视频帧中的文本识别,过滤非字幕区域的文本,在去除重复字幕行后,可生成srt字幕文件。


https://zhuanlan.zhihu.com/p/407813245
在MAC上从MP4视频文件中提取字幕的方法


https://baijiahao.baidu.com/s?id=1730047802086763237&wfr=spider&for=pc
你想知道提取视频内嵌字幕的方法吗?快看过来


https://digi.china.com/digi/20220915/202209151142967.html
如何提取视频内嵌字幕?这两种方法可以立刻解决!


https://wenku.baidu.com/view/84e287b9ef3a87c24028915f804d2b160a4e867d.html?_wkts_=1667444268626
什么软件可以把MP4视频里的字幕提取出来?
字幕提取工具CCSubDownloader v0.2.3绿色版本


https://www.dzlps.cn/356384.html
mp4内嵌字幕如何提取,视频里的字幕怎么提取成文字
 

猜你喜欢

转载自blog.csdn.net/wb4916/article/details/127672718