VideoHelp Forum
+ Reply to Thread
Page 2 of 4
FirstFirst 1 2 3 4 LastLast
Results 31 to 60 of 113
Thread
  1. Originally Posted by JN- View Post
    Am I missing it or has the OP supplied a sample vid clip ? If so it would take a lot of the guesswork out of all of this.

    I'm also struggling with a black bars on all 4 sides of lots of pre recorded movies issue and so my interest in all of this.

    Thanks Sharc for very useful #9 post. I have already done (prepared but waiting for inspiration) most of #12. From a previous post, another thread ? I got tip of simply dragging in sides/top/bottom to establish if the black bars are really part of video or not, not if the image doesn’t change/squeeze. Important to make sure that MPC or VLC have already got Aspect ratio set to default / DAR.

    Both players have an option for displaying full screen, but this doesn’t fix small vid display on TV, has no zoom. I'm pretty sure that I encoded these incorrectly. Don’t mean to derail this threads topic, carry on.
    Post a sample here, so we can take a look at it.
    Quote Quote  
  2. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Thanks, will do. I have several categories of ar types, multiple files of each type. I’ll supply a short sample of several types. My preference is to use ffmpeg utils and I used already Vegas Pro to reencode 2 of the most common ar types, cropping top and bottom black bars. I will post later when I put them together.

    Actually the two that I re-encoded didn't need it as the original played full screen on TV. The two are not same as any of the samples provided.
    Last edited by JN-; 22nd Jan 2024 at 14:02.
    Quote Quote  
  3. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    These all play with black bars on 4 sides on TV so they were originally encoded incorrectly. I may have to re-encode and crop in in say Vegas Pro ?

    Dropbox link to folder "ToDo 2 minute versions" https://www.dropbox.com/sh/xp7con0f7skoawh/AABQKGuLo3PxFKMJQuHY_0TQa?dl=0

    There are nine 2 minute samples. Actually I just realised that there are several with the same resolutions.

    #2,#3 and #4 are the same.
    #5 and #7 are the same.
    #6 and #8 are the same.

    So probably only need to check out #1, #2, #5, #6, #9.

    #1. 1440 x 1080
    #2. 720 x 576
    #5. 576 x 544
    #6. 736 x 560
    #9 640 x 480

    These samples all play with black bars on all sides on TV. I have multiple copies of #2, #5 and #6, only a single copy of #1. and #9. So finding solutions for them would resolve solutions to many.
    Last edited by JN-; 22nd Jan 2024 at 14:04.
    Quote Quote  
  4. Originally Posted by JN- View Post
    These all play with black bars on 4 sides on TV so they were originally encoded incorrectly. I may have to re-encode and crop in in say Vegas Pro ?

    Dropbox link to folder "ToDo 2 minute versions" https://www.dropbox.com/sh/xp7con0f7skoawh/AABQKGuLo3PxFKMJQuHY_0TQa?dl=0

    There are nine 2 minute samples. Actually I just realised that there are several with the same resolutions.

    #2,#3 and #4 are the same.
    #5 and #7 are the same.
    #6 and #8 are the same.

    So probably only need to check out #1, #2, #5, #6, #9.

    #1. 1440 x 1080
    #2. 720 x 576
    #5. 576 x 544
    #6. 736 x 560
    #9 640 x 480

    These samples all play with black bars on all sides on TV. I have multiple copies of #2, #5 and #6, only a single copy of #1. and #9. So finding solutions for them would resolve solutions to many.
    Here you go:
    crop, resize, set DAR

    All values found with clever FFmpeg-GUI.
    Image Attached Files
    Quote Quote  
  5. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Out and about just now. Thank you, will look at later.
    Quote Quote  
  6. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    OK. If I understand it correctly ?

    Existing #4 has AR of 1.25 720 x 576.

    Your info ...
    #4 L 0 T 88 720x400 720x576 16:9


    Is this what needs to be done ? ... Crop to 720 x 400 then resize to 720 x 576 = AR of (1.25) then change AR to 16:9.
    If that is correct can it be incorporated into an ffmpeg syntax in one go ?


    What is L 0 and T 88 ?
    Ok using ffmpeg cropdetect it outputs 720:400:0:88, so that's where the L 0 T 88 comes from.

    I got as far as this, it outputs similar data rate/file size to the input file and looks ok ...

    ffmpeg -i %_INPUT_FILE% -c:v libx264 -preset slow -crf 11 -vf "crop=720:400:0:88,scale=720:576,setdar=16/9" %_INPUT_FILENAME%-[FIX]%~x1

    Or copy the audio ...
    ffmpeg -i %_INPUT_FILE% -c:a copy -c:v libx264 -preset slow -crf 11 -vf "crop=720:400:0:88,scale=720:576,setdar=16/9" %_INPUT_FILENAME%-[FIX]%~x1
    Last edited by JN-; 22nd Jan 2024 at 19:25.
    Quote Quote  
  7. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Thanks ProWo, you got me this far.

    I noticed that using ffmpeg cropdetect the return values are similar but not the same as Clever FFMPEG-GUI. ?

    ------------crop to: resize to: DAR ............. ffmpeg detectcrop output

    #1 L 0 T 136 1440x808 .... 16:9 .............. 1440:800:0:140
    #2 L 10 T 96 696x384 720x576 16:9 ......... 688:384:16:96
    #3 L 12 T 88 696x400 720x576 16:9 ......... 688:400:16:88
    #4 L 0 T 88 720x400 720x576 16:9 ......... 700:400:0:88
    #5 L 10 T 116 560x312 720x576 16:9 ......... 560:304:10:120
    #6 L 0 T 116 736x328 720x306 1:2.35 ......... 736:336:0:112
    #7 L 0 T 112 576x320 720x576 16:9 ......... 576:320:0:112
    #8 L 6 T 116 728x328 720x306 1:2.35 ......... 736:352:0:90
    #9 L 12 T 66 616x352 720x480 16:9 ......... 608:352:16:66

    I used ... ffmpeg -i %_INPUT_FILE% -vf cropdetect,metadata=mode=print -f null -
    Last edited by JN-; 22nd Jan 2024 at 20:15.
    Quote Quote  
  8. The difference between your measurement and my results is that you did one measurement and I did several.

    clever FFmpeg-GUI also uses cropdetect.
    To obtain reliable data, you need to take several measurements at different points in the film, preferably with a light background.
    If the results remain the same after several measurements, you have the right data.
    clever FFmpeg-GUI has the Next crop button for this; each click takes a measurement, then automatically jumps forward 5 seconds and so on.
    In the field at the top left you can specify the start of the measurement in seconds, with preview you can view the result.

    Image
    [Attachment 76381 - Click to enlarge]
    Quote Quote  
  9. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    That's what I was hoping for, a nice screenshot of where to go in the util. I'm a little averse having to wade through a new program to struggle/ learn/find what I'm after.

    I see you are the author, well done and thanks.
    This is the way to go. Meeting up with a buddy of mine today and he has some old divx stuff. This will not only fix my problem but might be needed with his stuff also.

    Not sure how much time I have today for this but between your creation and ffmpeg syntax example I'm pretty much there.
    Quote Quote  
  10. Originally Posted by JN- View Post
    Not sure how much time I have today for this but between your creation and ffmpeg syntax example I'm pretty much there.
    In case you are not intimidated too much by ffmpeg commandlines you may also want to try something like
    Code:
    ffmpeg -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -vf "scale=w=1280:h=-1,crop=1280:720" "%~1_rescaled.mp4"
    It 'normalizes' the source videos to 1280x720 / 16:9.
    You can easily arrange it as a batch if needed.
    Quote Quote  
  11. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    from page 36.

    ffmpeg -i %_INPUT_FILE% -c:a copy -c:v libx264 -preset slow -crf 11 -vf "crop=720:400:0:88,scale=720:576,setdar=16/9" %_INPUT_FILENAME%-[FIX]%~x1

    Is your code an improvement? Yours doesn’t need to specify DAR ? Thanks.
    Quote Quote  
  12. Originally Posted by JN- View Post
    from page 36.

    ffmpeg -i %_INPUT_FILE% -c:a copy -c:v libx264 -preset slow -crf 11 -vf "crop=720:400:0:88,scale=720:576,setdar=16/9" %_INPUT_FILENAME%-[FIX]%~x1

    Is your code an improvement? Yours doesn’t need to specify DAR ? Thanks.
    It's a different approach. It resizes all input videos to the same 'normalized' 1280x720 which is 16:9, it doesn't apply individual 'autocrop', treats all inputs the same. Try it on your examples and you will see what it does. The GUI approach is more file specific/individual.
    Last edited by Sharc; 23rd Jan 2024 at 05:50.
    Quote Quote  
  13. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    You can easily arrange it as a batch if needed.” I plan to as I have many many files to fix.

    I have very little time today, heading off later. I really appreciate your input and ProWo's, thanks. Perhaps some of this can be of use to the OP's initial issue?

    So do you think that without the very specific info re: the area to crop out the black bars that this method will be accurate. I know, test anyway. Late tonight or tomorrow before I can.

    I am so pleased with all of this because whichever way I go I now have the bones of solutions to fix my files.
    Quote Quote  
  14. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    OK. Did a very quick test using the two methods below. The 1st. one plays full screen on TV with no black bars.
    The 2nd. one plays on TV with black bars all around on 4 sides.

    I used the #4 video test clip that is available from dropbox link see post #34.

    1st.
    ffmpeg -y -i %_INPUT_FILE% -c:a copy -c:v libx264 -preset slow -crf 11 -vf "crop=720:400:0:88,scale=720:576,setdar=16/9" %_INPUT_FILENAME%-[JN-FIX]%~x1

    2nd.
    ffmpeg -y -i %_INPUT_FILE% -c:a aac -c:v libx264 -preset slow -crf 11 -vf "scale=w=720:h=-1,crop=720:576" %_INPUT_FILENAME%-[SHARC-FIX]%~x1
    Quote Quote  
  15. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Ok, my bad. When I changed the SHARC syntax as below, it works fine, no black bars.
    ffmpeg -y -i %_INPUT_FILE% -c:a aac -c:v libx264 -preset slow -crf 11 -vf "scale=w=720:h=-1,crop=720:400" %_INPUT_FILENAME%-[SHARC-FIX]%~x1

    The crop info i.e. height 400 is required.
    Quote Quote  
  16. Originally Posted by JN- View Post
    Ok, my bad. When I changed the SHARC syntax as below, it works fine, no black bars.
    ffmpeg -y -i %_INPUT_FILE% -c:a aac -c:v libx264 -preset slow -crf 11 -vf "scale=w=720:h=-1,crop=720:400" %_INPUT_FILENAME%-[SHARC-FIX]%~x1

    The crop info i.e. height 400 is required.
    Note that height becomes 405 only when you scale the width to 720. If you scale as per my script the width is 1280 and the height is 720 (1280/720=16:9). Your prefered final scaling and cropping is up to you of course.
    Last edited by Sharc; 23rd Jan 2024 at 09:19.
    Quote Quote  
  17. Originally Posted by JN- View Post
    You can easily arrange it as a batch if needed.” I plan to as I have many many files to fix.
    Here the batch variant:

    Code:
    :next
    if "%~1"=="" goto done
    
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 18 -vf "scale=w=1280:h=-1,crop=1280:720" "%~1_rescaled.mp4"
    
    shift
    goto next
    :done
    -Save above code as a textfile 'JN_convert.cmd' (or an other *.cmd) on your desktop
    -Select all files which you want to convert in Explorer and drag&drop them alltogether onto the JN_convert.cmd icon on your desktop
    -Lean back.
    Quote Quote  
  18. Alternatively you can skip re-encoding altogether with ffmpeg and just change the Display Aspect Ratio which will convert it to 4x3.

    Code:
    ffmpeg -i "file1.mp4" -aspect 720:540 -c copy "file1_1.mp4"
    Quote Quote  
  19. Originally Posted by MindController View Post
    Alternatively you can skip re-encoding altogether with ffmpeg and just change the Display Aspect Ratio which will convert it to 4x3.

    Code:
    ffmpeg -i "file1.mp4" -aspect 720:540 -c copy "file1_1.mp4"
    It doesn't help, unfortunately. Leaves all borders intact and distorts the picture depending on the source format. Try with his 5 sample files. One has to reencode after removing the borders.
    Quote Quote  
  20. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Anyway. Downloaded Clever ffmpeg gui, very nice util.

    I now have a working system, just a matter of ploughing through the files.

    Its very satisfying looking at the correct full wide screen display compared to the at times postage stamp in the middle D: Many thanks to all for suggestions.

    Most of the stuff is SD quality anyway, soft enough. To keep things simple I usually output to 720 x 576, unless the original was say HD. TV's upscale better than software anyway.

    Am using nvenc to encode, so much faster, i’ll live with any slight quality loss.

    Although the audio could be copied, mostly AC-3, I elected to convert to aac.
    Quote Quote  
  21. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Just curious. I have now completed all files, total of 33 files (less than I originally thought) using the for example 720:400:0:88 method.

    Sharcs method #47 doesn’t require setting/getting those last two coordinates. (0:88). Is it still going to give the same results without them ?

    I tried both methods on a single sample and even loading into nle and playing on tv they both look aok.
    Last edited by JN-; 27th Jan 2024 at 11:38.
    Quote Quote  
  22. Originally Posted by JN- View Post
    Sharcs method #47 doesn’t require setting/getting those last two coordinates. (0:88). Is it still going to give the same results without them ?
    Not needed. Just try and report back if there should be a problem.
    Quote Quote  
  23. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Thank you.
    Quote Quote  
  24. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    Back again. I'm not sure I have been doing this right. Sharcs example ...

    ffmpeg -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -vf "scale=w=1280:h=-1,crop=1280:720" "%~1_rescaled.mp4"

    Q1. Does the order matter ? ie scale before crop or crop before scale.

    What I have been using is something like this ... Scale,Crop,Dar
    Example: with ffmpeg cropdetect return values of ... crop=704:416:8:82. This is an actual video clip piece. #10 sample clip.

    crop=704:416:8:82
    scale=w=720:h=-1 ..... I now set the setdar=1.6923 ie 704 div 416 Q2. is this correct way to get setdar value ?
    setdar=1.6923

    In the syntax above there is no setdar value, Q3. is that ok ?

    Q4. Does scaling need to be used ? Can the video be simply cropped ?

    Thanks in advance, I thought I understood all of this but am not so sure now.
    Last edited by JN-; 28th Jan 2024 at 18:28.
    Quote Quote  
  25. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    I think I got the answer to Q1. When I set crop before scale the size stayed small but cropping 1st. and then scaling got correct larger size.
    Quote Quote  
  26. Use the commandline exactly as provided. Don't wildly tinker with it by adding some possibly conflicting extras you may have seen somewhere.
    The script zooms your source videos to 1280 width and adjust the heigth keeping the original aspect ratio. Then it crops it to 1280x720 (which is 16:9). It worked for all of your 5 sample files which you said were representative for your cases.
    Watch the result on your TV. If this doesn't produce satisfactory results, post a sample and I will take a look.

    Otherwise you may have to process your files individually one by one applying individual "adjustments" to each. Is this what you are after?

    (Sidenote only: All your 5 samples are widescreen movies packed into some narrower frame. So the title of your thread is actually misleading. The correction goes the other way round.)
    Last edited by Sharc; 29th Jan 2024 at 06:54.
    Quote Quote  
  27. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    All your 5 samples are widescreen movies packed into a 4:3 frame. So the title of your thread is actually misleading. The correction goes the other way round.”

    It's not my thread, it’s dayoff's. I hijacked it a little with a similar issue, ie need to remove black bars on all four sides.

    Otherwise you may have to process your files individually one by one applying individual "adjustments" to each. Is this what you are after?”

    I wasn’t expecting to. I originally thought that I would be able to batch convert similar sized clips but an awful lot of them needed individual attention. Not all of them were the same as the samples, a few a bit crazy, really needed one on one adjustment. Some, three in total, I found that I had to delete, the audio simply wasn’t there in the latter half of the clips.

    I found that I did need to adjust the dar a little to get them to look right. So I used Crop,Scale,Dar. However, when I tested all of the suspects I found that the black bars all around issue was only relating to about 33 clips so individual attention wasn’t so onerous.

    I have completed that now and am so delighted that I found a solution for it, thanks to all. I knew it was one of these issues that while I could have a go at it myself I simply needed some expert help.

    I did struggle a bit with understanding of it all but I think I have it now. Thanks for your help.
    Last edited by JN-; 29th Jan 2024 at 06:58.
    Quote Quote  
  28. OK I see. Glad you found your way.
    Quote Quote  
  29. Member
    Join Date
    Jun 2022
    Location
    Dublin
    Search Comp PM
    One odd thing, or maybe it should be so.

    I was testing on some clips today using the same procedure as before that had produced correct results i.e. using crop and dar also using crop, scale and dar. The result was tall and skinny.

    It took a while to track it down. I was mistakenly using source clips that had already had black bars removed.

    When I then sourced the original black bars clips all was well, the output whether scaling or not was as before aok.

    So something to note, make sure that the clips really do have a black bar issue. Odd thing is that cropdetect still outputs values to use which simply doesn’t work under those conditions.
    Quote Quote  
  30. Originally Posted by JN- View Post
    One odd thing, or maybe it should be so.

    I was testing on some clips today using the same procedure as before that had produced correct results i.e. using crop and dar also using crop, scale and dar. The result was tall and skinny.
    It took a while to track it down. I was mistakenly using source clips that had already had black bars removed.
    Out of curiosity: You may want to try my simple script for the same case (your pre-cropped video). Also producing tall and skinny outputs?
    Last edited by Sharc; 1st Feb 2024 at 02:24.
    Quote Quote  



Similar Threads

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