VideoHelp Forum
+ Reply to Thread
Results 1 to 23 of 23
Thread
  1. Member
    Join Date: Jul 2011
    Location: Houston, TX
    Search PM
    I have several videos that I've ripped from DVDs into MKV files using MakeMKV. Some of the videos rip the original 16:9 video into a 4:3 window, "squishing" the video horizontally only. In other words, black bars are only on the sides.

    Following the instructions in this thread:http://forum.videohelp.com/threads/293271-stretch-a-4-3-video-back-to-16-9, I am able to override the Display aspect ration and the videos playback with the correct 16:9 ratio using mkvmerge GUI. I've attached a MediaInfo file for this example (Rebus-S01E04-Mortal Causes.mkv.mediainfo.xml)

    In another example, the original 16:9 video is ripped to the correct aspect ration, but it doesn't fill the screen; there are black bars on the top, bottom and both sides.

    When I use the same process to override the Display Aspect Ratio, the video is stretched to fill the screen horizontally, but black bars remain on the top and bottom and the vertical dimension isn't stretched.

    Original file MediaInfo: Rebus-S01E04-Mortal Causes.mkv.mediainfo.xml
    "Stretched" file MediaInfo: Rebus-S01E04-Mortal Causes (1).mkv.mediainfo.xml

    How do I stretch/crop the videos to display correctly?

    Is there a better way to rip the videos to the correct aspect ratio to start with?

    I know that most media players/TVs will allow you to zoom the video, but I'm ripping these to convert and transfer to an iPad, which doesn't have the zoom feature.

    Thanks in advance for your help!
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date: Aug 2000
    Location: Sweden
    Search Comp PM
    Can you post screenshots?
    Quote Quote  
  3. Member
    Join Date: Jul 2011
    Location: Houston, TX
    Search PM
    Click image for larger version

Name:	Original_snip.JPG
Views:	228
Size:	115.8 KB
ID:	22134

    Screen grab from original ripped video


    Click image for larger version

