How to burn subtitles into the video

将图片转化为.py文件 图片 转换代码 import base64 def pic2py(picture_name): """ 将图像文件转换为py文件 :param picture_name: :return: """ open_pic = open("%s" % picture_name, 'rb') b64str = base64.b64encode(open_pic.read()) open_pic.close() # 注意这边b64st 阅读详情
AI摘要

本文将介绍如何使用FFmpeg的subtitles和ass过滤器来在视频中烧录文本字幕和图片字幕。包括如何使用subtitles过滤器和ass过滤器,以及在Windows环境下设置字体路径以确保libass正常工作。

You can burn text subtitles with one of two filters: subtitles or ass.

subtitles  filter

As of Nov 29, 2012 you can also simply use the subtitles filter:

ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi

This filter requires ffmpeg to be compiled with --enable-libass (if you are building FFmpeg yourself, look for the libass-dev package on Debian-like distributions).

ass filter

Using FFmpeg's ass video filter (see Wikipedia for  Advanced SubStation Alpha), we can draw text of the subtitles into the movie, like this:

ffmpeg -i video.avi -vf "ass=subtitle.ass" out.avi

As with the subtitles filter, this filter requires ffmpeg to be compiled with --enable-libass.

If your subtitle is in SubRip, MicroDVD or any other supported text subtitles, you have to convert it to ASS before using the filter:

ffmpeg -i subtitle.srt subtitle.ass

For Windows users  this link may be useful, as you have to setup font paths just right to get libass to work

picture based subtitles

You can burn "picture based" subtitles into a movie as well (for instance, dvdsub is a type of picture based overlay subtitles), by using the overlay filter to overlay the images. Here is an example - an MKV with dvdsub subtitles in a separate stream:

ffmpeg -i input.mkv -filter_complex "[0:v][0:s]overlay[v]" -map [v] -map 0:a <output options> output.mkv

If you have multiple subtitle streams, you can select which one to use by replacing [0:s] with [0:s:0] to select the first subtitle stream or [0:s:1] to select the second subtitle stream, and so on. See also the official documentation; search for "hardcode".

Modern Image Quality Assessment_Zhou Wang_Alan C. Bovik Modern Image Quality Assessment_Zhou Wang_Alan C. Bovik 现代图像质量评估 文字版(非扫描) 立即下载

相关推荐

STorM BGC V1.31硬件+SimpleBGC固件:从零搭建三轴云台开发环境(Keil+JLink避坑指南)

本文详细介绍了如何从零搭建STorM BGC V1.31硬件+SimpleBGC固件的三轴云台开发环境,涵盖硬件连接、Keil+JLink开发工具配置、固件编译与烧录等关键步骤,并提供了常见问题的解决方案和调试技巧,帮助开发者快速上手三轴云台开发。

weixin_28693683的博客 381

ShineTime – A Kick-Ass New jQuery & CSS3 Gallery With Animated Shine Effects

This week I’d like to show you how you can create a kick-ass animatedShine Effect with jQuery &amp; CSS3and then use it to create your very own Shiny Gallery ‘ShineTime’. This effect is ...

huobengluantiao8 16万+

CentOS 7 安装 Python 3.10

我这里已经软链接了,正常未链接之前是python->python2.7而不是python3.10。python2.7默认安装是在 /usr/bin目录中,切换到/usr/bin/更改yum配置,因为其要用到python2才能执行,否则会导致yum不能正常使用。2. 安装 Python 3.10 必需的 openssl >= 1.1.1。默认的centos7是没有安装pip,先添加epel扩展源。/usr/bin/python 修改为如下。添加软链接,将原来的链接备份。添加python3的软链接。

bensonyang888的博客 2905

50 Kick-Ass Websites You Need to Know About

http://www.maximumpc.com/50-kick-ass-websites-you-need-to-know-about/#page-1 It's time to update the entries in your browser's links toolbar. But with recent estimates putting the size of the i

onlyForCloud的专栏 60万+

LAMMPS实操系列(一): 大量FCC-CoCrCuFeNi高熵合金建模与最稳定结构筛选

高熵合金(High-entropy alloys,HEA),是由五种或五种以上等量或大约等量金属形成的合金。由于高熵合金可能具有许多优秀的物理化学性质,因此在材料科学领域受到广泛关注

Ceshigo_CD的博客 3258

