I accidentally recorded the file in VirtualDub in avi format instead of mov (ProRes).
How to copy it to a mov file (it's easy using ffmpeg with -c copy), but at the same time change PAR to 12/11 (I can do this for mp4, but it doesn't work here). -aspect only changes DAR.
+ Reply to Thread
Results 1 to 7 of 7
-
-
https://mediaarea.net/MOVMetaEdit
PAR editor only works with CLI version
Code:MOVMetaEdit --par 12:11 input.mov
-
It works, but probably not as it should. The image is now skinny
Summary:
OK = file is correctly detected and does not need to be modified ('Yes') or is correctly detected and need to be modified ('Mod') or is correctly detected and need to be modified but not supported ('No') or there was a problem with it (empty)
PAR = PAR atom is not present ('No'), not present but can be (or is) inserted ('Can'), present and can be (or is) modified (value of the old PAR)
PAR|M = PAR will be modified ('Y') or should be modified but it is not possible due to feature not implemented ('N')
w-scale = (old) width scale of the picture
w-scale|M = w-scale will be modified ('Y')
| OK| PAR|M|Width|w-scale|M|
out.mov|Yes| 9:10| | 720| 1.000| |Last edited by rgr; 20th Apr 2024 at 02:48.
-
If you keep storage aspect ratio (SAR) the same, and you change the DAR (display aspect ratio) you also change the PAR (pixel aspect ratio).
Thus, if your source is displayed properly, and you change the PAR or DAR till will get distorted unless you re-encode and also change the storage aspect ratio (SAR).
https://en.wikipedia.org/wiki/Pixel_aspect_ratiousers currently on my ignore list: deadrats, Stears555, marcorocchini -
Link to the correct version of the program:
https://mediaarea.net/download/snapshots/binary/movmetaedit/20240413/MOVMetaEdit_CLI_1...indows_x64.zip
With this version, PAR change works properly. -
Hi. Can you please tell how to set the DAR in ffmpeg when using ffmpeg with `-c:v copy` ... is it `-vf "setdar=16/9"` which works or does it fail ?
edit:
Oh.
1. cannot use filtering like '-vf "setdar=16/9"' with 'c:v copy'
2. bitstreamfiltering '-bsf:v h264_metadata=' does not have a Display Aspect Ratio (DAR) option, one has to calculate the Sample Aspect Ratio (SAR) and use that.
ChatGPT just told me:
edit 2: IGNORE THIS BIT, ChatGPT fibs.
Yes, you can use variables in ffmpeg to calculate SAR dynamically. You can use the variables $width and $height to refer to the width and height of the input video respectively. Here's how you can do it for 4:3:
This command dynamically calculates the SAR based on the dimensions of the input video, which allows you to adjust the DAR without re-encoding and without needing to know the exact resolution in advance.
Code:ffmpeg -i input.mp4 -c:v copy -bsf:v h264_metadata=sample_aspect_ratio=$((4*$height)):$((3*$width)) output.mp4
$((3*$width)) calculates the denominator of the SAR, which is 3 times the width of the video.
Code:-c:v copy
Code:-bsf:v h264_metadata=sample_aspect_ratio=$((4*$height)):$((3*$width))
For a 4:3 DAR, you can use the formula to calculate SAR. Assuming the height and width of your video are standard (480p or 720p), you can calculate the SAR accordingly. For example:
For 720p (1280x720): SAR = 4:3 * (720/1280) = 4:3 * 0.5625 ≈ 4:3 * 9:16 = 9:12
For 480p (640x480): SAR = 4:3 * (480/640) = 4:3 * 0.75 = 3:4
So, for a 720p video, you would use SAR 9:12:
Code:ffmpeg -i input.mp4 -c:v copy -bsf:v h264_metadata=sample_aspect_ratio=9:12 output.mp4
Code:ffmpeg -i input.mp4 -c:v copy -bsf:v h264_metadata=sample_aspect_ratio=3:4 output.mp4
Here's the ffmpeg command to set the SAR dynamically for a PAL 576p video:
Code:ffmpeg -i input.mp4 -c:v copy -bsf:v h264_metadata=sample_aspect_ratio=32:27 output.mp4
Last edited by hydra3333; 21st Apr 2024 at 07:09.
Similar Threads
-
Pixel Aspect Ratio
By biferi in forum Newbie / General discussionsReplies: 54Last Post: 3rd Feb 2024, 05:34 -
Conversion of Frame Size and Pixel Aspect Ratio
By gs684 in forum EditingReplies: 0Last Post: 3rd Jul 2022, 20:54 -
Changing Aspect Ratio of .mkv file
By HartsVideo in forum EditingReplies: 2Last Post: 4th Dec 2021, 14:57 -
Problem with changing aspect ratio of .ts file (ReStream)
By lemmy999 in forum EditingReplies: 5Last Post: 24th Jun 2021, 20:19 -
Pixel Aspect Ratio, how am I meant to deal with it?
By PRAGMA in forum Newbie / General discussionsReplies: 6Last Post: 22nd Nov 2020, 23:17