Name:	Stretched_snip.JPG
Views:	210
Size:	131.0 KB
ID:	22136
    Screen grab from video with Display aspect ratio set to 16:9

    The resulting video is stretched only horizontally.
    Quote Quote  
  4. Looks 4:3 to me.
    In another example, the original 16:9 video is ripped to the correct aspect ration, but it doesn't fill the screen; there are black bars on the top, bottom and both sides.
    If the pic is an example of that, changing the DAR won't fix it. You'll have to crop, resize, and reencode. The link doesn't apply to something like this. It's already in the correct aspect ratio.
    Quote Quote  
  5. Member
    Join Date: Jun 2012
    Location: USA
    Search Comp PM
    It's a 14:9 "compromise" ratio that BBC (and others) were so fond of a while back. Either crop to 16:9 with the live image touching the top and bottom or 4:3 with the live image touching the sides.

    Depending on your player, you can also just crop to the live image.
    Quote Quote  
  6. Member
    Join Date: Jul 2011
    Location: Houston, TX
    Search PM
    I've ripped the video, in order to convert and play it on an iPad. The iPad won't zoom the image as most players will, so I'll need to do the cropping and converting before I put it on the iPad.

    Can someone point me to a procedure to accomplish this? Can it be done with mkvmerge GUI? Is there another, better tool?
    Quote Quote  
  7. Originally Posted by smrpix View Post
    It's a 14:9 "compromise" ratio that BBC (and others) were so fond of a while back.
    That's interesting. Learn something new every day. So even the upper picture isn't at the right aspect ratio, but slightly too wide?
    Then perhaps he can fix it after all in MKVMerge by setting it to 4:3, maybe? Or does he still have to reencode?
    Last edited by manono; 16th Dec 2013 at 16:13.
    Quote Quote  
  8. Member
    Join Date: Jul 2011
    Location: Houston, TX
    Search PM
    I tried 14:9 (1.56) and it didn't fix the problem.
    Quote Quote  
  9. Member
    Join Date: Jun 2012
    Location: USA
    Search Comp PM
    The actual aspect ratio appears correct. But it has the added windowboxing typical of the SD output of an HD cable box. Oddly, OP's screengrabs are (almost) 1920x1080 while his Mediainfos say 720x480, hmm.

    iPad will zoom to whatever the physical dimensions of the actual file are, so he can crop or not as he pleases. However, since MKV files can't be played on the iPad (at least not the native player,) a lot of this is moot.
    Quote Quote  
  10. Member
    Join Date: Jul 2011
    Location: Houston, TX
    Search PM
    I didn't mean to confuse anyone. The screen grabs are screen captures rather than still frames from the actual audio, so the graphics info associated with them doesn't represent the actual video info.

    I have been using ffmpeg to convert other mkv videos (once I have them in the correct aspect ratio) to the proper mp4 format to play on the iPad using the following:
    FFMPEG -y -i INPUT -threads CPU_CORES -vcodec libx264 -level 31 -subq 6 -me_range 16 -qmin 10 -qmax 50 -g 300 -s 1280xHEIGHT -r 29.97 -b 2500k -maxrate 4000k -acodec aac -strict -2 -ac 2 -ab 160k -ar 48000 -f mp4 OUTPUT
    Is there a way to use ffmpeg to crop and convert the videos in the same step (or multiple steps)?
    Quote Quote  
  11. Member
    Join Date: Jun 2012
    Location: USA
    Search Comp PM
    Here's a pretty good explanation of cropping with ffmpeg including a number of options:
    http://www.renevolution.com/understanding-ffmpeg-part-iii-cropping/

    Your screencaps hide more than they show -- we don't know which black bars are part of your video or which may be added by the computer. The aspect ratio appears to be displaying correctly, taking the two images together it's probably letterboxed 4:3. The "live" image appears to be 14:9. iPads will play 14:9 square pixel images with no problem.
    Quote Quote  
  12. Try Handbrake. It has automatic cropping (and manual override) and iPad/AppleTV presets.
    Quote Quote  
  13. Member
    Join Date: Jul 2011
    Location: Houston, TX
    Search PM
    Thanks for the cropping link! I was able to use that information to develop the following ffmpeg encode:
    Code:
    FFMPEG -y -i INPUT -threads CPU_CORES -vcodec libx264 -level 31 -subq 6 -me_range 16 -qmin 10 -qmax 50 -g 300 -s 704x416 -r 29.97 -b 2500k -maxrate 4000k -acodec aac -strict -2 -ac 2 -ab 160k -ar 48000 -vf "crop=704:416:12:34" -f mp4 OUTPUT
    The cropping parameters came from running:
    Code:
    ffmpeg -i INPUT  -vf "cropdetect=24:16:0" dummy.avi
    The aspect ratio of 3 of the 4 episodes of this series were 704:416. the 4th was 704:400.

    The conversion worked, but now the video has horizontal lines that degrade the picture. I've attached a screen grab from VLC to illustrate.

    I've included MediaInfo xml files for both versions.

    Is there something in my settings I can tweak to reduce and/or remove the lines?
    Attached Images  
    Attached Files
    Quote Quote  
  14. I think you resized to 704x416, not cropped.

    http://www.ffmpeg.org/ffmpeg-filters.html#crop
    http://www.ffmpeg.org/ffmpeg-filters.html#Examples-33

    Then, since your video is interlaced you'll need to encode interlaced, or deinterlace and encode progressive.
    Last edited by jagabo; 4th Jan 2014 at 19:32.
    Quote Quote  
  15. @jagabo: the ' -vf "crop=704:416:12:34" '-part at the end of his call (bad placement) should do the cropping.
    Quote Quote  
  16. You're right. I didn't scroll far enough. I saw the comingled fields in the sample image and scrolled as far as the "-s 704x416" and assumed that he simply resized. Then the resizing problem is because the video was encoded progressive, not interlaced. Add -tff to the x264 command line. Or inverse telecine or deinterlace, and encode progressive.
    Quote Quote  
  17. Member
    Join Date: Jul 2011
    Location: Houston, TX
    Search PM
    Sorry to be such a newb, but can you provide the syntax to adjust my command line above?

    Where do I put TFF?

    Or conversely, how do I deinterlace? What is the command syntax?
    Last edited by elprice7345; 5th Jan 2014 at 16:40.
    Quote Quote  
  18. Sorry, I don't really use ffmpeg. -tff is the option when using x264 cli encoder. But it looks like you can add "-flags +ilme+ildct -top 1" to the list of encoding options when using ffmpeg. If your video is bottom field first change the 0 to a 1.
    Quote Quote  
  19. Member
    Join Date: Jul 2011
    Location: Houston, TX
    Search PM
    I ended up having to deinterlace the video in order to play it in itunes and/or the ipad.

    The ffmpeg string that ended up working is:
    Code:
    FFMPEG -y -i INPUT -threads CPU_CORES -vcodec libx264 -level 31 -subq 6 -me_range 16 -qmin 10 -qmax 50 -g 300 -r 29.97 -b:v 2500k -maxrate 4000k -acodec aac -strict -2 -ac 2 -ab 160k -ar 48000 -vf "crop=704:416:12:34, yadif" -f mp4 OUTPUT
    Thanks for your help!
    Quote Quote  
  20. Originally Posted by elprice7345 View Post
    I ended up having to deinterlace the video in order to play it in itunes and/or the ipad.
    Typical useless Apple products.
    Quote Quote  
  21. Always deinterlace first so change your FFmpeg command with:
    -vf "yadif,crop=704:416:12:34"
    Starbuck
    Author of FreePlayer and DVDx 4.x
    Quote Quote  
  22. Member
    Join Date: Jul 2011
    Location: Houston, TX
    Search PM
    I transcoded again with the corrected filter, but didn't see much difference. Should I?

    Is this a good general policy to always deinterlace first before applying other filters?
    Quote Quote  
  23. I transcoded again with the corrected filter, but didn't see much difference. Should I?
    with your cropping values no.

    Is this a good general policy to always deinterlace first before applying other filters?
    yes, because cropping can destroy the interlace structure and produce lots of artifacts.
    -> in general:
    1st do color manipulations
    2nd do deinterlacing
    3rd do the rest
    Quote Quote  



Similar Threads