VideoHelp Forum
+ Reply to Thread
Results 1 to 24 of 24
Thread
  1. I have a clip of a video which is in widescreen format (~21:9). I would like to re-encode this video to the standard format (4:3).

    Tried Handbrake, VirtualDub2, and ffmpeg but I'm not getting good results. Usually the final processed clip shows everything as being squeezed which is not what I want.

    Here is the clip.

    Here is MediaInfo on this clip -

    Image
    [Attachment 77645 - Click to enlarge]


    So is it possible to re-encode this widescreen video clip into the standard size video so that there is no squeezing of the imagery and there are no black bars either (on top/bottom of the clip, nor on sides of the clip)? I don't want to crop the clip either, if possible, as this might cause loss of some important details.
    Quote Quote  
  2. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    You MUST compromise on one/some of those requirements - either shape (Aspect), letter/pillar-boxing, or cropping. This is analogous to square peg & round hole.


    Scott
    Quote Quote  
  3. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Easy with VDub2. Desired Height=824. Desired width for 4:3=824x1.3333333 = 1098 (rounded to Even)

    Therefore 1920-1098 needs to be cropped ~ 2 x 411

    In VDub2: set up crop filter: crop 411 off each side.

    Export/Save Video as desired.

    Handbrake cropping is a total disaster.
    Image Attached Files
    Quote Quote  
  4. I would keep the width. The source video has an aspect ratio of 2.33:1, but the original is 2.35:1, so the height must be corrected to 818 before padding.
    Afterwards padding to 1920x1440 (4:3).

    Image
    [Attachment 77650 - Click to enlarge]
    Image Attached Files
    Quote Quote  
  5. Impossible what you request without distorting the picture. You can crop or pad.

    In ffmpeg try the options

    a) to fill the 4:3 screen and keeping the height as is, try
    Code:
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -filter:v "scale=w=1098:h=824:force_original_aspect_ratio=increase,crop=1098/sar:824" "%~1_cropped.mp4"
    b) using letterboxing to keep the full picture:
    Code:
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -filter:v "scale=w=1098:h=824:force_original_aspect_ratio=decrease,pad=1098/sar:824:-1:-1:color=black" "%~1_padded.mp4"
    Quote Quote  
  6. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    Originally Posted by meeshu View Post
    So is it possible to re-encode this widescreen video clip into the standard size video so that there is no squeezing of the imagery and there are no black bars either (on top/bottom of the clip, nor on sides of the clip)? I don't want to crop the clip either, if possible, as this might cause loss of some important details.
    This is impossible, You can't have all the conditions met, It's simple geometry.
    Quote Quote  
  7. Thanks for the replies, especially the detailed replies!

    The cropping option is not really a good solution as it removes some details from the imagery.

    The better option seems to be with the black bars, and although I'm not happy with this option either, it at least preserves all of the imagery.

    Still experimenting with the test clip trying to get the best possible result (minimal black bars).
    Quote Quote  
  8. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Still experimenting with the test clip trying to get the best possible result (minimal black bars).
    As pointed out, you cannot reduce the black bars without cropping. If you don't crop, your video will become distorted, vertically stretched. By "minimal black bars" you really mean "reduced black bars".

    If you will accept black bars, just use the file as-is. Players should fill the screen laterally and you'll have letterboxing ie black bars top and bottom.

    Or you could reduce the letterboxing by going to 16:9. You'll lose a bit off the sides, but not as much as if you cropped to 4:3.

    16:9 video attached. 228 pixels cropped off each side.
    Quote Quote  
  9. Originally Posted by meeshu View Post
    The cropping option is not really a good solution as it removes some details from the imagery.
    Really?? Compared to what?

    Cropping is usually, by far, the least destructive option.

    You could also use the features on your media player to crop the image, without having to do any work at all. That's what I'd do if I were you.
    Quote Quote  
  10. Cropping the video means having to remove some of the imagery from the video, which is a destructive process and is not wanted.

    With the black bar option, all of the imagery is preserved and is therefore a non-destructive process and is the better option of the two.
    Quote Quote  
  11. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    OK, then the whole topic is pointless. You obviously cannot "get rid of" the black bars without causing distortion (vertical stretching). Just play the file as-is and accept that you'll have black bars top and bottom (Letterboxing).
    Quote Quote  
  12. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    How about a slight crop and stretch ?
    Image Attached Thumbnails Click image for larger version

