VideoHelp Forum




+ Reply to Thread
Page 4 of 4
FirstFirst ... 2 3 4
Results 91 to 113 of 113
  1. @Alwyn: I didn't say there is a "need". Fact is that on 16:9 1920x1080 standard blu-ray discs the pillarboxes are there for 4:3 movies. And as I wrote one can crop these and reencode. The 16:9 TV or any other a:b display will usually automatically pad to its canvas, whatever it is.
    Actually as I explained in detail some time ago (remember the example with your plane) one can crop however one wants and just encode with the correct sampling aspect ration SAR (aka PAR, pixel aspect ratio) and let the player do the rest. Just use the correct (original) SAR for encoding and put it into a container which supports SAR signalling and picture orientation signalling (like .mp4 for example) and watch the movie undistorted on TV, mobile phones, notepads .....
    A simple ffmpeg commandline will do. For 4:3 in 16:9 blurays sources try
    Code:
    ffmpeg -i "%~1" -c:a copy -c:s copy -c:v libx264 -preset slow -crf 20 -pix_fmt yuv420p -vf "crop=1440:1080, setsar=1/1" "%~1_cropped.mp4"
    Or one may feel more comfortable using a GUI.
    Last edited by Sharc; 10th Feb 2024 at 09:01.
    Quote Quote  
  2. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    I cannot understand why go to all this trouble. The only benefit is losing the whatever data that the black bars padding used, if any, to make it 16:9. The disadvantage of re-encoding is a small and unnecessary quality loss.
    Quote Quote  
  3. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Just putting this out there in case there is a ready known solution that im not aware of.

    Hypothecial scenario. Lots and lots of video clips that some may have black bars on all four sides. Solutions for cropping and fixing are already posted above, Sharcs etc.

    Question. Is there any known system of evaluating beforehand a large bunch of files to isolate only the ones that need cropping, without manually playing each one one by one to see if it’s required?
    Quote Quote  
  4. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    What you're after is some program that will let you see the files in Thumbnail showing the bars. I experimented with the Windows icons but it doesn't show the bars.

    It's not feasible for hundreds of files but for a couple of dozen, you can set VLC Player to open into a window that exactly fits the edges of the video, so you will instantly see whether there are any bars. Tools>Preferences>Interface:

    Image
    [Attachment 76991 - Click to enlarge]
    Quote Quote  
  5. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Thanks Alwyn. I never even thought of that ... "What you're after is some program that will let you see the files in Thumbnail showing the bars."

    I was thinking on the lines of some form of calculated method, reading video files inputs, metadata etc. I have progressed along those lines but for sure it's hit or miss. There may be no method that way, the visual inspection as you suggest is a different way of looking at it|
    Quote Quote  
  6. This outputs a *.jpg thumbnail (of 1 minute into the video) for every file (multiple selection), drag and drop onto the commandline, so you can see which ones have borders.

    Code:
    @ECHO OFF
    :next
    if "%~1"=="" goto done
    
    ffmpeg -hide_banner -ss 00:01:00.000 -y -i "%~1" -vf thumbnail,scale=-1:240 -frames:v 1 "%~1_.png"
    
    shift
    goto next
    :done
    Last edited by Sharc; 13th Feb 2024 at 03:44. Reason: typo
    Quote Quote  
  7. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Thanks Sharcs. I tried that and it doesn't show as expected with files that have borders all around. I use Directory Opus. So I switched to viewing large thumbnails also in Windows file Explorer (Win 10) and still doesn't show. The system must be auto adjusting display to widescreen even with the pngs/jpgs, tried both.
    Quote Quote  
  8. Example where it doesn't work?
    Quote Quote  
  9. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    I have put together, nearly finished, a simple drag n drop bat 2 exe util to auto crop and detect/evaluate in advance, aimed at very large data set of clips. Based upon previous discussions in this thread.

    Obviously if there is a solution out there, and so my query, no point in re-inventing the wheel, in which case I will obviously abandon same. I based it on a more fuzzy method of using the ffmpeg's detectcrop X and Y items. So far tweaked on my own dataset it over catches by about 20%. But of course that begs the question, unknown unknowns. It's always possible that on a very large dataset while returning a hit rate of nearly 100% of ones that I KNOW of (but 20% extras that are not BB on all sides), how many are out there that simply were not detected.

    And so my query for an improvement here. Anyway please continue.
    Last edited by JN-; 13th Feb 2024 at 05:05.
    Quote Quote  
  10. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Originally Posted by Sharc View Post
    Example where it doesn't work?
    The original 2 minute samples, I set it to 1 minute in ...

    @echo off
    mode CON:cols=200 lines=50
    SETLOCAL EnableDelayedExpansion

    :next
    if "%~1"=="" goto done

    ffmpeg -hide_banner -ss 00:01:00.000 -y -i "%~1" -vf thumbnail,scale=-1:240 -frames:v 1 "%~1_.jpg"

    shift
    goto next
    :done
    Quote Quote  
  11. The thumbnails are an exact smaller replica of the files, including the borders, as they are stored on your PC, so you can see the full frame including borders on all sides for deciding on which to take action. It doesn't crop anything. Maybe I don't understand what you actually want.

    Anyway, it seems that you have found your solution, or maybe you gave the answer in post#92
    Originally Posted by JN
    I cannot understand why go to all this trouble. The only benefit is losing the whatever data that the black bars padding used, if any, to make it 16:9. The disadvantage of re-encoding is a small and unnecessary quality loss.
    Quote Quote  
  12. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Post #92 was simply my lack of understanding why anyone would bother to go to the trouble of removing side borders on a 16:9 displayed 4:3 clip when after doing all of that it would still display with virtual borders anyway, nothing to do with what my main question is.

    I simply don’t see the borders in the jpegs, they display on my laptop as if no black borders were in the source clips. A great idea, have you tested?
    Quote Quote  
  13. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    What I actually want is to be able to query a hypothetical data set thats too large to do/play one by one.

    To do this in some automated way and return a list of candidates that are very likely to have black bars on all four sides. Then this subset of returned items can be played one by one to see which if any are real baddies.

    I have more or less achieved this but I suspect that as usual I may be reinventing the wheel (no harm sometimes) again.

    And so my query is to see if it’s already done by some util, if not i’ll carry on.
    Quote Quote  
  14. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    This query re: black bars on all four sides when played on a TV does come up occasionally so it would be useful to have some sort of fix.

    Obviously I had a need for this myself, and so my interest, but other users may also benefit.
    Last edited by JN-; 13th Feb 2024 at 06:40.
    Quote Quote  
  15. Originally Posted by JN- View Post
    I simply don’t see the borders in the jpegs, they display on my laptop as if no black borders were in the source clips. A great idea, have you tested?
    ?
    Here 2 thumbnails. No borders visible on your laptop?
    Image Attached Images    
    Quote Quote  
  16. Few more, all borders visible. Am I missing something?
    Image Attached Images          
    Last edited by Sharc; 13th Feb 2024 at 06:13.
    Quote Quote  
  17. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Ok. This is a screenshot.
    Image
    [Attachment 77003 - Click to enlarge]
    Quote Quote  
  18. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    No borders on ALL 4 sides.

    On a laptop the video will always default to play as per clips actual screen resolution, so no BB's on 4 sides. Making the clip bigger on a laptop will create BB's on all 4 sides on ANY clip, whether it has the issue on a TV or not. There are various settings in VLC etc to mitigate it but it's playback on tv thats the issue

    Playback on TV shows up the issue and cropping out, fixes playback on TV, so no more postage stamp in the middle.

    I suspect that the reason is similar why these jpegs are not displaying 4 BB's is similar to the reason that on initial playback on laptop the video clips don't display 4 BB's either, only 2.
    Last edited by JN-; 13th Feb 2024 at 06:52.
    Quote Quote  
  19. Small borders left an right as well on some of your clips btw.
    But nothing unusual or unexpected. The player or TV will play as you tell it to do: It takes the source including the stored borders and play as square pixels (like the thumbnails or your screenshots), or stretch to a forced DAR like 4:3 or 16:9, or if available resize it according to the SAR flag (Sampling Aspect Ratio = Pixel Aspect Ratio) of the stream or of the container, and eventually pad to fill the screen size (TV). Nothing unusual at all (except some of your sources w x h dimensions, some with square pixels, some not).
    (AvsPmod has a nice Resize Calculator btw.)
    It's the 16:9 padding side pillars of original 4:3 sources which gives the postage stamps when playing it as 4:3 (adding top and bottom borders to keep the movie aspect ratio intact), hence producing fat borders on all 4 sides at playback, unless you crop.
    For 16:9 or general "widescreen" movies recorded in a 4:3 window see also the hint here (alternative to cropdetect):
    https://trac.ffmpeg.org/wiki/CroppingVideo.
    Anyway, good luck and progress with your automated batch process.
    Last edited by Sharc; 13th Feb 2024 at 10:54.
    Quote Quote  
  20. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Thanks. The TV plays those selected clips with black borders all around, so it's a genuine issue, no TV adjustment is possible to fix. They are a small minority so worth my time and effort to fix

    Thanks for the encouragement and all of your other contributions.

    I will post a zip in a day or so when I have it close to finished.

    Might be of use to someone else with same problem.
    Quote Quote  
  21. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Dropbox link to "Black Bars Removal" util.
    https://www.dropbox.com/scl/fo/yrqlnozrjt6xtgj88jjm9/AOu--GUXZgPcy0LAvzcs778?rlkey=gzc...jt2w9g9f3&dl=0

    Removes black bars on all 4 sides, ( Letterboxing issue ), also can be used to evaluate likely candidates that may have this issue.

    Quality is default at 23, probably increase quality by lowering to around 18 setting.

    If using Win 11 do the following to display correctly, it defaults to Powershell, so change. Also use a recent version of ffmpeg.
    Windows 10 may also use "Terminal" if it was added/installed.
    Windows 11. To display the utils correctly under Windows 11 it's essential to do the following.
    "Terminals" default profile is Powershell which won't display the utils correctly ...

    In terminal select the dropdown items, this icon is similar to a V.

    Chose "Settings".

    #1. Set "Default profile" to Command Prompt. Not Powershell. ... Press Ctrl + Shift + 2 while the Terminal window is in focus.
    #2. Set "Default terminal application" to Windows Console Host. Not Windows Terminal.
    A useful tutorial ... https://www.digitalcitizen.life/switch-cmd-powershell-terminal/
    Last edited by JN-; 30th Oct 2024 at 05:13.
    Quote Quote  
  22. I have a 14 year old Sony HDTV that does that very well.
    PAL/NTSC problem solver.
    USED TO BE A UK Equipment owner., NOW FINISHED WITH VHS CONVERSIONS-THANKS
    Quote Quote  
  23. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Bug fixes ...

    ver. 1.0.1.5

    Added "Black Bars Removal Simple" util to compliment "Black Bars Removal" util. Is ver. 1.0.0.2

    Dropbox link to "Black Bars Removal" util.
    https://www.dropbox.com/scl/fo/yrqlnozrjt6xtgj88jjm9/AOu--GUXZgPcy0LAvzcs778?rlkey=gzc...jt2w9g9f3&dl=0
    Last edited by JN-; 30th Oct 2024 at 05:13.
    Quote Quote  



Similar Threads

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