VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. I have a great copy of an old movie, that is encumbered with both English and Chinese subs, hard-coded in the bottom 15% of frame. I also have a fairish copy of the same movie, but without the HC subs. My 'bright' idea was to replace/overlay the bottom 15% of the great version, with the bottom 15% of the fairish version to enhance my visual pleasure. Of course, I've no idea what software I could use to achieve that, and am daunted by the task of manually combining each frame, so I'm turning to you kind souls for suggestions. Anything (free?) out there?
    Quote Quote  
  2. Here's a precise command to accomplish this:

    Code:
    ffmpeg -i "great_version.mp4" -i "fair_version.mp4" -filter_complex \
    "[1:v]crop=iw:ih*0.15:0:ih*0.85[bottom_crop],[0:v][bottom_crop]overlay=0:h*0.85:enable='between(t,0,99999)'" \
    -c:a copy output_clean_video.mp4
    Command Explanation
    - `-i "great_version.mp4"`: First input video (the great version with hardcoded subs)
    - `-i "fair_version.mp4"`: Second input video (the fair version without subs)
    - `-filter_complex`: Allows complex video filtering

    Filtering Breakdown
    - `[1:v]crop=iw:ih*0.15:0:ih*0.85[bottom_crop]`:
    - Crops the bottom 15% of the fair version video
    - `iw` (input width), `ih*0.15` (15% of input height)
    - `0:ih*0.85` starts the crop from 85% of the height

    - `[0:v][bottom_crop]overlay=0:h*0.85:enable='between(t,0,99999)'`:
    - Overlays the cropped bottom section onto the great version
    - `0:h*0.85` positions the overlay at the bottom 15%
    - `enable='between(t,0,99999)'` ensures overlay for entire video duration

    - `-c:a copy`: Copies audio without re-encoding

    Important Note:
    - Ensure both input videos have identical resolution and aspect ratio [DAR].
    Quote Quote  
  3. Good heavens, what an excellent reply. As soon as I can match those preconditions, and align the starting points (and maybe adjust contrast and brightness for good measure) I'll give it a whirl!

    Now, where's that upvote button? Taking your lead: Happy Holidays ... Merry Christmas too! )
    Quote Quote  
  4. It probably won't be as easy as VideoAI's ffmpeg command line. It's rare that two videos will stay in sync over an entire movie. Framing, levels and colors will often be significantly different.
    Quote Quote  
  5. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Replace just subtitles. Can be done with Avisynth.
    Quote Quote  
  6. Originally Posted by jagabo View Post
    It probably won't be as easy as VideoAI's ffmpeg command line. It's rare that two videos will stay in sync over an entire movie. Framing, levels and colors will often be significantly different.
    We'll see if I encounter that obstacle; color probably not an issue on b&w movies.

    In the meantime, VideoAI's post makes an excellent tutorial on things I'd never imagined that ffmpeg could do!

    Originally Posted by VoodooFX View Post
    Replace just surtitles. Can be done with Avisynth.
    Since I've some experience with ffmpeg, and none with AVISynth, perhaps you could help an old feller out with a pertinent code snippet.

    Confession: having tweaked the Contrast and brightness (by adding a filter in HandBrake) and running the result through my new TV's 'AI' processor, my duly impressed septuagenarian eyes might just skip the next steps until after the holidays. Though I did adjust frame size and frame rate, my ventures into trimming usually bolix up the first second or two; something to do with creating a reference frame at the start, I'm guessing!
    Quote Quote  
  7. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by Variously View Post
    Since I've some experience with ffmpeg, and none with AVISynth, perhaps you could help an old feller out with a pertinent code snippet.
    Cut and post snippets of "a" and "b" video.
    Quote Quote  
  8. Originally Posted by Variously View Post
    perhaps you could help an old feller out with a pertinent code snippet.
    In the simplest case:

    Code:
    top = WhateverSource("filename1.ext")
    bot = WhateverSource("filename2.ext")
    
    bot = bot.Crop(0, some_vertical_offset, -0, -0) # remove the top part of the bottom clip
    Overlay(top, bot, y=some_vertical_offset) # Overlay the bot clip over the bottom of the top clip
    The bot clip is likely to need framing and brightness/contrast adjustments before the overlay.

    As was pointed out by VoodooFX it might be possible (depending on the nature of the subs, for example, yellow subs on a black and white movie) to build a mask of the subtitles and automatically overlay only those areas when the subs are present. Some samples would help. I've done this in the past with AviSynth.
    Quote Quote  
  9. I've done this a few times. It is MUCH easier to do using your NLE rather than some sort of hard-coded script. Multiple reasons. First, the two will never align so you will have to enlarge/shrink one of them, and also probably move it around until it matches. Second, it is a lot easier to make a mask for the portions of the lesser-quality video that you want to overlay if you can see it on the screen. Third, you will probably want to only do the overlay at certain points in the video. Finally, you will find that the two versions are cut differently. When I've done this, I found that one of the two copies was actually missing a few scenes.
    Quote Quote  



Similar Threads

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