I'm trying to resize video to 640x480, aspect Ratio 4:3 and KEEP the black bars. The first season of the video is in 4:3 and the second season is in 16:9 so I'm just resizing them both to 4:3 which SHOULD leave the black bars for season 2 but the software keeps changing the resolution & auto-cropping the file to a different size and leaving the aspect for season 2 at 16:9. What do I need to do to FORCE ffmpeg to convert the aspect to what I set it to?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This could work:
-filter:v "pad=iw:iw*3/4:(ow-iw)/2:(oh-ih)/2,setsar=1"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2023-11-13
Can you tell me how to force not the display aspect ratio but the actual video resolution and aspect to either:
640x480 w/ 4:3 ratio
640x360 w/ 16:19 ratio
Example: I have a video with 720x480 resolution and 3:2 aspect ratio I want to resize and change to 640x480, 4:3 which I know will display correctly but ffmpeg won't change the aspect and I'm having trouble understanding how to change aspects in ffmpeg.
Thanks so much!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2023-11-13
I'm trying to make ffmpeg force 1 of 2 sets of resolutions/aspects
640x480, 4:3
640x360, 16:9
I tried the below for option 1 but got 640x480 with 16:9 aspect ratio? I'm totally confused.
Conceptually, there are three terms DAR (display aspect ratio), PAR (pixel aspect ratio), and SAR (storage aspect ratio), these terms are used interchangeably to refer to/denote video resolution creating confusion sometimes.
DAR: The aspect ratio at which a video should be shown on a screen or monitor is called the Display Aspect Ratio, or DAR. It considers the scaling or display of the video samples (SAR) as well as their requirements. DAR determines how a video will appear on a monitor and is sometimes described as a ratio, such as 16:9 or 4:3.
PAR: Pixel aspect ratio is a mathematical ratio that describes how the width of a pixel in a digital image compares to the height of that pixel. Most digital devices display an image as a grid of tiny, square pixels so for that kind of device PAR will be 1:1. But some devices display an image as a grid of rectangular pixels, in which the pixel width and height are different. The pixel aspect ratio describes this difference.
SAR: Storage aspect ratio is the ratio of pixel dimensions when an image/video is displayed on a particular device. If an image/video is displayed with square pixels then PAR and SAR are the same but for rectangular pixels, the PAR and SAR differ.
FFmpeg denotes PAR as SAR in their metadata information, so what you see as the value of SAR (sample_aspect_ratio) is the PAR (pixel aspect ratio) for the video.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to resize video to 640x480, aspect Ratio 4:3 and KEEP the black bars. The first season of the video is in 4:3 and the second season is in 16:9 so I'm just resizing them both to 4:3 which SHOULD leave the black bars for season 2 but the software keeps changing the resolution & auto-cropping the file to a different size and leaving the aspect for season 2 at 16:9. What do I need to do to FORCE ffmpeg to convert the aspect to what I set it to?
I'm not sure if I understand your needs. If you resize 16:9 to 4:3 image is deformed:
-vf scale=ih*4/3:ih,setsar=1
If you want both vertical/horizontal black bars, this could be the parameter:
-filter:v "pad=iw:iw*3/4:(ow-iw)/2:(oh-ih)/2"
Last edit: Abel 2023-11-01
This could work:
-filter:v "pad=iw:iw*3/4:(ow-iw)/2:(oh-ih)/2,setsar=1"
Can you tell me how to force not the display aspect ratio but the actual video resolution and aspect to either:
Example: I have a video with 720x480 resolution and 3:2 aspect ratio I want to resize and change to 640x480, 4:3 which I know will display correctly but ffmpeg won't change the aspect and I'm having trouble understanding how to change aspects in ffmpeg.
Thanks so much!
I'm trying to make ffmpeg force 1 of 2 sets of resolutions/aspects
I tried the below for option 1 but got 640x480 with 16:9 aspect ratio? I'm totally confused.
-map 0 -c:v hevc_amf -quality balanced -rc cqp -qp_p 28 -qp_i 28 -quality balanced -rc cqp -qp_p 28 -qp_i 28 -vf "scale=640:480,setsar=sar=4/3" -c:a aac -b:a 128K -filter:a loudnorm
Did you try setdar=dar=4/3
Ok, Just ried the following preset:
-map 0 -c:v hevc_amf -quality balanced -rc cqp -qp_p 28 -qp_i 28 -quality balanced -rc cqp -qp_p 28 -qp_i 28 -vf "scale=640:480,setsar=sar=4/3" -c:a aac -b:a 128K -filter:a loudnorm -c:s copy
...and it gave me the attached in Media Info. Can you explain?
The original video was 720x480 with 3:2 Aspect Ratio. Just as an fyi. Thanks!
Last edit: Anonymous 2023-11-14
I hope this helps:
Conceptually, there are three terms DAR (display aspect ratio), PAR (pixel aspect ratio), and SAR (storage aspect ratio), these terms are used interchangeably to refer to/denote video resolution creating confusion sometimes.
DAR: The aspect ratio at which a video should be shown on a screen or monitor is called the Display Aspect Ratio, or DAR. It considers the scaling or display of the video samples (SAR) as well as their requirements. DAR determines how a video will appear on a monitor and is sometimes described as a ratio, such as 16:9 or 4:3.
PAR: Pixel aspect ratio is a mathematical ratio that describes how the width of a pixel in a digital image compares to the height of that pixel. Most digital devices display an image as a grid of tiny, square pixels so for that kind of device PAR will be 1:1. But some devices display an image as a grid of rectangular pixels, in which the pixel width and height are different. The pixel aspect ratio describes this difference.
SAR: Storage aspect ratio is the ratio of pixel dimensions when an image/video is displayed on a particular device. If an image/video is displayed with square pixels then PAR and SAR are the same but for rectangular pixels, the PAR and SAR differ.
FFmpeg denotes PAR as SAR in their metadata information, so what you see as the value of SAR (sample_aspect_ratio) is the PAR (pixel aspect ratio) for the video.