Name:	fof.jpg
Views:	9
Size:	143.6 KB
ID:	77670  

    Click image for larger version

Name:	fof2.jpg
Views:	10
Size:	108.9 KB
ID:	77671  

    Quote Quote  
  13. Capturing Memories dellsam34's Avatar
    Join Date
    Jan 2016
    Location
    Member Since 2005, Re-joined in 2016
    Search PM
    I'm not entirely sure why the OP wants to view a widescreen material on a 4:3 aspect ratio, Is it a monitor limitation? If so you can do some editing called pan and scan that was used by major production companies to fit widescreen materials into an old school CRT TVs by using a NLE editor with keyframes with minimum damage to the original content, Basically sliding a 4:3 rectangle within the widescreen frame left or right depends on where the important area of viewing or the subject is located.

    Select the 4:3 rectangle within the widescreen frame and go scene by scene, If the scene has the subject on the left, position the 4:3 rectangle on the left for the entire scene, the same for the right or anywhere in between. If the subject is moving in the scene, you use keyframes, select the subject initial position at the beginning of the scene, Select the subject final position at the end of the scene, The frame would move along the scene from the initial to the final position as the scene moves, this is called linear pan or something like that, you can do non-linear pan by selecting more than 2 key frames at different positions in the scene. It's time consuming though.
    Quote Quote  
  14. @meeshu: After all, why would you want to make it "standard 4:3"? Is your TV 4:3?
    As Alwyn suggested, for todays TVs, mobile phones and monitors better put it onto a "standard 16:9" canvas. Here 3 variants cropped or padded to 16:9.

    - for 16:9 cropping
    Code:
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -filter:v "scale=w=1280:h=720:force_original_aspect_ratio=increase,crop=1280/sar:720" "%~1_cropped.mp4"
    - for 16:9 padding
    Code:
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 22 -filter:v "scale=w=1280:h=720:force_original_aspect_ratio=decrease,pad=1280/sar:720:-1:-1:color=black" "%~1_padded.mp4"
    You can easily adjust the canvas size (1280,720) by some other 16:9 ratio like (1920,1080) if your prefer.

    - or you could apply some compromize cropping to reduce the size of the letterbox pads.
    Code:
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -filter:v "scale=w=1440:h=1080:force_original_aspect_ratio=decrease,pad=1440/sar:1080:-1:-1:color=black,crop=1280/sar:720" "%~1_crop-pad.mp4"
    etc. (you can apply similar compromizes for 4:3 as well).
    Last edited by Sharc; 14th Mar 2024 at 03:33. Reason: 3rd variant added
    Quote Quote  
  15. Originally Posted by Alwyn View Post
    OK, then the whole topic is pointless. You obviously cannot "get rid of" the black bars without causing distortion (vertical stretching). Just play the file as-is and accept that you'll have black bars top and bottom (Letterboxing).
    Pointless? No. It has now been determined that the best option is use padding (black bars).
    Quote Quote  
  16. Originally Posted by davexnet View Post
    How about a slight crop and stretch ?
    Thanks, but no cropping, even slight cropping is not really wanted.
    Quote Quote  
  17. Originally Posted by dellsam34 View Post
    I'm not entirely sure why the OP wants to view a widescreen material on a 4:3 aspect ratio, Is it a monitor limitation? If so you can do some editing called pan and scan that was used by major production companies to fit widescreen materials into an old school CRT TVs by using a NLE editor with keyframes with minimum damage to the original content, Basically sliding a 4:3 rectangle within the widescreen frame left or right depends on where the important area of viewing or the subject is located.

    Select the 4:3 rectangle within the widescreen frame and go scene by scene, If the scene has the subject on the left, position the 4:3 rectangle on the left for the entire scene, the same for the right or anywhere in between. If the subject is moving in the scene, you use keyframes, select the subject initial position at the beginning of the scene, Select the subject final position at the end of the scene, The frame would move along the scene from the initial to the final position as the scene moves, this is called linear pan or something like that, you can do non-linear pan by selecting more than 2 key frames at different positions in the scene. It's time consuming though.
    The 4:3 aspect chosen here is primarily for experimental purposes and not due to limitation on hardware.

    Pan and scan, or scan and pan, is not really wanted either as there is cropping involved which is not ideal.
    Quote Quote  
  18. Originally Posted by Sharc View Post
    @meeshu: After all, why would you want to make it "standard 4:3"? Is your TV 4:3?
    As Alwyn suggested, for todays TVs, mobile phones and monitors better put it onto a "standard 16:9" canvas. Here 3 variants cropped or padded to 16:9.

    - for 16:9 cropping
    Code:
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -filter:v "scale=w=1280:h=720:force_original_aspect_ratio=increase,crop=1280/sar:720" "%~1_cropped.mp4"
    - for 16:9 padding
    Code:
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 22 -filter:v "scale=w=1280:h=720:force_original_aspect_ratio=decrease,pad=1280/sar:720:-1:-1:color=black" "%~1_padded.mp4"
    You can easily adjust the canvas size (1280,720) by some other 16:9 ratio like (1920,1080) if your prefer.

    - or you could apply some compromize cropping to reduce the size of the letterbox pads.
    Code:
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -filter:v "scale=w=1440:h=1080:force_original_aspect_ratio=decrease,pad=1440/sar:1080:-1:-1:color=black,crop=1280/sar:720" "%~1_crop-pad.mp4"
    etc. (you can apply similar compromizes for 4:3 as well).
    Thanks for the detailed comment.

    The 4:3 aspect ratio for this case here is mostly for experimental purposes and not for any particular device.
    Quote Quote  
  19. I'm now experimenting with 1920 x 1440 (4:3 aspect), but still getting squeezed imagery.

    What is the correct command in ffmpeg to show 1920 x 1440 correctly (without any squeezing)?
    Quote Quote  
  20. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    You need to add 308 pixels to top and to bottom (1440-824=616/2=308). You'll then have an in-proportion 1920x1440 frame (given the original video is 1920 wide).

    I don't know the ffmpeg commands for adding/padding/letterboxing.
    Image Attached Thumbnails Click image for larger version