别再乱改基础库了!手把手教你搞定uni-app小程序上传图片报错(chooseAndUploadFile权限篇)

本文详细解析了uni-app开发微信小程序时遇到的`chooseAndUploadFile`权限报错问题,并提供了四步解决方案。从隐私协议与API权限的关联入手,指导开发者正确配置后台声明、双重提交策略和版本管理,避免降级基础库等常见误区,确保小程序合规运行。

weixin_33709364的博客 276

American ,they say....

1.You just can’t get over…  (you can’t forget…) 很难忘记…… 例句: The French soccer fans can’t get over the World Cup 2002. (法国的球迷很难从2002年世界杯中的失利的阴影中走出来。) I just can’t get over Lisa. 2.dwell on  (stop thinki

童话。成长历程 5万+

开发具有情感分析能力的AI Agent

本文将深入探讨开发具有情感分析能力的AI Agent的各个方面。我们将首先介绍情感分析的基础知识,包括定义、背景和应用领域。接着,我们将详细讲解情感分析的核心概念、数据处理方法和算法原理。随后,文章将展示如何设计情感分析系统架构,并进行项目实战,包括环境安装、源代码实现和案例分析。最后,我们将总结最佳实践和注意事项,为读者提供进一步学习的资源。情感分析(Sentiment Analysis),也称为意见挖掘,是自然语言处理(NLP)的一个分支。

SuperAGI2025 1146

How Computers Represent ImagesThe PPM File Format(http://cs.anu.edu.au/Student/comp1100.2006.s1/assts/asst1/ppm.html)

Colours The colours you see on a computer screen are made up of tiny red, green and blue dots. To specify a colour, you have to say how much red, how much green, and how much blue is in the colour,

YANG ZHONGJUN的专栏 16万+

ROS2 Nav2 - 模型预测路径积分控制器(MPPI)

这是一个预测控制器(局部轨迹规划器),用于实现模型预测路径积分(MPPI)算法,以跟踪具有自适应避障功能的路径。它包含基于插件的 critic 函数,可影响算法的行为。它由 Aleksei Budyakov 创建,由 Steve Macenski 为 Nav2 进行改编和开发。该插件实现了 nav2_core::Controller(控制器)接口,可在整个导航堆栈中作为控制器服务器的动作服务器(controller_server)中的局部轨迹规划器使用。据测定,该控制器可在中等英特尔处理器(第四代 i5)上

机器人控制与仿真应用 3913

【数据同化第一期】基本概念介绍

【数据同化第一期】基本概念介绍

WW、forever的博客 1904

How to burn in DVB subtitles

Btw, by "How can I burn in this subtitles to the out file.", do you mean: 1) Produce the output video that has the subtitles drawn/merged/encoded together with the video (burn-in) 2) Produce the out

fanbird2008的专栏 882

Python 爬虫实战:分析 AJAX 请求抓取搜狐新闻数据

在Web 2.0时代,大量网站采用AJAX技术实现动态内容加载。传统基于静态HTML解析的爬虫技术(如BeautifulSoup)已无法应对这类场景。本文将以搜狐新闻为实战目标,详解如何通过分析AJAX请求接口实现动态新闻数据的精准抓取。

yansideyucsdn的博客 1751

基于AI语音识别与机器翻译的视频字幕自动生成技术实践

语音识别(ASR)与机器翻译(MT)是自然语言处理领域的核心技术,它们通过深度学习模型将音频信号转化为文本,并实现跨语言语义转换。其技术价值在于极大提升了信息处理效率,打破了语言障碍,使内容可访问性大幅增强。在工程实践中,这两项技术常被集成应用于多媒体处理流水线,特别是在视频内容本地化、在线教育、无障碍访问等场景中发挥关键作用。本文聚焦于利用开源工具链(如Whisper模型与FFmpeg)构建自动化视频字幕生成方案,通过模块化设计实现从音频提取、多语言识别、文本翻译到字幕合成的完整流程,为开发者提供一套可本

weixin_34326558的博客 496

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

OpenMontage:AI视频自动化工作流编排系统实战指南

