VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. How do i change the pixel aspect ratio of an mkv file without re-encoding? I used the wrong -sar in megui.
    Quote Quote  
  2. 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
    Quote Quote  
  3. 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.
    Quote Quote  
  4. 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.
    Quote Quote  
  5. thanks hello_hello. It's working for me now.
    Quote Quote  



Similar Threads

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