Hi All,
I have a bunch of video clips that were originally shot in 4:3, and somewhere along the way, someone got them stretched out to fill a 16:9 screen. I get the idea, but it drives me batty looking at everything stretched out after about 5 seconds.![]()
Is there any programs or filters that would allow me to take my video file and properly get it back to 4:3? I don't care about black bars on the left and right side...I just don't want everyone looking like Smurfs.
Every so often, I also run across the opposite... a 16:9 file that got squished down to fit a 4:3 screen, so the video makes everyone look like they narrow superheros... stretching that back to 4:3 in those cases would be great as well.
I'm not worried if there's some manual work involved..but everything I've run across so far just crops and stretches out, it doesn't squish it back into the right aspect ratio.
Thanks!
Pete
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 30 of 113
Thread
-
-
What is the resolution of the file and are there any blacks bars existing now ?
-
Hi Pete!
Itʻs a good idea to see whether the file(s) you have are actually of a particular Aspect Ratio (AR) or whether they are just flagged that way in the metadata/tags. Here, we often use MediaInfo to assist in determining what is being reported.
Note: the universal formula for showing & resizing using ARs is this
Code:DAR = Horizontal Resolution / Vertical Resolution * PAR
SAR is sometimes conflated with "Storage AR", except - as I have tried to explain often here - there is no such thing as Storage AR. That is just shorthand for Horiz.Rez / Vert. Rez.
(for exact resizing, you do NOT want to use any shorthand)
So,
If the file has no DAR or PAR flagging, that likely means the file is using square pixels (aka 1:1 PAR). This is common with internet rip & recodes, as well as with Youtube sources. When this happens the math is simpler: DAR = H Rez/V Rez.
If the resolutions show the DAR as 16:9 when they should be 4:3 (or vice-versa), it has been improperly resized. It can be revised in its metadata/tags/flags to show properly IF the player will support & honor such metadata. If you cannot be assured that it will support/honor it, you will either need to keep manually adjusting the AR/Zoom in your player, or you will HAVE to re-encode to the correct AR.
If the resolutions show the active picture at the appropriate AR but built-in letterboxing/pillarboxing (black bars) are padding it and making it display incorrectly, it will also need to be re-encoded (along with being properly cropped).
In something like ffmpeg, you can script it to scale to the proper resolutions using the "-vf scale=width:height" switch. Similarly, you can adjust the AR flag with the "-aspect 16:9", "-aspect 4:3," switches (using standard DARs here). Note that the scaling works on the output while the aspect switch interprets the input (depending on the codec, some will allow you to state the AR of the output as well).
To make things much easier, it probably makes sense to start by using a GUI for something like this (using, for example clever ffmpeg-GUI) until you get the hang of it, then you can use the code as a template with which to process many similar-issued files in batch (using command-line "for..." statements).
Scott
<edit>And it looks like clever ffmpeg-GUI now has some batch features of its own...Last edited by Cornucopia; 18th Jan 2024 at 20:09.
-
@dayoff: Is your file mpeg2 or mpeg4? Which container (.avi, .vob, .mkv, .mp4, .m2ts .....)?
Maybe you can collect some ideas from here for patching:
https://forum.videohelp.com/threads/316259-Can-I-change-the-pixel-aspect-ratio-in-an-x...out-reencoding
https://forum.doom9.org/showthread.php?t=152419
Or upload a sample for getting more specific advice.Last edited by Sharc; 18th Jan 2024 at 16:46.
-
For H264 files, CleverFFMPeg-GUI will change the flags without recoding. The new file displays correctly in VLC Player, my NLE and my TV.
Set up CleverFFMpeg-GUI as per instructions
Select Source
Main
Various
Change DAR
Set "Container and Stream" to 1.33
Change DAR
"Done!"
Thanks @Prowo.
I don't know if Clever will do batching.
I tried it in AVIDemux, "forcing" 4:3; it worked in VLC Player and my NLE but not on my TV; the file stayed at 16:9 on that. -
-
Let's wait and see.
Depending on the source, codec and container, simple patching (i.e. without re-encoding) may or may not work.
FWIW here 2 ffmpeg commandlines which should work in very most cases. It involves re-encoding though.
Adjust the crf, DAR (4/3 or 16/9) and container as needed.
Can easily be arranged for batch processing if needed.
Added: One can also specify the SAR (Sampling Aspect Ratio) if preferred, by replacing setdar=x/y by setsar=a/b. a/b usually taken from the standards.
Code::: for PROGRESSIVE ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -vf "setdar=4/3" "%~1_newDAR.mp4"
Code::: for INTERLACED ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -flags +ilme+ildct -pix_fmt yuv420p -vf "setdar=4/3" "%~1_newDAR.mp4"
Last edited by Sharc; 19th Jan 2024 at 03:15.
-
Thanks for all the detail, everyone. I think I have to be prepared for a few different situations, as I'm working with a lot of sources and methods of aquisition
These are all mp4 files, but I know there's been some conversion in the past for some files, perhaps some were DVD rips with improper settings, etc.
I know I can go into VLC and get creative and say 'force it 4:3' and it may help some of these situations, but I'm using it with an automated media player...so I don't have the ability to go in and change it every time...so it basically runs like VLC set to 'default'. Playback wise, I want to keep the original format...if it was a widescreen video, use the full screen....if it was 4:3...then crop it, don't stretch it to fill the side space. If it was a video that was originally shot in 4:3 and had a lettebox crop, I might go in and get creative with Topaz AI and crop it myself....so it retains the aspect ratio, but gets rid of the top/bottom bars that looked 'chic' back in the 4:3 TV days. It won't be "perfect", as there may be some titling lost on the top/bottom...but it will at least prevent black bars around the whole thing...
For example..taking a look at one at the moment.
It's a mp4, 1280x720...fire up VLC with default as the aspect ratio, and there's no black bars, but it's stretched. If I force aspect ratio 4:3, it's back to looking normal, but if I throw it into my playlist, it's just going to stretch out.
So for this one, I'm assuming it's been "created" as a 16:9 file and someone probably just went along with wanting an 'HD capture' or wanted it to fill his screen...but since a lot of this is older 4:3 and blurry, it doesn't need any help in looking more awful..heh...so I'd want to get it to 1280x960 or 960x720, I guess?
I have to dig into the details on the previous replies..just to get a better idea of the different suggestions, but hopefully this info helps.
Pete -
I tried the 'Change DAR' from 1.78 to 1.33 for this one video and it did the trick! I'm not sure if it will work in every case, but so far it helps! Thank you!
-
@dayoff,
for those variations, I think one of the best workflows is to kind of categorize your different options, then create folders for each workflow, and then use VLC or similar flexible player to preview what should be done, and once youʻve seen the file play with adjustment, drop it into its appropriate folder. Then you could use a batch process on all the files in each folder, customized for that workflow.
Hope that helps,
Scott -
-
Originally Posted by Dayoff
fire up VLC with default as the aspect ratio, and there's no black bars, but it's stretched. If I force aspect ratio 4:3, it's back to looking normal, but if I throw it into my playlist, it's just going to stretch out. -
If your files are MPEG 2, DVDPatcher will rewrite the file header data to change from 16:9 to 4:3.
Beware: it overwrites the original file, so until you get the process sorted out, I suggest you work on copies.
It wouldn't work on some of my "home made" MPEGs, probably because they were dodgy (written years ago) but it worked nicely on a VideoRedo MPEG 2.
Here's how I set it up (the movie was originally 16:9; here I'm changing it to 4:3).
[Attachment 76306 - Click to enlarge] -
With clever FFmpeg-GUI you can change the DAR without recoding for H264 (AVC), H265 (hevc) and mpeg2 videos (for mpeg2 only three values are possible, namely 1.33 (4:3), 1.78 (16:9) and 2.21).
With the latest beta (v3.2.0.05) you can now change multiple files in batch mode in one go.
Load the first file, click main, click various, click change DAR, set the DAR, click to Batch.
Click Batch tasks, drag & drop all other videos into the batch task grid (the commandline from the 1st task will be replicated automatically to all other tasks), click execute.
All files must have the same video codec (e.g. h264), otherwise it will not work correctly as the command line differs depending on the video codec.
https://files.videohelp.com/u/292773/clever_ffmpeg_gui_newest_beta.zip -
-
Originally Posted by Sharc
-
OK, but you see where we have ended up:
A separate GUI or patcher suggested for almost every case, with instructions how to click and clack, and/or a request to improve the GUI if it doesn't solve the problem for the particular codec, container .... whatever.
People seem to be terribly intimidated by simple commandlines or basic scripts. Justified or not.
FFmpeg also offers bitstream filters for patching and metadata modifications (means without re-encoding the stream).
Take it - as always - with a grain of salt
Edit:
To add to the list of dedicated patchers:
Restream (for mpeg2)
mpgpatcher
Mpeg4 Modifier (for DivX, XviD)
HD264 Patcher and BDToolsLast edited by Sharc; 20th Jan 2024 at 03:02.
-
+1
Useless GUIs for a simple specific task. -
@Sharc & lollo
A normal user has a problem and wants to solve it.
So he can spend hours searching the Internet for command lines and try them out one after the other, or he can use a GUI that simply solves the problem without any further knowledge.
It is clear that experts prefer to use command lines, but not everyone has the necessary knowledge. -
Exactly. That's why I suggested the simple (IMO) solution in post#9 which should work for very most scenarios which the OP didn't even describe clearly
So he can spend hours searching the Internet for command lines and try them out one after the other, or he can use a GUI that simply solves the problem without any further knowledge.
Apologies for my sarcasm. Never mind. Your GUI is well maintained and frequently updated when there is a problem/new request as I see.
And there are GUIs which show the script/commands which they generate, so one can manually interact when necessary and learn from it.
P.S. I am not an expert. Not at all. Just an ordinary self-educated layman. I couldn't even design a GUI.Last edited by Sharc; 20th Jan 2024 at 05:05.
-
ProWo, Clever-FFMpegGUI and Hybrid are nice pieces of software. But for such a task a simple command line is adequate, and more performant.
Users should upgrade their knowledge when needed. Or stay as they are, with the consequences that Sharc highlighted -
To each his own.
There is a reason why virtually every piece of consumer software in the world is a GUI.
@Lollo, I had a chuckle at your Hybrid comment. Without criticising Selur, who has done a great job with it, it's inflexibility with output codecs and it's difficult interface with multiple traps caused me to teach myself QTGMC! Hybrid is not a simple program. On that point, I agree with Lordsmurf.
On the other hand, I find CleverFFMpeg-GUI simple when you know the few clicks required to achieve what this topic is about (for example). No copying and pasting of filenames, no esoteric code that needs to be remembered (or stored somewhere and cut and pasted into a new script) or adjusted. A classic example are the various ratios for NTSC, PAL, SD, HD. You can try to keep a track of 15/16, 10/11, 12/11 or just tell the program "give me 720x576 at 4:3 thanks". -
Alwin, Hybrid if for experienced users, as stated by Selur himself
-
Obviously.
I use Hybrid for VapourSynth processing with advanced upscale features such as VSR and modelling. Selur was very kind to send requesting people a customized Hybrid version including many dependencies and avoiding to deal with VS, Anaconda and so on.
But this will tell nothing to you, if you use Hybrid just to run a simple QTGMG processing 😲
Different expectations, different contest. -
Really not, sorry. The same as saying each time to have to download a couple of GUIs, install them and try which solves your problem best (if at all), etc.
You would normally store your (proven) commandline(s) in any folder (just one), and drag and drop the file(s) you want to process onto the applicable commandline. Done.
Anyway, I am not arguing against GUIs, but rather pointing to efficient alternatives - perhaps worth to try - for basic tasks. So let's stop here. As we say, to each his ownLast edited by Sharc; 20th Jan 2024 at 13:38.
-
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.Last edited by JN-; 22nd Jan 2024 at 10:21.
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