-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: initial closed captions support #565
base: main
Are you sure you want to change the base?
feat: initial closed captions support #565
Conversation
This is pretty cool! Few thoughts: It would be cool if we can declare the captions using React markup, using e.g. We can also write a function that loads .srt files and converts it to There are two ways people use captions: Either embedded in the video file, and you can turn them on / off or switch languages, or burnt into the video. While the second type can already be done using Remotion, maybe we can provide some helpers too. Twitter wants publishers to upload a separate .srt files, so I feel like we also need to provide an option to output a .srt file as a secondary output file alongside the actual video. This is a great proof of concept showing that all of this is possible, so thanks a lot for making it! |
Bug possibly in macOS: I cannot select subtitles when opening the video in QuickTime, however they do show up in Preview (when I press space bar on a video) |
Thank you for the feedback. I was able to select the subtitle in QuickTime, I'm not sure what happened on your side. I think that a
I'll start to look into it and update this PR. |
I think QuickTime is sometimes a bit buggy, but probably nothing we can do about it. Like the idea of being able to load subtitles remotely! And agree with multilingual support and automatic transformation into FFMPEG syntax. Myself I am probably going to be busy with Lambda for the next month at least, and would want to pick up other big projects after that. |
4c832be
to
8b07ce6
Compare
@JonnyBurger, based on how assets (audio and video) are implemented, I implemented a draft of a It only supports remote captions and SRT files for now and it downloads them during render - just like remote assets. It supports some metadata properties ( <Caption
language="eng"
src="http://127.0.0.1:8080/subs.srt"
title="Some title"
/>
<Caption src="http://127.0.0.1:8080/subs_alt.srt" /> Please provide feedback on my decisions and work so far when you have some time. Best regards! 😃 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sorry for taking a year to reply! 😅 Some thoughts on how to proceed:
<>
<Sequence from={0} durationInFrames={20}>
<Subtitle>Hello World</Subtitle>
</Sequence>
<Sequence from={20} durationInFrames={40}>
<Subtitle>Second subtitle</Subtitle>
</Sequence>
</> Being able to take advantage of existing primitives like Sequence and Series would be nice.
|
The filters for rendering subtitles were broken, I fixed them in my commits.
I haven't addressed any of your comments yet but here are a few notes/questions:
|
Thanks for fixing!
By baked in subtitles I mean burned subtitles yeah. The styling would only work for burned in subtitles of course. |
|
+1 on adding this component. Need the 'baked-in' subtitles just as much as the video component for a project we've been working on |
bb1b2d6
to
ff2e2b6
Compare
Context
I was recently playing around with FFmpeg to embed SRT files as closed captions, merging them into the final video as subtitle tracks.
Regarding FFmpeg, it's somewhat easy to do but I've found a couple of issues.
I'm opening this draft PR so that others can have a look and we can start a discussion about an API for this if we see fit for the project.
Changes
remote-video
demo for faster feedback loop;Notes
2:s
is used before the subtitle is the third input. If there were more, it would change accordingly;mov_text
is needed to encode the SRT file and it's the only subtitle encoder supported in an MP4 containerDemo
Here is a video with the output of this branch/PR.
PS: The video is cut so it doesn't show any info from my VLC but I hope it gives you a good picture of the result, including the duration bug.
remotion-cc-demo.mp4