Which is where my overcomplicated horror comes into the picture. It isn't finished because I only had one short sample to work with and had no feedback. I really need to write a 'paint fill' AVISynth function to overcome some of it's shortfalls, then I need to add frame comparison to rule out anything that moves, but as long as you've got the right settings for the font the text is rendered in it should be pretty much set and forget.Yes, the wider the range of colors the more likely you are to find those colors elsewhere in the picture. You can always check the mask (eg, return(mask)) to verify just the text is being changed. Of course, you'd have to look through the entire video.
Really I should turn it into a dll to hide all the crap it's doing to fix such a seemingly simple problem. But for now I should probably Overlay the wmask over the final mask to stop the dead black from being tinted by the new chroma... and allow settings for modifying the MaskHS values...
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 31 to 50 of 50
Thread
-
Last edited by ndjamena; 11th Oct 2014 at 11:30.
-
No need to create a new thread, this one is precisely what I am looking for.
I'm looking for a script capable to change the color of a harcoded subtitle. Here is a sample: https://framadrop.org/r/znJhfsO4lW#RLppqRZQ6Fk75G1JaNFT4WguyQN+syTNXzdQlpmmqi8=
I tweaked a bit but I can't properly change the grey subtitles into white. And there is lot of artefact created on the picture and/or around the outline sub.
My script:
Code:mask=MaskHS(30,30, 20,5).mt_expand().BilinearResize(last.width, last.height) overlay(last, GreyScale().ColorYUV(cont_y=100), 0, 0, mask)
-
You seriously want to turn GREY into WHITE?
DAMN!
And you thought you could take the easy way out too... -
-
The point is there are too many overlapping "shades" similar to "grey" . You will get contamination of the mask, it's very difficult to generate a clean mask based on a neutral tone like grey
Maybe you can try several methods to combine masks to improve the results, perhaps a luma mask limited by a motion mask . Eitherway it's not going to give perfect results -
This is a constructive reply for someone (me) who doesn't know not much.
Now I understand why it's hard. The thing is I know that the program Avisubdetector is able to "whitening" the sub without affecting the frame itself.
I wonder how the program applies its setting to do that...
thx -
-
Don't really use this program. Maybe I should but would be more convenient to use a script instead.
-
Here's an example that combines a mask for greys and a mask for blacks then masks off only the subtitle area near the bottom of the video:
Code:function PackRGB(int r, int g, int b) { return(r*256*256 + g*256 + b) } LWLibavVideoSource("greysubs.mkv") src=last greymask = ResetMask(ConvertToRGB(src)).ColorKeyMask(PackRGB(203,203,203), 15, 15, 15).ShowAlpha().ConvertToYV12(matrix="PC.601").mt_inpand().mt_inpand() blackmask = ResetMask(ConvertToRGB(src)).ColorKeyMask(PackRGB(15,15,15), 15, 15, 15).ShowAlpha().ConvertToYV12(matrix="PC.601").mt_inpand.mt_inpand() submask = Overlay(greymask, blackmask, mode="add").Invert().Crop(350,540,-350,-48).AddBorders(350,540,350,48).ColorYUV(cont_y=40).Blur(1.0) overlay(last, GreyScale().ColorYUV(cont_y=200), 0, 0, mask=submask) Interleave(src, last, submask.ConvertToYV12().GreyScale())
-
-
I interleaved the original video, the updated video, and the mask -- so you can open the video in an editor, step through frame by frame, and see exactly what's going on. Remove the last line to get just the updated video.
Last edited by jagabo; 2nd Jan 2017 at 08:44.
-
-
Someone has an idea because it is now shown in black and white with avisynth+.
[Attachment 43857 - Click to enlarge]
This script it showed correctly with my previous avisynth.
Thanks in advance. -
Yes, the image post #11 was made from that video and that script. Just ran it again and verified it works.
-
It's a regression. Will be fixed in next AviSynth+ release.
https://github.com/pinterf/AviSynthPlus/commit/3c9ff6c89663d3d679c63aa9815c20c3dce74e0f -
Like this?
Code:ffVideoSource("cut.mkv") mask=MaskHS(160,180, 100,80).mt_expand().BilinearResize(last.width, last.height) inv=Invert(mask) #workaround for broken AVS+ r2173 to r2544 overlay(last, GreyScale().ColorYUV(cont_y=50), 0, 0, inv)
-
@ sneaker
Apparently it works.
but the subtitle appears with some blocks of yellow.
[Attachment 43860 - Click to enlarge]
Modifying the script with 'mt_inpand' the sub show much better,...is this correct?
ffVideoSource("cut.mkv")
mask=MaskHS(160,180, 100,80).mt_inpand().BilinearResize(last.width, last.height)
inv=Invert(mask) #workaround for broken AVS+ r2173 to r2544
overlay(last, GreyScale().ColorYUV(cont_y=50), 0, 0, inv)
[Attachment 43861 - Click to enlarge]
I had changed to avisynth+ and wanted to start all my samples script.
Now I'm satisfied.
Thanks sneaker, jagabo.Last edited by sekininsha; 29th Nov 2017 at 23:16.