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.
+ Reply to Thread
Results 1 to 30 of 53
-
-
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. -
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.
-
Isn't there some technique to remove watermarks that would just cover the counter? That might be an option.
-
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"
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
-
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
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 -
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.cmdCode: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....
-
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? -
@loninappleton. Please see my post just previous to your last one for another thought.
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.cmdCode:"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"
-
@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. -
@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. -
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. -
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.
-
-
OOPS! forgot to upload video.
Last edited by pcspeak; 18th Nov 2024 at 16:17.
-
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"
Last edited by pcspeak; 18th Nov 2024 at 16:25.
-
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.
-
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"
-
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? -
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...
-
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 -
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
-
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. -
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
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. -
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.
Similar Threads
-
How can I detect black frames and add keyframes at the detected black frame
By doughnuts in forum Video ConversionReplies: 4Last Post: 29th Aug 2024, 10:43 -
add black bars to video without loss quality
By glomizero in forum Newbie / General discussionsReplies: 8Last Post: 29th Sep 2022, 07:04 -
Need to add 5 seconds of black at the beginning of the video
By aristofeles in forum Video ConversionReplies: 2Last Post: 18th Mar 2022, 01:12 -
FFMpeg Black bar Crop Command
By Daringbaaz in forum Newbie / General discussionsReplies: 3Last Post: 5th Dec 2020, 11:48 -
How to add media info to status bar in Windows 10??
By euphonic in forum Newbie / General discussionsReplies: 0Last Post: 13th Jan 2020, 12:37