VideoHelp Forum




+ Reply to Thread
Results 1 to 14 of 14
  1. 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
    Quote Quote  
  2. Sorry, but this is still a bit too high for me.
    Quote Quote  
  3. 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.
    Quote Quote  
  4. Originally Posted by pandy View Post
    Or at least upload few pictures with examples of video with subs.
    Originally Posted by Ninelpienel View Post
    Pictures: http://a.pomf.se/yxgkik.7z
    Quote Quote  
  5. 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)
    You didn't supply the second video so I used a red video to show where the overlay will be applied. You might need to add another mt_expand() or two to fully cover the black outlines. You should also limit the overlay to the subtitle area by adding another mask for that area. Note that the subs will still be readable if your overlay video doesn't perfectly match levels and colors.

    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.
    Quote Quote  
  6. What should I do if I want to replace the red video with my second video?
    Quote Quote  
  7. Open a second video.

    Code:
    second = ffVideoSource("video2.mkv")
    Quote Quote  
  8. Originally Posted by Ninelpienel View Post
    Originally Posted by pandy View Post
    Or at least upload few pictures with examples of video with subs.
    Originally Posted by Ninelpienel View Post
    Pictures: http://a.pomf.se/yxgkik.7z
    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...).

    Image
    [Attachment 31206 - Click to enlarge]
    Quote Quote  
  9. 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)
    With
    Code:
    .Trim(4958, 9582) ++ Trim(12457, 24582) ++ Trim(27446, 43556)
    only the first trim is applied.

    Originally Posted by pandy View Post
    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.
    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.7z
    Last edited by Ninelpienel; 13th Apr 2015 at 10:02.
    Quote Quote  
  10. Originally Posted by Ninelpienel View Post
    I need to change the level previously, since the other video has normal level. Thereafter, the subtitles are no longer recognized.
    Change the threshold value in mt_binarize().

    Originally Posted by Ninelpienel View Post
    I have the second video repeatedly trim
    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)
    Quote Quote  
  11. 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
    Quote Quote  
  12. Originally Posted by poisondeathray View Post
    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
    That was the wrong colorspace. I have fix this now.
    Quote Quote  
  13. Member
    Join Date
    Dec 2005
    Location
    Canada
    Search Comp PM
    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)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!