Skip to content

New "Caption" Effect (Supports VTT and Subrip formats)#583

Merged
jonoomph merged 9 commits intodevelopfrom
caption-effect
Oct 29, 2020
Merged

New "Caption" Effect (Supports VTT and Subrip formats)#583
jonoomph merged 9 commits intodevelopfrom
caption-effect

Conversation

@jonoomph
Copy link
Copy Markdown
Member

@jonoomph jonoomph commented Oct 27, 2020

This is a new effect, which allows for VTT or Subrip caption data to be displayed over a clip. Many different keyframes are available, from font-size, color, background color, alpha, corner radius, padding, font family, stroke, etc... Also, word-wrap is supported, and custom margins for left, top, and right (didn't include bottom because I didn't want to crop the text off). You can also set/animate a custom fade-in / fade-out for each caption, which gives it a nice animated look.

This not yet implemented:

  • Light formatting: <b><i><u><font color=""></font></u></i></b>
  • Custom regions (i.e. 2 dialogs happening, and displayed in different areas)

Pretty much we parse the basic timestamp and caption text out, and display when it's the correct time... augmented by all the animation keyframes that are set.

CaptionsOpenShot

- Added background color and alpha
- Added font color alpha
- Added fade in / out logic
- Added background padding & rounded corners
- Added adjustable font name
…ers see a valid example)

- Append some newlines onto the end of any caption text... needed by the regex for some reason
- Updated font name and caption text to be a new type (font and caption), and we have corresponding UI changes for those on openshot-qt
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 27, 2020

Codecov Report

Merging #583 into develop will decrease coverage by 0.22%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #583      +/-   ##
===========================================
- Coverage    50.10%   49.88%   -0.23%     
===========================================
  Files          130      132       +2     
  Lines        10324    11273     +949     
===========================================
+ Hits          5173     5623     +450     
- Misses        5151     5650     +499     
Impacted Files Coverage Δ
src/EffectInfo.cpp 0.00% <0.00%> (ø)
src/effects/Caption.cpp 0.00% <0.00%> (ø)
src/effects/Caption.h 0.00% <0.00%> (ø)
src/Timeline.h 57.57% <0.00%> (-6.07%) ⬇️
tests/Clip_Tests.cpp 100.00% <0.00%> (ø)
src/Qt/VideoCacheThread.h 0.00% <0.00%> (ø)
src/Qt/VideoCacheThread.cpp 0.00% <0.00%> (ø)
tests/FFmpegReader_Tests.cpp 100.00% <0.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5d5d82...a3c20c8. Read the comment docs.

@jonoomph
Copy link
Copy Markdown
Member Author

Merging this now

@jonoomph jonoomph merged commit 09df9e6 into develop Oct 29, 2020
@jonoomph jonoomph deleted the caption-effect branch October 29, 2020 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant