VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 53
  1. I have a very early (what looks like home or studio) recording of a broadcast play which has a counter running at screen bottom. The goal is to put a black mask over that to better see an external subtitle file which would just be added in VLC or Daum for playback. The subtitle was made in one of the newer sources and captured from youtube.

    Alternately is there a good way to insure that playback settings _for the subtitle_ would have black background on white text? VLC and so on seem to conflict with some of those black background or opaque settings on playback. I recall that one of the players could display subs below the video but I want to make all this transparent to any user of the completed video.
    Quote Quote  
  2. AviSynth's Letterbox command.

    Example: Letterbox (Bottom, 50) I think.
    Quote Quote  
  3. Thanks for answering. I have never been able to use expert tools like AVISyth. Tried often years ago.
    Can you give a step by step to load the program and make this short command, save and out?

    Also I think there are numerous versions of these programs so not only load the program but which one and where to get it these days.
    Quote Quote  
  4. I got AVI synth. It looked like there are dependencies like Direct Show so I don't know what errors will come from all of that.
    Quote Quote  
  5. Probably easier for you to use something with a GUI like avidemux. Add the Crop filter, and Add Borders filter
    Quote Quote  
  6. Originally Posted by poisondeathray View Post
    Probably easier for you to use something with a GUI like avidemux. Add the Crop filter, and Add Borders filter
    I said trim b/c I couldn't remember the word crop (since I don't do hardly any of this these days). But crop would change the size of the frame, yes? If I made the crop how might the overlay of subs look?

    The goal here is to keep as much of image as I can and then display some subs added into the AV program at playback.


    I should be able to make a screen shot. The video is very poor quality but very rare from a one time broadcast and never released to the VHS market. It may have been on equipment and tape earlier than that with the counter on it.

    Anyway I have AVIdemux and used it for other edits so thanks for any GUI recommendations. It made me wonder why any of this hasn't been smoothed out since the ten years past of AVIsynth.
    Last edited by loninappleton; 17th Nov 2024 at 22:29.
    Quote Quote  
  7. a rough screen shot using Paint but the counter shows its positioning
    Image Attached Thumbnails Click image for larger version

Name:	sticksandbones.png
Views:	32
Size:	893.3 KB
ID:	83565  

    Quote Quote  
  8. Isn't there some technique to remove watermarks that would just cover the counter? That might be an option.
    Quote Quote  
  9. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    This will crop 200 pixels from the bottom and pad it out with 200 pixels (in black). Change the number to suit your needs.
    Code:
    ffmpeg -i "my video.mkv" -c:v libx264 -profile:v high -level:v 4.0 -preset medium -crf 22 -filter:v crop="in_w:in_h-200:0:0",pad="in_w:in_h+200:0:0" "padded-my video.mkv"
    The video quality will be ok. The file size can be tweaked. Perhaps a filter to remove some of the noise (graining, etc.)
    All this can be done by tweaking the above one line batch file.
    I've nominated an mkv for input and output. You can go with your choice. Just change the extension accordingly. ffmpeg will work it out.
    mkv-->mkv
    mkv-->mp4
    mp4-->mkv
    mp4-->mp4

    Cheers.
    Last edited by pcspeak; 18th Nov 2024 at 02:47. Reason: Clarity
    Quote Quote  
  10. Originally Posted by loninappleton View Post
    Originally Posted by poisondeathray View Post
    Probably easier for you to use something with a GUI like avidemux. Add the Crop filter, and Add Borders filter
    I said trim b/c I couldn't remember the word crop (since I don't do hardly any of this these days). But crop would change the size of the frame, yes? If I made the crop how might the overlay of subs look?

    The goal here is to keep as much of image as I can and then display some subs added into the AV program at playback.
    crop removes pixels and changes the size of the frame. But Add Borders, adds back black pixels. If you remove 40 pixels and add 40 pixels, you have the same number. The problem is you lose all the pixels on the bottom, not just the counter overlay .

    It takes a minute of your time to preview the result and you can decide if it meets your needs



    Originally Posted by loninappleton View Post
    Isn't there some technique to remove watermarks that would just cover the counter? That might be an option.
    Yes there are dozens of "logo" removal techniques, software, plugins. Many of them are discussed in this forum and others. Some better/worse than others. It's something you have to experiment with. There are also inpainting algorithms . None of them will be perfect. Most of them will leave residual blur or some other artifacts - sometimes the result is very ugly and worse than if you did nothing - because that is an "opaque logo" - more difficult to remove than semitransparent ones

    The other option is to overlay a static black rectangle, it's an ugly look, but at least nothing changes like a counter
    Quote Quote  
  11. PC Master FirkeyZeldaX's Avatar
    Join Date
    Nov 2024
    Location
    Saudi Arabia
    Search Comp PM
    Is there any chance that you can do it with AI?
    Quote Quote  
  12. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    For me, the nicest solution would be to blur the area covering the counter and add the subtitles so they overlayed that area. Subtitles in the srt format will make that awkward. I'd probably use subs in the ass format so I had more control of their positioning.
    If you could upload a small clip (10 seconds) for members to do some testing, that would be great. A clip with the actors moving in it helps.
    A simple 1 line batch file to get the clip. Change the start-stop times, and the file name(s) accordingly.
    (Aha. I finally saw at the top of your uploaded image that the video is in an mkv container. I'm slow.)


    clip.cmd
    Code:
    ffmpeg.exe -i "my video.mkv" -ss 00:05:00 -to 00:05:10 -c copy -y "clip.mkv"
    Last edited by pcspeak; 18th Nov 2024 at 12:44. Reason: Light bulb moment....
    Quote Quote  
  13. Originally Posted by pcspeak View Post
    This will crop 200 pixels from the bottom and pad it out with 200 pixels (in black). Change the number to suit your needs.
    Code:
    ffmpeg -i "my video.mkv" -c:v libx264 -profile:v high -level:v 4.0 -preset medium -crf 22 -filter:v crop="in_w:in_h-200:0:0",pad="in_w:in_h+200:0:0" "padded-my video.mkv"
    The video quality will be ok. The file size can be tweaked. Perhaps a filter to remove some of the noise (graining, etc.)
    All this can be done by tweaking the above one line batch file.
    I've nominated an mkv for input and output. You can go with your choice. Just change the extension accordingly. ffmpeg will work it out.
    mkv-->mkv
    mkv-->mp4
    mp4-->mkv
    mp4-->mp4

    Cheers.
    This looks very helpful. I have FFmpeg installed various ways which is done by other programs. What is the method of getting the code string executed? I really have no experience of this.

    If I just go:

    C:/ > Program Files > ffmpeg-7.0full_build > ffmpeg -i "my video.mkv" -c:v libx264 -profile:v high -level:v 4.0 -preset medium -crf 22 -filter:v crop="in_w:in_h-200:0:0",pad="in_w:in_h+200:0:0" "padded-my video.mkv"

    Will it look something like that? I need help with any syntax errors as well. My mangled code says go to the ffmpeg folder on the HD from C: and run the code etc.

    Or is the code executed inside a run of this FFmpeg 7.0full_build ?

    Also where does the work file get saved?
    Quote Quote  
  14. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    @loninappleton. Please see my post just previous to your last one for another thought.

    Originally Posted by loninappleton View Post
    ]If I just go:

    C:/ > Program Files > ffmpeg-7.0full_build > ffmpeg -i "my video.mkv" -c:v libx264 -profile:v high -level:v 4.0 -preset medium -crf 22 -filter:v crop="in_w:in_h-200:0:0",pad="in_w:in_h+200:0:0" "padded-my video.mkv"

    Will it look something like that? I need help with any syntax errors as well. My mangled code says go to the ffmpeg folder on the HD from C: and run the code etc.

    Or is the code executed inside a run of this FFmpeg 7.0full_build ?

    Also where does the work file get saved?
    The output video gets saved in the same folder as the input video.
    No, a full build of ffmpeg is not needed. Any static build will do the job.

    To run: Simply save the following line of code to a text file ending in .cmd (I called it pad.cmd), in with the video, and then run it. Double click on it.
    pad.cmd
    Code:
    "Program Files\ffmpeg-7.0full_build\ffmpeg.exe" -i "my video.mkv" -c:v libx264 -profile:v high -level:v 4.0 -preset medium -crf 22  -filter:v crop="in_w:in_h-200:0:0",pad="in_w:in_h+200:0:0" "padded-my  video.mkv"
    Quote Quote  
  15. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    @loninappleton.
    When we talk of batch files we are referring to simple text files that are saved, ending in the extensions .cmd or .bat, and NOT .txt. Windows recognizes these as scripts to be executed. The same as Windows recognizes a document by the .doc extension, and opens it with your default word processor when you double click on it.
    Quote Quote  
  16. @pcspeak. Yes I'm acquainted with extensions but I don't see a .bat expression in that code. More to refresh me on.

    Today I made the clip of 20 secs and added the sub in MKVToolnix. As you can see it took me a few tries to remember how to use that
    as well.
    Image Attached Files
    Quote Quote  
  17. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    Originally Posted by loninappleton View Post
    @pcspeak. Yes I'm acquainted with extensions but I don't see a .bat expression in that code. More to refresh me on.
    Script file names ending in .bat are acted upon exactly the same as script file names ending in .cmd
    Both clip.cmd & clip.bat, with the same content, will do the same thing. Batch file names used to end in .bat. Microsoft decided that ending the batch file names in .cmd was more instructive. The rest of the planet just found it annoying. Time passes... and now the .bat extension is hardly used in the Windows environment.
    Quote Quote  
  18. Ok. I'll have to approach this slowly so I may not be responding back and forth within the day. Sometimes I need to just step back a bit. I certainly can save the code to text file and change the extension to cmd and place that inside the ffmpeg folder along with the content mkv. I don't know if that's enough.
    Quote Quote  
  19. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    Originally Posted by loninappleton View Post
    @pcspeak.Today I made the clip of 20 secs
    Thanks for that.
    Last edited by pcspeak; 18th Nov 2024 at 14:59.
    Quote Quote  
  20. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    OOPS! forgot to upload video.
    Last edited by pcspeak; 18th Nov 2024 at 16:17.
    Quote Quote  
  21. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    This my first attempt. Mild..ish sharpening and denoising.

    bbox.cmd
    Code:
    ffmpeg -y -i "sb.mkv" -vf atadenoise,unsharp=5:5:2,"drawbox=x=230:y=416:w=190:h=30:color=black:t=fill" "sb-1.mkv"
    Cheers.
    Image Attached Files
    Last edited by pcspeak; 18th Nov 2024 at 16:25.
    Quote Quote  
  22. Much appreciated. I will look it over but I'm sure it's fine. Executing the code is still the issue for me.
    [edit]
    The image is certainly improved. The black box won't work since it's as distracting as the timer. I have to view the whole film again. I just got it so have been skipping around.

    Since the lower border has video artifacts from the tape, a new crop would be the answer: just cut it off up to the timer.
    I'm doubtful about doing that. I may have to just abandon the idea of doing this.

    Another option

    Just to get the sub readable can anyone confirm that (I think it was) Media Player Classic that can
    have a lower border area on playback where the subtitle would go.
    Last edited by loninappleton; 18th Nov 2024 at 16:41.
    Quote Quote  
  23. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    This goes back to my first idea of cropping 200 pixels from the bottom.
    Only 60 pixels need cropping from the clip you uploaded.

    So, the attached clip is from a mix of the one line batch files I've uploaded.

    sticksbones.cmd (the caret (^) at the end of the first line means the command is continued on the next line. makes it easier to read/edit)
    Code:
    ffmpeg -i "sb1.mkv" -map 0:v -map 0:a -map 0:s -c copy -vf unsharp=5:5:1.0:5:5:0.0,atadenoise -c:v libx264 -profile:v high -level:v 4.0 -preset medium -crf 22 ^
        -filter:v crop="in_w:in_h-60:0:0",pad="in_w:in_h+60:0:0" -y "sb1-padded.mkv"
    Image Attached Files
    Quote Quote  
  24. That looks good. How do I execute the command for the whole play? There's a piece of "code" hanging out there not directed at a program and not marked as an exe. I'm not trying to sound thick about it.

    How to gather the mkv, this code and ffmpeg?
    Quote Quote  
  25. this screen shot shows my limited understanding of how to direct the command. The code string is the .txt so if that has to be changed I can do that...
    Image Attached Thumbnails Click image for larger version

Name:	codeforsticksandbones.png
Views:	49
Size:	168.2 KB
ID:	83590  

    Quote Quote  
  26. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Lon, confirm the folder contains ffmpeg.exe.
    Here's an example -in my case i:\bin64 holds the files, so go back up one level so bin64 is visible
    as shown, hold down the left shift key and right click the folder.
    There shouild be an option to open a Powershell window or a Command prompt, choose that and it will
    open a window in the right place so you can issue your command
    Image Attached Thumbnails Click image for larger version

Name:	ln3.png
Views:	37
Size:	9.5 KB
ID:	83592  

    Click image for larger version

Name:	ln2.png
Views:	27
Size:	37.6 KB
ID:	83593  

    Click image for larger version

Name:	ln1.png
Views:	26
Size:	25.7 KB
ID:	83594  

    Quote Quote  
  27. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    Originally Posted by loninappleton View Post
    I'm not trying to sound thick about it.
    I never thought that for a moment.

    Copy the code below.
    Paste it into a text file. Change the names marked in bold to the names of your input and output videos
    Save the text file as 'codeforsticksandbones.cmd' (the name can be anything you want to name it. don't for get to replace the .txt with .cmd)
    Move the newly saved batch file to the same folder as the video. (As you have already done. I'm writing this and also reading the new posts. )
    Double click on your new batch file. It will pause at the end. Whether the result is good or bad.


    Code:
    ffmpeg -i "the video name goes here.mkv" -map 0:v -map 0:a -map 0:s -c copy -vf unsharp=5:5:1.0:5:5:0.0,atadenoise -c:v libx264 -profile:v high -level:v 4.0 -preset medium -crf 22 ^
        -filter:v crop="in_w:in_h-60:0:0",pad="in_w:in_h+60:0:0" -y "output video name goes here.mkv"
    pause
    Cheers.
    Quote Quote  
  28. One last thing:

    Installing all these commands should show some progress someplace like how long it will take. Where is any of that visible?

    Hi davenext, thanks for joining the discussion.
    Quote Quote  
  29. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    You'll see something like this on the bottom line of the black command window.
    frame= 5561 fps=1086 q=-1.0 size= 16384KiB time=00:02:49.00 bitrate= 794.2kbits/s speed= 33x
    frames completed. frame= 5561
    coding speed. fps=1086
    point of time of conversion. time=00:02:49.00 (this one tells you how much is completed)
    coding speed compared to normal playback speed. speed= 33x


    After I've run the same batch file many, many times I've learned the approximate bitrate for the type of file I'm coding.
    bitrate= 794.2kbits/s For a quick one off look on my 55" TV this is fine.
    For good quality HD I want bitrate= 3000kbits/s . Or higher. Though it's a bit wasted with my poor eyesight.
    Quote Quote  
  30. I did rename to cmd. I think there's line errors on it that I don't know how absolutely to correct for. Like which space goes after a hyphyen-- all of that. I don't know any of it.
    Opening the cmd just winks on and out. For convenience I'm using sb1 for the mkv like in the example.

    On Win7 there's probably some way to get to Powershell I don't know. The example davenext has in Win10.

    [edit] I found powershell on Win 7 but don't know the shortcut key

    On the ffmpeg, the ffmpeg application file appears to be in the .bin folder. So I put sb1.mkv in that plus the cmd and .txt

    ----

    Too much tea for me today. I have to get away from it. I just don't have the concentration needed to do all this... find stray commas and whatnot.
    Quote Quote  



Similar Threads

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