How do i change the pixel aspect ratio of an mkv file without re-encoding? I used the wrong -sar in megui.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
-
Mkvtoolnix' header editor can change the AR on the mkv container level. Mkvmerge can remove the SAR signalling from H.264 bitstreams.
If you want to change AR of H.264/AVC or H.265/HEVC bitstream level you can use ffmpeg's bitstream filters for example.
https://ffmpeg.org/ffmpeg-bitstream-filters.html#h264_005fmetadata
https://ffmpeg.org/ffmpeg-bitstream-filters.html#hevc_005fmetadata -
thanks for the info - sneaker. I changed video pixel height/width in header editor and now it's displaying correctly.
I also tried using ffmpeg like this but its not working
ffmpeg.exe -i "C:\abc\x\Copy.mkv" -c copy -bsf:v h264_metadata=sample_aspect_ratio=40:33 "C:\Users\Kyz\Desktop\video.mkv"Last edited by x264; 16th Jul 2018 at 12:52.
-
One of the Bluray players in our house only pays attention to an aspect ratio written to the video stream, so it can be an idea to change them both.
I use the Bitstream Modifier version of ffmpeg (for h264), but if you don't specify a frame rate or aspect ratio or colorimetry, they don't seem to be copied from the source, so it pays to specify them all. If you're not changing the SAR, set it to 1:1 for non-anamorphic video. When ffmpeg has done it's thing, remux a second time with MKVToolNix, as ffmpeg doesn't write the info to the container.
This is the command line I'd use for HD video, assuming I copied ffmpeg to the same folder as the video:
ffmpeg -i input.mkv -y -vcodec copy -an -sn -vbsf h264_changesps=colormatrix=1/colorprim=1/transfer=1/fps=24000:1001/sar=1:1 D:\output.mkv
Doom9 is still down so you can't get it from there at the moment, but it was easy enough to upload.
ffmpeg Bitstream Modifier & Muxer.zip (1.1MB)Last edited by hello_hello; 18th Jul 2018 at 08:18.
Similar Threads
-
Can I change the pixel aspect ratio in an x264 AVI without reencoding?
By Calidore in forum Video ConversionReplies: 24Last Post: 16th May 2018, 17:24 -
Need understanding of modules, anamorphic, pixel aspect ratio
By JeremyBrown in forum Newbie / General discussionsReplies: 2Last Post: 28th Jul 2017, 08:06 -
avisynth and pixel aspect ratio
By silicontrip in forum Newbie / General discussionsReplies: 6Last Post: 29th Sep 2016, 02:10 -
16x9 > 4:3. How to calculate new Pixel Aspect Ratio?
By HitTheRoad in forum Video ConversionReplies: 14Last Post: 11th Jun 2014, 16:45 -
aspect ratio mkv
By chaussettdeguerr in forum EditingReplies: 7Last Post: 16th Sep 2013, 09:57