VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 37
  1. I have read that 2.35 content is 1920x817. But I find the odd height, well, rather odd. So I was wondering what to mask to assuming that x264 and others will choke on odd macroblock sizes for both the resulting image and letterboxes. I am thinking 1920x816 since 816 is mod4.
    Last edited by SameSelf; 11th Nov 2016 at 14:53.
    Quote Quote  
  2. Originally Posted by SameSelf View Post
    I have read that 2.35 content is 1920x817. But I find the odd height, well, rather odd. So I was wondering what the recommended crop is assuming that x264 and others will choke on odd macroblock sizes. I am thinking 1920x816 since 816 is divisible by 4.
    It may not work - i see that ffmpeg with libx264 crashing when video size is not modulo 32 - lot of cinematic movies has 1920x800 or lower resolution (just checked Wonder Woman 2 cinematic trailer on YT and it is even less than 800 lines).

    Code:
    @ffmpeg -skip_frame nokey -y -hide_banner -stats -i "%1" -vf cropdetect -an -vsync 0 -f null -
    Quote Quote  
  3. Originally Posted by pandy View Post
    It may not work - i see that ffmpeg with libx264 crashing when video size is not modulo 32
    Even BluRay (1920x1080) isn't mod32 - not even mod16, actually. x264 shouldn't have any obvious bugs like that. You can encode anything the colorspace allows (usually mod2 for progressive 4:2:0 YUV or even mod1 for RGB).
    Quote Quote  
  4. Originally Posted by sneaker View Post
    Originally Posted by pandy View Post
    It may not work - i see that ffmpeg with libx264 crashing when video size is not modulo 32
    Even BluRay (1920x1080) isn't mod32 - not even mod16, actually. x264 shouldn't have any obvious bugs like that. You can encode anything the colorspace allows (usually mod2 for progressive 4:2:0 YUV or even mod1 for RGB).
    Yes, i know but well - this is what i receive - ffmpeg crash always when there is 1920x816 and never on 1920x800 - this may be related to way how ffmpeg is compiled (i use https://github.com/jb-alvarado/media-autobuild_suite to build ffmpeg ) or it may be related to machine i use for this work (Dell Precision T5500).
    Somehow, somewhere this happen and there is no information about reason - just popup with crash info (but didn't dig to deep into it).
    Quote Quote  
  5. Originally Posted by SameSelf View Post
    I have read that 2.35 content is 1920x817.
    Heard? Why don't you just do the math? 1920 / 2.35 = 817.021...

    Of course, YV12 video must have even frame sizes. And some older hardware has problems with mod2. So it's safer to stick with mod4, mod8, or greater.
    Quote Quote  
  6. Thanks guys. I don't have a lot of experience with cinematic films, so I don't know what the "average" horizontal resolution is. But it sounds like most use 800 lines or less? That is a little surprising as well. I remember listening to a Scott Wilkinson podcast a while ago where he interviewed a Hollywood encoder who mentioned they always crop to a even macroblock size, but I don't recall if he said exactly how many lines. I may load up the handful of BRs that I have to see what the typical AR is. But if 1080 is mod8 then that is strange that 816 causes crashes since it is mod16.
    Quote Quote  
  7. Originally Posted by jagabo View Post
    Heard? Why don't you just do the math? 1920 / 2.35 = 817.021...
    Apparently, my question was a little too nuanced for some
    Quote Quote  
  8. Originally Posted by pandy View Post
    Yes, i know but well - this is what i receive - ffmpeg crash always when there is 1920x816 and never on 1920x800
    I don't think your obscure ffmpeg problem has much relevance to this thread. I have zero problems encoding 1920x816 using either ffmpeg+libx264 or x264cli.
    Quote Quote  
  9. A 2.35 aspect ratio movie tends not to end up exactly 2.35 when transferred to Bluray (the same applies to any aspect ratio), or centred exactly, so the question's a little redundant. You'd just crop till the black is gone, then maybe crop a tad more if you prefer mod4 or mod8 etc.

    I don't know about anyone else but I often find there's a few of lines of crud down each side I prefer to remove, so I'd end up cropping to 1916x816 or 1912x816 etc anyway. It does kind of ruin any 1:1 pixel mapping on a 1080p screen though, unless you disable any resizing in your player's settings, or you could use AddBorders() to at least make the sides "clean" and the width 1920 again, but we'll all be upscaling to 4k eventually so it probably doesn't matter. Personally I rarely encode at 1080p so I'd probably encode 2.35:1 at roughly 1600x680 or 1280x544, or somewhere in between, depending on the amount of picture detail.

    I used to crop the width to mod4 and height to mod2 (PC mod2 playback issues seem to relate to the width) but over the years jagabo has made me paranoid so now I crop both to mod4.

    Originally Posted by jagabo View Post
    Heard? Why don't you just do the math? 1920 / 2.35 = 817.021...
    I thought the same thing. It seemed an odd question.
    Last edited by hello_hello; 9th Nov 2016 at 11:20.
    Quote Quote  
  10. Originally Posted by sneaker View Post
    I don't think your obscure ffmpeg problem has much relevance to this thread. I have zero problems encoding 1920x816 using either ffmpeg+libx264 or x264cli.
    Obscure or not, mine or perhaps someone else - may happen then perhaps will be useful to mention it - that's why i provided this information.
    Quote Quote  
  11. Most aren't 2.35:1 anyway, but more like 2.39:1.
    Quote Quote  
  12. 2.40:1 or 1920x800. Looks like that is the "official" AR for BR, at least according to wiki:

    https://en.wikipedia.org/wiki/Aspect_ratio_(image)

    EDIT: And this makes sense as it was not just the frame that was important (when I recall the podcast) but the letterbox as well. 800 lines means 140 lines for the letterboxes. Thus the letterbox is mod4, and that was also mentioned as important.

    Just appending this list for info of aspect ratios that are at least mod4 and resulting letterbox size, its modulo, and the AR:

    1920x796 mod4 142 mod2 2.412:1
    1920x800 mod32 140 mod4 2.4:1 (exact)
    1920x804 mod4 138 mod2 2.388:1
    1920x808 mod8 136 mod8 2.376:1
    1920x812 mod4 134 mod2 2.365:1
    1920x816 mod16 132 mod4 2.353:1
    1920x820 mod4 130 mod2 2.341:1

    It is interesting that if one were to choose the summed mods maximum, it would be 800 lines.
    Last edited by SameSelf; 11th Nov 2016 at 07:06.
    Quote Quote  
  13. Right, when I mentioned 'most' I was referring to the films as shown in the theaters. It makes sense that they'd become 2.40:1 for Blu-Ray because of 'mod' requirements.
    Quote Quote  
  14. I don't follow that logic. If the letterbox is only mod4 then the active picture will not be on mod32 borders. It starts where the black border ends, i.e. on mod4. H.264 cannot start a new 16x16 macroblock "grid" - it is fixed.
    Quote Quote  
  15. How would you do it then, if 2.39:1 gives you an 803.347 height? Nothing even remotely close to the real aspect ratio gives you Mod16 for both active picture height and the black bars. Yes, you could 'juggle' some of the black bar heights so they're not the same on both top and bottom and so they're both Mod16, but, apparently, the powers that be didn't want to do that. So what if you lose a little bit of encoder efficiency? it's not such a big deal, is it?
    Quote Quote  
  16. I don't bother with mod4/8/16. I crop the black bars away to mod2.
    Quote Quote  
  17. Originally Posted by SameSelf View Post
    2.40:1 or 1920x800. Looks like that is the "official" AR for BR, at least according to wiki:
    I don't see where it says that. There's no such thing as an official Bluray aspect ratio that I know of (aside from 16:9 etc). Pictures end up on Bluray using all sorts of aspect ratios. Wikipedia says the most currently used anamorphic Cinema aspect ratio is 2.39:1 and that's rounded to 2.40:1 for Bluray, but I didn't see where it says it's the "official" aspect ratio for Bluray.
    1.85:1 is still a quite common aspect ratio and there's plenty of it on Bluray.

    Looking through some encodes I found examples I'd cropped to approximately 1.85, 2.35, 2.40, & 2.76 (Hateful Eight). Granted 2.35 was harder to find than 2.40, so it's probably not as common.

    I'm not sure I understand the point of this thread. Don't you just crop till the black is gone, crop a bit more for for a particular mod if you want to, then encode? It is what it is.
    Quote Quote  
  18. I guess I wasn't clear enough. I am not cropping away an existing letterbox to isolate the image. This is my own footage and for aesthetic reasons, I am technically masking off a 1920x1080 image to mimic theatrical releases. So I can mask off whatever floats my boat, I suppose. But I wanted to know if there was a recommended AR.
    Quote Quote  
  19. Clear enough? You weren't clear at all. The correct AR is the one for which you composed the shots making up the video. If you think you can crop it to any old aspect ratio, I'd say you didn't think it out well enough in advance and you'll wind up with either wasted space or cramped compositions or both at different times. 2.39:1 'theatrical releases' are composed for 2.39:1 (usually). You don't shoot first and decide later.
    Quote Quote  
  20. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    We don't even know where this footage is destined to go. If it's just going to sit on your computer forever or if you want to distribute it via Bluray and make it Bluray compatible.
    Quote Quote  
  21. The final encode will be FHD, but masked to a theatrical AR.
    Quote Quote  
  22. Delivering to 1280x720 raises an interesting wrinkle. For 1920x800 with 140x2 letterboxing, the equivalent 2.4:1 AR for a 1280 wide picture is 533.3 pixels. 804 lines results in an even 536 lines. Similarly, 816 lines results in 544 lines. Therefore, KarMa raises a valid point that if one wants to preserve maximum compatibility across all formats, then masking to either 804 or 816 lines is probably best. I think I like 816 better because it is at least mod4 in the letterboxes. Obviously I have the flexibility to choose because I am masking off a 16:9 image versus trying to crop a feature film with existing letterboxes.
    Quote Quote  
  23. I don't think there's a law making it illegal to mask the 1080p and 720p versions slightly differently, if you want mod4 borders.

    Unless you're encoding for Bluray compatibility I wouldn't encode the black borders, just crop, and for Bluray compatibility there doesn't seem much point resizing to 720p.

    Why not make a 1080p Bluray version with black borders and 1080p/720p stand-alone files without the black border nonsense? Does it matter if the aspect ratio for each differs by a few pixels?
    Quote Quote  
  24. Cropping or adding black bars does not change aspect ratio, I quite do not understand this thread.

    To crop and get rid of letterbox from 1920x1080 , crop top and bottom to have desired mod.

    To crop existing weird height, crop as you wish to get desired mod. If trying to get desired height for macroblocks in black parts and image part as well (creating letterbox), say 8, do so then, So top black part height is divisible by 8, image by 8 and bottom by 8 as well. But then you'd perhaps need to crop too much (140+800+140 = 1080). I think there was some discussion about that in here before, decision was something it does not matter much. Sure theory would tell you it is important, but perhaps negligible.
    Quote Quote  
  25. I don't know why this thread is confusing so many. I explained my motivations already, but I will try to explain my workflow one more time. And it looks like I need to edit the thread title.

    1. I shoot 1920x1080 16:9 footage.
    2. For aesthetic reasons, I want to conform the 16:9 image to something between CinemaScope and anamorphic widescreen in post. I am not picky here. However, I am just masking the image with black letterboxes, not technically cropping. I incorrectly called it cropping because that is what I am doing to the asset in the NLE timeline. But the timeline remains 1920x1080.
    3. I want letterboxes that are at least mod4 and a resulting image that is also at least mod4.
    4. The final encode will still be 1920x1080, but letterboxed.
    5. Lastly, I need to think about compatibility for 1280x720 which is 16:9, thus requiring letterboxes as well. I am not going to go into the reasons I deliver 1280x720 footage as I don't want to hijack my own thread.
    Quote Quote  
  26. Others have pointed out that 1920x1080 is only mod8, so it is not compatible with 16x16 macroblocks. Interestingly, 1280x720 is mod16. So how should one mask off a 1080 image if you want to preserve 720's mod16 potential? Masking 1080 to an 804 high image results in 1280x536 which is only mod4. Masking to 816 results in 1280x544 which is only mod8. So, what is the nearest mod16? Well, that would be either 1280x560 or 1280x528, which are equivalent to 1920x840 and 1920x792 respectively. These are at least mod8 in both the image and the letterboxes. The resulting aspect ratios are 2.42:1 and 2.29:1. However, neither one of these conforms to a known theatrical aspect ratio.
    Quote Quote  
  27. Mask it two times. Once for 1920x1080 and export, second time for 1280x720.

    Two scripts, so second one for example is resize to 1280x720, where masking follows to desired heights (black bars and image), not the other way. Do not mask in NLE.

    Similar problem occurs while autocropping in Avisynth script and resizing for example. Where it is better to resize first from 1920x1080 to 1280x720 and only then to autocrop using desired mod. Otherwise some insane calculations and dirty business is happening.
    Quote Quote  
  28. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Originally Posted by SameSelf View Post
    Others have pointed out that 1920x1080 is only mod8, so it is not compatible with 16x16 macroblocks. Interestingly, 1280x720 is mod16. So how should one mask off a 1080 image if you want to preserve 720's mod16 potential? Masking 1080 to an 804 high image results in 1280x536 which is only mod4. Masking to 816 results in 1280x544 which is only mod8. So, what is the nearest mod16? Well, that would be either 1280x560 or 1280x528, which are equivalent to 1920x840 and 1920x792 respectively. These are at least mod8 in both the image and the letterboxes. The resulting aspect ratios are 2.42:1 and 2.29:1. However, neither one of these conforms to a known theatrical aspect ratio.
    My understanding is that those mod16/8/4/2 only affect the very top and very right of the screen, and how big those blocks can be. The rest of the picture should have up to 16x16, no problem. Mod16 has about the best efficiency advantage of around ~1% over the others. Hope someone can come in and fill in the details but this is pretty much a non-issue, unless for device compatibility.
    Quote Quote  
  29. Originally Posted by SameSelf View Post
    5. Lastly, I need to think about compatibility for 1280x720 which is 16:9, thus requiring letterboxes as well. I am not going to go into the reasons I deliver 1280x720 footage as I don't want to hijack my own thread.
    I would have thought explaining why would just be considered good manners when you're asking for help.
    There's generally no reason to add borders to 720p content if you're already doing so for Bluray compatibility with 1080p, as providing a lower resolution Bluray version doesn't seem to make sense, so what's the 720p version for?
    Quote Quote  
  30. Originally Posted by SameSelf View Post
    3. I want letterboxes that are at least mod4 and a resulting image that is also at least mod4.
    So use the Letterbox filter to cover the video with black so your requirements are met. What could possibly be the problem here? Why are you wasting people's time with this insignificant issue?
    Quote Quote  



Similar Threads

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