Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
19th September 2017, 07:21 | #1 | Link |
Registered User
Join Date: Jul 2016
Posts: 14
|
Burn srt to transparent video
This question has been asked before on this board, but never fully answered.
Before someone says that you can hardcode subtitles directly to a movie, yes - I know that. There are use cases for what I'm trying to accomplish, but it seems difficult. If one of you could help out, that would be awesome. What I'm trying to do is to use a SRT/ASS file and avisynth+ to create a transparent video file, with just the subtitles burnt in. The movie should have the same length as the last timecode in the srt/ass file, and a alpha channel should be set for the background. Export it using lagarith or any other losless codec, so it would be easy to drop into a NLE (Premieren, Vegas, etc). Is this possible with Avisynth? Last edited by Taapo; 19th September 2017 at 07:22. Reason: sentence |
19th September 2017, 10:40 | #3 | Link |
Registered User
Join Date: Jul 2016
Posts: 14
|
As I can see, MaskSub needs a video to determine the length of the subtitles, correct? Is there a way to just render out the subtitles without having a resource? Can it take the length from the srt file itself?
Code:
MaskSub("subtitles.ext",video.width,video.height,video.framerate,video.framecount) |
19th September 2017, 11:08 | #4 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
You're gonna need details of source vid anyways, so whats the prob. ?
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
19th September 2017, 15:47 | #6 | Link |
brontosaurusrex
Join Date: Oct 2001
Posts: 2,392
|
Ffmpeg white on black script
https://github.com/brontosaurusrex/s.../bin/srt2video
__________________
certain other member |
19th September 2017, 15:57 | #7 | Link | |
Registered User
Join Date: Jul 2016
Posts: 14
|
Quote:
|
|
19th September 2017, 18:14 | #9 | Link |
Registered User
Join Date: Jul 2016
Posts: 14
|
Well, just when I'm getting myself in a corner again.
Everything works, but I want to use ASS formatting (border around font, and shadow) - I need an alpha channel of course. With normal white text, it would be easy, but with more advanced formatting the screen overlay wouldn't work - or am I wrong? Currently I'm trying to do this - which works for the most part, but it leaves red traces around the font. Code:
ffmpeg.exe -y -f lavfi -i color=s=1920x1080:color=0xff0000 -an -vf "ass=test.ass,colorkey=0xff0000:0.5:0.5,format=yuva420p" -c:v png -t "00:01:40.544" -threads 0 "video.mov" -stats |
19th September 2017, 18:19 | #10 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
Keying out a color will give you poor results. You're going to get overlap and ratty edges
Black/white and using white as a luma mask will only work... if you have white text. No fancy ASS subs. Otherwise you need 2 videos, 1 for the separate alpha (black/white text is the alpha channel) Sorry, but the only way you're going to get perfect clean results is with masksub |
19th September 2017, 18:34 | #11 | Link |
Registered User
Join Date: Jul 2016
Posts: 14
|
In that case, where can I find a compatible XySubFilter.dll file for use in avisynth+?
The ones at https://code.google.com/archive/p/xy-vsfilter/downloads doesn't seem to work at all ... |
19th September 2017, 18:39 | #12 | Link |
Registered User
Join Date: Jul 2016
Posts: 14
|
Sorry, too fast. I found the working version: https://forum.doom9.org/showthread.php?t=168282
|
19th September 2017, 18:43 | #13 | Link |
Registered User
Join Date: Jul 2016
Posts: 14
|
So I managed to get things working in Avisynth with the following lines:
Code:
LoadPlugin("VSFilter.dll") MaskSub("test.ass",1920,1080,25,3000) FlipVertical() What would be the best way to get a workable file for Premiere Pro? |
20th September 2017, 08:08 | #15 | Link |
Registered User
Join Date: Jul 2016
Posts: 14
|
I have gotten this to work perfectly with avisynth.
But I'm still wondering why it would be difficult to get it working using ffmpeg alone? Is there a way to set a background completely transparent in ffmpeg, and have the subtitle visible only? Transparency is no problem by using these settings: Code:
-c:v png |
20th September 2017, 11:26 | #16 | Link |
Registered User
Join Date: Jul 2016
Posts: 14
|
So I tried something new: using a transparent png as input, and overlay the subtitles on it.
Code:
ffmpeg.exe -y -loop 1 -i transparent-1920x1080.png -vf "ass=test-normal.ass,format=rgba" -c:v png -t "00:00:10.000" -threads 4 "video-transparent.mov" -stats Any ideas? |
20th September 2017, 12:19 | #17 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Code:
ffmpeg -f lavfi -i "color=color=white@0.0:size=1920x1080,format=rgba,subtitles=test.ass:alpha=1" -t 10 out%d.png |
Thread Tools | Search this Thread |
Display Modes | |
|
|