VideoHelp Forum




+ Reply to Thread
Results 1 to 12 of 12
  1. Hi all,

    I have several MKVs with hard-encoded black bars. When I watch on my Apple Vision Pro with Plex + Plexi, this obviously doesn't result in the best experience.

    I would prefer not to re-encode the files to remove the black bars with Handbrake. I understand you can add metadata via a ffmpeg script that should force Plex to ignore the bars.

    The script I'm using for a 4K file with an extra couple of pixels on the left, is:
    Code:
    ffmpeg -i <input>.mkv -map 0 -c:s copy -c:v copy -c:a copy -bsf:v hevc_metadata=crop_top=280:crop_bottom=280:crop_left=2 <output>.mkv
    Instead of eliminating the bars, the end result was 528 pixels cropped from the bottom (only!) and none from the left. Nothing cropped from the top, either.

    Do I have the correct script syntax and Plex isn't responding correctly? Is my only option a re-encode?
    Quote Quote  
  2. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    Not sure if your HW supports it, but you can in MKVtoolnix choose video track and then set crop in crop line. So remux only. Just not sure it will work.
    Quote Quote  
  3. Originally Posted by Bernix View Post
    Not sure if your HW supports it, but you can in MKVtoolnix choose video track and then set crop in crop line. So remux only. Just not sure it will work.
    Thanks for the suggestion. I was able to download/run MKVToolNix and use the Crop setting with a value of 2,280,0,280 and ran a Multiplex.

    Unless I did something wrong, it had no effect in Plex. The muxing took about 1 min to run the entire file, I assume I did it correctly.
    Quote Quote  
  4. That's it. Muxing is fast because it isn't encoding. And mkvtoolnix changes just some header-values. But nearly all player ignore these and take the real pixel or resolution values. That mkvtoolnix has done something you can see with mediainfo tool.
    Quote Quote  
  5. Originally Posted by ChristianundCo View Post
    That's it. Muxing is fast because it isn't encoding. And mkvtoolnix changes just some header-values. But nearly all player ignore these and take the real pixel or resolution values. That mkvtoolnix has done something you can see with mediainfo tool.
    Ya, I figured as much. ffmpeg script (shown in my OP) was doing something similar, and Plex was doing something with that metadata/header info, just not the right thing.

    For a H265 MKV file, do we have a preferred Handbrake encode setting that does the best at maintaining image quality?
    Quote Quote  
  6. The only players I found that seem to do the cropping correctly are SMPlayer and Windows 10's built in media players.
    Quote Quote  
  7. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    I couldn't get crop_left to work at all, anything specified other than 0, the output would not open in Vdub2, nor
    display the selected crop in wmplayer - although it played. Top, right and bottom worked OK
    Code:
    ffmpeg -i "c:\users\davex\desktop\bc265.mkv"  -bsf:v hevc_metadata=crop_left=0:crop_right=132:crop_top=96:crop_bottom=20 -c copy -y  bcoutm.mkv
    Image Attached Thumbnails Click image for larger version

Name:	out.jpg
Views:	22
Size:	115.8 KB
ID:	84146  

    Click image for larger version

Name:	source.jpg
Views:	11
Size:	64.8 KB
ID:	84147  

    Quote Quote  
  8. Originally Posted by davexnet View Post
    I couldn't get crop_left to work at all, anything specified other than 0, the output would not open in Vdub2, nor
    display the selected crop in wmplayer - although it played. Top, right and bottom worked OK
    Code:
    ffmpeg -i "c:\users\davex\desktop\bc265.mkv"  -bsf:v hevc_metadata=crop_left=0:crop_right=132:crop_top=96:crop_bottom=20 -c copy -y  bcoutm.mkv
    Thanks for experimenting. I've tried a dozen script combinations. Can't get anything to really work.
    Quote Quote  
  9. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by turns2stone View Post
    header info, just not the right thing.

    For a H265 MKV file, do we have a preferred Handbrake encode setting that does the best at maintaining image quality?
    For HEVC try preset Slow and CRF 22
    Quote Quote  
  10. Originally Posted by davexnet View Post
    Originally Posted by turns2stone View Post
    header info, just not the right thing.

    For a H265 MKV file, do we have a preferred Handbrake encode setting that does the best at maintaining image quality?
    For HEVC try preset Slow and CRF 22
    Thank you.
    Quote Quote  
  11. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    I think it is matter of video renderers. Tested and automatically chosen in Potplayer is working great (EVR custom preset) and some others as well. Some other do not work as expected.
    Probably still actual


    MKVtoolnix crop i got on mind.
    Last edited by Bernix; 16th Dec 2024 at 05:39. Reason: Software used
    Quote Quote  
  12. Originally Posted by Bernix View Post
    I think it is matter of video renderers. Tested and automatically chosen in Potplayer is working great (EVR custom preset) and some others as well. Some other do not work as expected.
    Probably still actual


    MKVtoolnix crop i got on mind.
    Ya I think you're right.
    Quote Quote  



Similar Threads

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