i never tried to remove or cropping black bar. can some one please tell me if i remove black bars, will i lose any video data (not the quality). i could not find any difference in below example. and how crop is done?
black bar removed
https://forum.videohelp.com/images/imgfiles/lwBFo0P.jpg
with black bar
https://forum.videohelp.com/images/imgfiles/1oZMnbk.jpg
*i guess i posted in wrong section. i report the thread already.
+ Reply to Thread
Results 1 to 30 of 33
-
-
If you crop black bars, you have to recode the video and this isn't lossless.
But you can avoid much visible impact encoding with a low crf value, ge 18.
You can try clever Ffmpeg-GUI, it has an automatic crop detection function and encode with x264 (avc) crf 18 to new video. -
hmm,...
- .mkv/.mp4/.mo container have cropping flags, so if ht player supports it one could 'crop' without reencoding.
- when using lossless compression the reencode wouldn't cause loss of active video data.
users currently on my ignore list: deadrats, Stears555, marcorocchini -
You are right, Selur, but:
Most Tv players would not support crop flags,
lossless encoded videos give enormous large files. -
Sure, but without knowing what firekid wants to do it is a possibility that should be considered.
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
@ ProWo
if we crop the black bar will we loss any of video part/portion?
my common sense saying if we crop, there may be some kind zoom also applied to keep the video aspect ratio. isn't? -
No.
Not if you encode it correctly. If the final display aspect ratio doesn't match your monitor/TV the player will add back black bars to compensate.
There is a case where you get more zoom. If you have a letterboxed DVD source and keep the black bars you will see both letterboxing and pillarboxing with a small picture in the middle of the screen. If you crop the black bars you will get a picture that fills the width of the screen, with the appropriate height to maintain the aspect ratio. Most people consider that a benefit though.Last edited by jagabo; 14th Mar 2022 at 07:23.
-
hello, this is a 16:9 video image which has black bar top and bottom. if i delete the black bar will not be the video aspect ratio lower than the original video file may be 16:8.9 or something? and after delete the blackbar if i watch the video in 16:9 ratio monitor will i not see the black bar again?
https://forum.videohelp.com/images/imgfiles/Ym6PYbQ.png -
The frame size will have a different aspect ratio but the picture content won't change. Ie, the frame size (1920x1080) is 16:9 but the video within that frame is really about 16:8 (1920x960).
-
If you crop your video you get a new framesize of 1920x960 (with a display aspect ratio of 2:1).
If you watch it on a 16:9 TV display your will see the black bars again.
You can also crop to a real 16:9 framesize (in your case 1706x960), but you'll loose picture info at both sides -
thank you for taking your time to explain. but sorry i am really noob
1. the image example i gave, video is "1920×1080 (16:9)" and showing black bar top and bottom. so does it mean the black bar is attached with the video. i mean not like by default video player is showing blackbar to fill up the gap right? so the original video shoot has the black bar attached.
2. if i remove the black bar, without black bar video resolution will be change like 1920x960 and aspect ratio 16:8. in that case if i play the video i will again see the black bar top and bottom because video player will auto fill up the gap with black bar right?
if this is the case, why people would like to remove black bars?
@ProWo sorry before i saw your msg, i posted my msg. so basically if i remove the black bar. 16:9 aspect ration display will not find any advantage. but other aspect ratio display may see the advantages right?Last edited by iKron; 18th Mar 2022 at 10:03.
-
-
I haven't seen your actual video, and I don't know exactly how you produced the image, so I can't say for sure. But since the subs appear partly within the black bar (the descender on the letter g) I would guess the source includes the black bars.
If you play in a window, no. If you play full screen, yes.
I already gave one example in post #7. A widescreen movie letterboxed in a 4:3 frame (sometimes seen with DVD rips). You may have a 640x272 image letterboxed in a 640x480 frame.
[Attachment 63875 - Click to enlarge]
I used medium grey instead of black so you can easily differentiate the borders of the original video from the borders added by the player. If you play that in a window you will see the letterbox bars -- exactly as in the above image. If you play it full screen on a 1920x1080 display you will get:
[Attachment 63876 - Click to enlarge]
You have a little picture with letterbox and pillarbox bars. The player doesn't know you don't need to see the bars at the top and bottom. So it enlarges the 640x480 frame to 1440x1080 then adds 240 column pillarbox bars at the left and right.
If you had cropped away the borders before encoding at 640x276 you would get this on a 1920x1080 display with full screen playback:
[Attachment 63877 - Click to enlarge]
Now you only have letterbox bars top and bottom, with a big picture that fill the frame left to right.Last edited by jagabo; 19th Mar 2022 at 10:27.
-
you made pictorial example so that i can understand it better...thank you so much for the explanation....much appreciated!
-
Basically, cropping away black borders gives you the best full screen fit for any monitor/TV aspect ratio.
-
thank you for the suggestion, now i want to remove black border for all video.
handbrak has auto crop feature. is there any ffmpeg command which can auto crop the black bar? i don't like handbrak, because i found their app add unwanted filter automatic. sorry i am not sure if i should open a new thread about. -
@echo off
set ffmpeg64="C:\Progra~1\converti_bat\ffmpegN1025.exe "
set sett=-c:v libx264 -crf 23 -c:a aac -b:a 160k
rem set sett=-c:v libx265 -crf 25 -c:a aac -b:a 160k
%ffmpeg64% -ss 9 -i "%~1" -vframes 10 -vf cropdetect -f null -
%ffmpeg64% -ss 9 -i "%~1" -vframes 10 -vf cropdetect -f null - 2>"%temp%\null.txt"
findstr /ic:Parsed_cropdetect "%temp%\null.txt">"%temp%\nu.txt"
for /f "usebackq tokens=*" %%A in ("%temp%\nu.txt") do (
for /f "tokens=1-2 delims==" %%a in ("%%~A") do (
set "cr=%%b"
))
del "%temp%\nu.txt"
del "%temp%\null.txt"
set cro=-vf crop=%cr%
choice /C "sn" /t 15 /D "n" /M "setting manuale ?"
SET ort=%ERRORLEVEL%
if "%ort%" equ "1" set /p "cr=crop=w:h:y:"
if "%ort%" equ "1" set cro=-vf crop=%cr%
IF "%ort%" EQU "2" echo no
if "%ort%" equ "2" goto fin
:fin
%ffmpeg64% -i "%~1" %cro% -y %sett% "%~n1_.mp4"
exit -
@OP: It will be foolish to remove black bars on top and bottom only, without cropping the sides as well, because the aspect ratio will be screwed. they are put there for a reason, the original content is not 16:9 and the only way to display it correctly in square pixel is to add those black bars on top and bottom.
The only way of getting rid of those black bars is to crop the entire frame all around loosing some active contents on the sides (as shown in yellow in the attached picture) and then resize back to 1920x1080 loosing some picture details in a form of softness or blurriness.
Trust me just leave it alone, Some producers are not that dumb otherwise they could have done that already to the movie like some other producers did with a lot of Blu-ray titles pleasing some crowd and pissing off a lot of videophiles.
[Attachment 64142 - Click to enlarge] -
There's nothing wrong with removing the black bars before encoding. You are assuming the content will always be viewed on a 16:9 display. Other aspect ratios are becoming more common (computer monitors, smartphones, tablets, etc.). Most players are smart enough to add black bars as necessary no matter what the aspect ratio of the display is. The only time you want to keep the black bars is when your using a medium that requires fixed frame sizes -- like DVD and Blu-ray. And the aforementioned subtitle issue.
-
You've been against aspect ratio flags in the past due to device compatibility issues, what makes you change your mind?
-
I'm not against aspect ratio flags -- I use them anytime I encode DVDs. I just warn people that some players will not respect them.
Cropping black borders has nothing to do with aspect ratio flags. -
How do you tell the device to display a cropped video in a weird resolution?
-
You can also use avisynth (tho i think it is a bit overkill) and also video editors that support custom resolution sequences.
When using virtualdub be sure both the top and the bottom are same amount of pixels and that the output resolution is dividable by 2 (or 4) -
Any extra information takes extra space, even if this something simple as black bars (although if there is no noise, and they are indeed completely black, the overhead should be minimal). Broadcast / DVD / BD have a finite number of fixed formats. For example, broadcast HD and BD HD is 16:9 according to their respective specs. So, when something like The Wizard of Oz, which has AR 1.37, is released on BD, it is pillarboxed to complete 16:9 frame.
When you watch a movie on a computer in a window, or when you watch it on a YouTube page in non-fullscreen mode, the video takes as much as it needs. You probably have seen ultra-wide YouTube videos that do not have black bars on top and bottom when you view them in-page; they used to have black bars before, but then YouTube figured it did not need to squeeze all videos into 16:9 or 4:3 frame.
So, cropping black bars for viewing online in-page makes sense. Cropping them for watching on a TV or even online in fullscreen mode - not so much if you watch on a "standard" screen, which for the last 20 years have been 16:9, but this is changing.
What does make sense is so-called anamorphic mode, which is nothing else but a different AR mode. For example, you can letterbox a FullHD movie with DAR 2.2 into a 16:9 frame using black bars on the top and on the bottom, then you would lose about 207 pixels of vertical resolution - what a waste! This is, AFAIK, how BDs are encoded, although I am not 100% sure, maybe someone can correct me on that.
But you can encode the same movie into full 1920x1080 frame with 2376/1920 = 1.2375 = 99/80 ≈ 5/4 PAR. You won't have any benefit of that if you watch the movie on a 16:9 TV set, but if you watch it on a 2.2 TV set, then it will be able to utilize all the pixels, and you'll see better picture. The same approach is used on "anamorphic" DVDs - widescreen image is "squeezed" into 720 horizontal pixels; when you watch on a 4:3 TV set, the player (or the TV) letterboxes it into 4:3 frame, but when you watch it on a widescreen TV, you get the full unsqueezed frame.
SAR × PAR = DAR. If you know two of these, you can correctly display the image. My limited knowledge of DVD and BD formats tells me that there are more limitations to them, but computer-based players and YouTube are much more flexible. -
-
In this case you probably also know that this information can be stored in a file, both in the header as well as in the stream. If the stars align, a player can read the metadata and correctly display the image. If you had something different in mind when you asked, "how do you tell the device to display a cropped video in a weird resolution?" then maybe you could rephrase it.
-
I was responding to Jagabo in a context.
-
Similar Threads
-
Need Help Converting Top-Bottom 3D File to SBS
By crevice9 in forum Video ConversionReplies: 10Last Post: 13th Jan 2022, 11:05 -
How to convert top/bottom 3D MKV to anaglyph 3D video?
By digicube in forum Video ConversionReplies: 2Last Post: 27th Sep 2019, 09:45 -
Add/Remove black borders in the top/bottom of a video without reencoding.
By November in forum EditingReplies: 10Last Post: 11th May 2019, 07:48 -
Side by side SBS or top bottom 3d video and modern codecs efficiency
By Bernix in forum Newbie / General discussionsReplies: 11Last Post: 20th Oct 2018, 05:51 -
How to know if cutting on a top or bottom field?
By SameSelf in forum EditingReplies: 3Last Post: 9th Aug 2017, 16:34