I seem to have poisoned the aspect ratio of a video I converted from UHD.
The video was a UHD rip, so 16:9 DAR. I stripped the letterbox and downsampled to 1920x800 with:
This correctly cropped, but when the scale_cuda filter got at it, it decided to change the SAR to stretch the resultant video back to 16:9. My Roku will now not display it correctly. The SAR/DAR show as pretty odd when I ffprobe it:Code:ffmpeg -analyzeduration 1000000000 -probesize 100G -loglevel warning -stats -hwaccel cuda \ -hwaccel_output_format cuda -y -i "UHDSOURCE.mkv" -map 0:v? -c:v hevc_nvenc \ -preset p7 -2pass true -multipass fullres -rc vbr -rc-lookahead 55 -b:v 1000k -minrate 0 -maxrate 3000k \ -bufsize 120000k -vf crop=3840:1600:0:280,scale_cuda=1920:800 -metadata title="HDDEST" \ -map 0:a:2 -c:a:0 aac -b:a:0 160k -map 0:a:4 -c:a:1 aac -b:a:1 96k \ -map 0:s? -c:s copy -map_metadata 0 "HDDEST.mkv"
I tried to correct with ffmpeg (-aspect 12:5), mkvtoolnix, and mp4box (par=12:5). The results with all of them is the same, where the stream shows as having two different aspect ratios:Code:Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x800 [SAR 20:27 DAR 16:9], SAR 27:20 DAR 81:25, 23.98 fps, 23.98 tbr, 1k tbn (default)
I have no idea why the aspect ratio is shown twice. Once in square brackets, which I can't change for love nor money, and once outside square brackets. No matter what I do, the values shown in square brackets remain the same.Code:Stream #0:0[0x1](eng): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x800 [SAR 20:27 DAR 16:9], 1072 kb/s, SAR 1:1 DAR 12:5, 23.98 fps, 23.98 tbr, 16k tbn, Start 0.021000 (default)
Unfortunately, I knocked my burner with the UHD disc off my desk and damaged the disc so can't re-encode this. Even if I could, though, I'd like to understand what's going on here. There must be a way to change this metadata without reencoding.
+ Reply to Thread
Results 1 to 10 of 10
-
-
Have you tried clever-FFmpeg-GUI
you can post your questions in the support thread here: Support Forum
-
Use clever Ffmpeg-GUI.
Load your mkv, click main page, click various, click change DAR.
insert 2.39 as new DAR, click change DAR.
Done.
No reencode occours. -
If the GUI can do it, it has to be possible from the ffmpeg command line.
I already tried:
Code:ffmpeg -i a.mkv -aspect 12:5 -c copy a2.mkv
Code:ffmpeg -i a2.mkv -c copy -metadata:s:v:0 display_aspect_ratio=12:5 a2a.mp4
Even after these, ffprobe still shows:
Code:Stream #0:0[0x1](eng): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 1920x800 [SAR 20:27 DAR 16:9], 1072 kb/s, SAR 1:1 DAR 12:5, 23.98 fps, 23.98 tbr, 16k tbn, Start 0.021000 (default)
-
In ffmpeg the HEVC (or H.264) stream can have the aspect ratio set independent of the container.
Using -aspect sets the container's aspect ratio. Using -vf setsar would work on the stream but imposes a re-encode and I was really trying to avoid that.
I was finally able to do it without a re-encode by using a bitstream filter:
Code:ffmpeg -i faulty.mkv -map 0:v:0 -c:v:0 copy -aspect 12:5 -bsf:v:0 hevc_metadata=sample_aspect_ratio=1 -map 0:a:0 -c:a:0 copy corrected.mkv
-
-
-
Not really. He cropped like 3840:1600 = 2.40:1 and resized to 1920:800 = 2.40:1. Even though the movie AR might in fact be 2.39:1 he has to set the DAR as 2.4:1 because of the way how he cropped and the pixel aspect ratio of the source is 1:1 square pixels.
Anyway, splitting hairs -
The correct source AR can be applied, even with 1920x800, as you can see here:
[Attachment 87011 - Click to enlarge]
Similar Threads
-
How to fix DVD aspect ratio please?
By BrownMan in forum Newbie / General discussionsReplies: 12Last Post: 24th Aug 2024, 12:45 -
About video aspect ratio!
By Valentin98 in forum Video ConversionReplies: 2Last Post: 30th Aug 2023, 07:27 -
Which Video Conversion Programs allow for Custom Aspect Ratio?
By Dart77 in forum Video ConversionReplies: 13Last Post: 5th Feb 2022, 09:25 -
Incorrect aspect ratio on video?
By hairychickenlegs in forum Software PlayingReplies: 2Last Post: 22nd Jan 2021, 09:57 -
Any Video Converter Aspect Ratio keeps changing
By MasterNe0 in forum Video ConversionReplies: 17Last Post: 16th Aug 2020, 21:13