+ Reply to Thread
Results 31 to 60 of 113
-
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.
-
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.
-
-
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]%~x1Last edited by JN-; 22nd Jan 2024 at 19:25.
-
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.
-
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.
[Attachment 76381 - Click to enlarge] -
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. -
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"
You can easily arrange it as a batch if needed. -
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.
-
“ 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. -
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 -
Last edited by Sharc; 23rd Jan 2024 at 09:19.
-
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
-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. -
-
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. -
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.
-
-
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.
-
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.
-
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.
-
“ 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.
-
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. -
Last edited by Sharc; 1st Feb 2024 at 02:24.
Similar Threads
-
Converting stretched/widescreen video back to original 4:3?
By kkeut in forum Video ConversionReplies: 12Last Post: 18th Sep 2021, 02:21 -
Converting NTSC->PAL Interlaced DVD Back To NTSC 24FPS???
By SegaSonic91 in forum DVD RippingReplies: 7Last Post: 2nd Oct 2020, 23:55 -
Converting PAL conversion back to NTSC
By Master Tape in forum RestorationReplies: 5Last Post: 6th Aug 2020, 02:16 -
Reboot: would TBC help converting old VHS cam vids w sped-up voices?
By LouGee in forum Video ConversionReplies: 0Last Post: 3rd May 2020, 13:04 -
Converting Blu-Ray YUV to RGB and back to YUV?
By killerteengohan in forum RestorationReplies: 17Last Post: 17th Mar 2020, 20:42