Name:	FIST OF FURY - ice factory fight in4-3 frame.jpeg
Views:	6
Size:	827.9 KB
ID:	77694  

    Quote Quote  
  21. Originally Posted by meeshu View Post
    I'm now experimenting with 1920 x 1440 (4:3 aspect), but still getting squeezed imagery.

    What is the correct command in ffmpeg to show 1920 x 1440 correctly (without any squeezing)?
    It is as simple as adjusting commandline b) of post #5 accordingly (changes are in red):

    Code:
    ffmpeg -y -i "%~1" -c:a aac -c:v libx264 -preset slow -crf 20 -filter:v "scale=w=1920:h=1440:force_original_aspect_ratio=decrease,pad=1920/sar:1440:-1:-1:color=black" "%~1_padded.mp4"
    Sidenote: This ffmpeg commandline is pretty universal by the way: One can for example apply it to mobile phone clips taken in portrait mode, or WhatsApp clips, and fit these undistorted onto an x:y frame (canvas).
    No need for a calculator on your desk (or on your knees).
    Image Attached Files
    Last edited by Sharc; 15th Mar 2024 at 02:01. Reason: Sidenote added
    Quote Quote  
  22. Thanks Alwyn and Sharc for the comments.

    In ffmpeg, I thought I did just change the pixel values for width and height, but I must have accidentally mistyped something within ffmpeg command leading to squeezed imagery on the output video clip(?)

    Tried again, and this time got a better result!

    Thank you.
    Quote Quote  
  23. Originally Posted by meeshu View Post
    Tried again, and this time got a better result!
    Just do exactly as instructed (using Vdub or ffmpeg), and the resizing result will be perfect.
    Quote Quote  
  24. The infamous ice factory fight was in the film - The Big Boss.

    https://www.imdb.com/title/tt0067824/?ref_=tt_sims_tt_t_1
    Quote Quote  



Similar Threads

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