如果你还在用 Midjourney 生成图片、用 ElevenLabs 生成配音、用剪映手动剪辑,然后拼凑出一个视频,那么你正在重复一个即将被淘汰的工作流。AI 视频生成的真正瓶颈,从来不是某个单点模型的效果,而是如何将十几个分散的工具和环节串联成一个稳定、可重复、可扩展的自动化流程。 这就是为什么 GitHub 上 star 数超过 12K 的 OpenMontage 项目值得每一个关注 AI 内容生产的开发者深入研究。它不是一个“更好”的视频生成模型,而是一个“导演”——一个能指挥 Claude Cod

weixin_34032621的博客 414

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

Create Local Cloudera Parcels Repo to Save Your ASS

If you want to install Hadoop cluster via Cloudera Manager in CHINA, the network to cloudera parels is toooooo slow. You must create your local parcel repo to save your ass, thanks to the DAMN GFW!!...

George's dev dream port 3万+

男人最爱丰满女人

Tina: Am I bound to be dying alone? 我是不是要孤独终老啊?  Mike: What? No. You are the hottest girl as far as I know. 怎么了?怎么会?你是我见过的最性感的女生了。  Tina: Will you please top it, super la

少年休闲海 14万+

The Top 50 ‘Pictures of the Day’ for 2011

The Top 50 ‘Pictures of the Day’ for 2011 Posted by Sifter in GALLERIES, PICTURE OF THE DAY Every day at 5pm the Sifter posts the Picture of the Day. Below you will find a collection of the Sift...

weixin_30872733的博客 1万+

Add Subtitle (srt) to Video by using Ffmpeg

say you have a srt subtitle file and any format of audio we can combine such stream together to generate a video with the subtitle ffmpeg  --ffmpeg command -i inputfile --input file -fv subtitles=

jacky5154的专栏 1万+

fresco加载drawable图片和asstes图片

/** * 加载本地图片(drawable图片) * @param context * @param simpleDraweeView * @param id */ public static void loadResPic(Context context, SimpleDraweeView simpleDraweeView, int id) { Uri uri = Uri.parse("res://" + context...

weixin_41673515的博客 1434

全美超模大赛图片大赏【图片欣赏】

全美超模大赛(America/s Next Top Model ,简称ANTM)是一个给参赛者争夺模特儿及化妆品合约的美国真人秀,由知名模特儿泰雅·宾丝(Tyra Banks)任主持及监制选出新一代超模。 全美超模大赛带给许多女孩们梦想,更给了她们机会。赢得全美超模大赛的冠军,能得到与Elite Model Management所签的合约、与Covergirl签订10万美元的

if you really want ... 1万+

FFMpeg Intro - Subtitles and Metadata

1. ffmpeg-3.2 version 2. ass ./ffmpeg -i war.ts -vf ass=t1.ass -an -c:v libx264 -s 640x360 ff.ts

fanbird2008的专栏 2296

HDU 5374 Tetris(模拟俄罗斯方块)

Tetris God Wu enjoy coding some trivial games like Tetris.His Tetris is made up by 9 columns and 12 rows.  The game will prossess as following steps 1.a random token will appear ,and its specia

zgerbin 1460

use sentences perfectly

1. Its not like that.不是那样的。 这句话是用来辟谣的。当别人误会了一件事的来龙去脉,你就可以跟他说Its not like that.「不是那样的。」当然随着语气及情境的不同,Its not like that.这句 话也有可能是你用来硬拗的藉口。 2. There is nothing good playing. 没好电影可看 这里的Theres nothing g

albert的专栏 3万+

最全哔哩哔哩学习资源大整理,主要分为14大类,包含各个方面的学习资源

视频分为以下14类,分别是: • 北京大学演讲及公开课(一共1133个视频) • 耶鲁大学演讲及公开课(一共347个视频) • 哈佛大学演讲及公开课(一共266个视频) • 斯坦福大学演讲及公开课(一共282个视频) • 麻省理工学院演讲及公开课(一共307个视频) • 编程(播放量前8000个视频) • 英语(一共12277个视频) • 日语(一共7703个视频) • 高数(一共1927个视频)...

代码讲故事 7万+

【OpenCV】14 图像插值

14 代码 实验结果 解释 优点 所有内容均来源于贾志刚老师的知识星球——OpenCV研习社,本文为个人整理学习,已获得贾老师授权,有兴趣、有能力的可以加入贾老师的知识星球进行深入学习。 ...

刘小胖的博客 384
上一篇: jar 打包java文件
下一篇: Vim 完全攻略
LanderlYoung
博客等级 码龄14年 22粉丝 6原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值