Hey, I have 2 almost identical videos. The first video has a great quality, but there are subtitles burned in. The second video has not so good quality, but no subtitles. I have trim the second video exactly like the firtst video. Now I want to overlay the second video where in the first video are subtitles.
Here is an example from the first video: https://mega.co.nz/#!QMQS0JTb!fGXNL3swyRv65K4YzdNRyk1K8tWT9XYZfpF7tb5GQac
Greeting
+ Reply to Thread
Results 1 to 14 of 14
-
-
-
-
Follow links, search for examples, understand them, modify and use.
Or at least upload few pictures with examples of video with subs.
You can generate few pictures with mosaic with ffmpeg and bellow example.
Enter sensitivity coefficient (i would propose something around 0.5 - 0.25 - lower value increase sensitivity and produce more pictures).
Probably few pictures will be created, select one most representative in your opinion to show subtitles.
Code:@set /p sens=Enter Scene Detection Sensitivity (0..1 e.g 0.25): @ffmpeg -threads %NUMBER_OF_PROCESSORS%*1.5 -i %1 -vf "select='gt(scene\,%sens%)',tile=4x5" -vsync 0 %1_%%03d.png
Last edited by pandy; 13th Apr 2015 at 05:58.
-
Pictures: http://a.pomf.se/yxgkik.7z
-
Code:
ffVideoSource("test.mkv") # good source video with subs second = BlankClip(last, color=$ff0000) # second video sub_mask = mt_binarize(threshold=253).mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().Blur(1.0).Blur(1.0) Overlay(last, second, mask=sub_mask) ColorYUV(gain_y=-25, off_y=13)
Note that your video has levels outside the standard 16-235 range. The ColorYUV() filter was used to fix the levels.Last edited by jagabo; 13th Apr 2015 at 07:08.
-
What should I do if I want to replace the red video with my second video?
-
My point was to not load movie (even sample) but few pictures.
Those pictures are from movie with subtitles or video? (assuming that You trying to overlay subs from one video to another).
Please provide same scenes but from second video too.
Side info - i've try to extract subs from sample pictures but it is not perfect - as pointed by jagabo not only subs have same color and result may be not as expected also subs edges can be not nice (can be improved but...).
[Attachment 31206 - Click to enlarge] -
Two problems:
I need to change the level previously, since the other video has normal level. Thereafter, the subtitles are no longer recognized.
I have the second video repeatedly trim, how do I put it to you?
Code:ffVideoSource("H:\dot-heaven\Projekte\Death Parade\Folge 08\01. wraw\[HorribleSubs] Death Parade - 08 [1080p].mkv").Trim(154, 33378).Levels(0, 1, 255, 16, 235) second = DGDecode_MPEG2Source("H:\Encoding\death_parade08v2_ntv.d2v", cpu=0).AnimeIVTC(mode=1,precision=3).Spline16Resize(1920, 1080).Trim(4958, 9582) ++ Trim(12457, 24582) ++ Trim(27446, 43556) sub_mask = mt_binarize(threshold=253).mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().Blur(1.0).Blur(1.0) Overlay(last, second, mask=sub_mask)
Code:.Trim(4958, 9582) ++ Trim(12457, 24582) ++ Trim(27446, 43556)
This was the first video, with subtitles: http://a.pomf.se/yxgkik.7z
This is the second video, without subtitles: http://a.pomf.se/mnwoqr.7zLast edited by Ninelpienel; 13th Apr 2015 at 10:02.
-
Change the threshold value in mt_binarize().
Code:second = DGDecode_MPEG2Source("H:\Encoding\death_parade08v2_ntv.d2v", cpu=0).AnimeIVTC(mode=1,precision=3).Spline16Resize(1920, 1080) second = second.Trim(4958, 9582) ++ second.Trim(12457, 24582) ++ second.Trim(27446, 43556)
-
The one without subs actually looks better overall to me in the screenshots that you've provided. All the shadow detail has been obliterated and clipped in the one with subs - unless that was your improper screenshot taking method ? That is one reason you should provide native video samples
-
-
I remember a reading about something similar where two broadcast recordings were combined to eliminate one of those logos that TV stations insist on putting on screen.
Cutting off the bottom of one and the top of the other then stacking.
a=avisource("aa.avi").crop(0,0,0,-62) #62 off bottom, leave top.
b=avisource("bb.avi").crop(0,258,0,0) #258 off top, leave bottom.
stackvertical(a,b)
Similar Threads
-
avisynth - How to write avisynth script for rgba overlay
By moelover in forum EditingReplies: 3Last Post: 13th Apr 2014, 12:24 -
Avisynth Overlay Question
By jelythefish in forum EditingReplies: 13Last Post: 8th Apr 2013, 18:56 -
AVISynth Overlay Image Help
By smike in forum EditingReplies: 11Last Post: 17th Sep 2012, 11:04 -
AviSynth Overlay and Trim Help
By NMeade in forum Newbie / General discussionsReplies: 20Last Post: 1st Apr 2012, 07:53 -
AviSynth Audio Overlay
By legocrazy1 in forum EditingReplies: 7Last Post: 14th Jul 2010, 10:01