If I was to resize a 1080p video while masking it, I'd definitely resize to 1280x? first, then add the borders for 1280x720. It'll take a bit more calculating to get it right, but resizing 1080p video that already has black borders will almost certainly result in the edge of the picture and the edge of the black borders being a little blurred, rather than nice and sharp. If the 1080p video already had black borders I'd crop them, resize to 1280x?, then add them back for 720p.
I've read complaints about borders not encoding completely "clean" too. ie a few rows of pixels at the edge of the video and/or a few rows of black pixels blur a little. I don't know if the mod makes any difference to that as I almost never encode with black borders myself. I know from previous tests the borders make little difference to compression efficiency.... well it barely changes the bitrate when using CRF encoding, so assuming CRF does always produce a constant quality with identical settings.....
Encoding a couple of hours of black on it's own only results in a video of a few MBs in size.
As this thread seems to be to discussing theoretical storms in teacups, I thought I'd try a few test encodes.
I took a 1920x804 video and cropped it to a height of 128 pixels like this:
crop(0, 672, 0, -4)
I added mod16 borders to begin with, then moved the picture up a little for each encode while making note of the resulting bitrates after encoding 10,000 frames with x264's default settings and CRF18.
AddBorders(0,64,0,64) (mod16 borders)
825 kbps
AddBorders(0,62,0,66) (mod2 borders)
860 kbps
AddBorders(0,60,0,68) (mod4 borders)
835 kbps
AddBorders(0,56,0,72) (mod8 borders)
801 kbps
No Borders
774 kbps
Source (Avisynth output before encoding, no borders)
It's interesting that compared to mod16 borders, the mod8 borders actually caused the bitrate to drop. I suspect it's related how much motion the encoder sees, but that's just a guess because I don't understand it. I think that was originally one of the reasons cropping was recommended in the early days, because the borders messed with motion estimation or something along those lines, but it doesn't seem to make much difference for x264.
The bitrate differences in these tests are probably greater than they'd be under normal circumstances, where the ratio of picture to black would be far higher.
My personal confabulation: Mod2 borders might require a slightly higher bitrate than mod4 borders, but none of it really matters.
Can anyone explain the mod8 bitrate drop?
Edit: While I was at it, I thought I'd try another round of encodes, but this time I cropped 2 pixels less from the source to make the output 130 pixels high (mod2), before adding the same borders.
Crop(0, 670, 0, -4).AddBorders(0,64,0,64) - 885 kbps (mod16 borders)
Crop(0, 670, 0, -4).AddBorders(0,62,0,66) - 834 kbps (mod2 borders)
Crop(0, 670, 0, -4).AddBorders(0,60,0,68) - 866 kbps (mod4 borders)
Crop(0, 670, 0, -4).AddBorders(0,56,0,72) - 801 kbps (mod8 borders)
Crop(0, 670, 0, -4) # No borders - 914 kbps
Interesting.... adding borders always reduced the bitrate a little when the video was mod2, compared to increasing it when the video was mod16.
I'd still like to understand the bitrate drop due to mod8 borders, but it still seems none of it really matters
+ Reply to Thread
Results 31 to 37 of 37
-
Last edited by hello_hello; 11th Nov 2016 at 19:47.
-
The thing is Avisynth is not part of my workflow for 1080p delivery, and I am not about to insert it for such mundane tasks like masking. I only call on Avisynth when one of its filters has an edge over an NLE like when I need to deliver 720p because the bundled resizers in commercial NLEs are usually not very good. My thinking was import the letterboxed 1080p export into Avisynth, crop the letterbox (since I know its exact dimensions), then downrez before adding borders to bring back to full 720p. That, I think, would produce acceptable results unless the resizing filters choke on some non-standard resolution.
At some point I will get a chance to test all this and come up with a vetted workflow. -
-
Why to avoid it, one lossless avi (if frame serving is not possible or avoided), no masking yet, rest in avisynth, masking is just really easy using crop and then addborders, this is for 2.35 AR > needs height 544 for 1280:
Code:Avisource("1920x1080.video.avi") Spline36Resize(1280,720) Crop(0,88,0,-88) AddBorders(0,88,0,88)
Code:Crop(0,72,0,-104) AddBorders(0,72,0,104)
If you mask it in NLE, not using Avisynth, numbers start to flow differently after resizing, so you need to calculated it twice and for 1280x720 image you need to mask differently to get your desired macroblock 8 and keep ar 2.35 in both casesetc., but I think it does not matter really.Last edited by _Al_; 11th Nov 2016 at 19:17.
-
I looked at a few theatrical films that are online and compared them side-by-side with my own mask since I have a dual monitor setup. What I quickly found is that the height seems to be all over the map. There is clearly not one agreed upon AR when encoding.
-
Anybody can crop it a bit differently and also all movies are not the same. But there is a pattern. Example of bunch of 25 movies or so I did myself from BD , resized to 720p and auto-cropped, mode 4:
1280x532-12 times
1280x536 -6 times
1280x640 - 1 time
1280x692 - 3times
1280x720 - 2 times
so movies does not always have the same aspect ratio, any of that height result matches some aspect ratio, but I would not bother, it really does not matterLast edited by _Al_; 12th Nov 2016 at 17:34.
-
Thanks for posting. That is a very interesting result and probably more accurate than my survey. Since 1280x532 is the most common choice, this implies that 2.40:1 is the most common AR which makes sense since 532 is mod4 while 534 is only mod2. Masking to 1280x532 is also equivalent to masking to 1920x798, but 798 is only mod2. Therefore, it looks like one needs to mask twice if delivering both 1920 and 1280.
Similar Threads
-
1280x720 OR 1920x1080
By aruwin in forum Video ConversionReplies: 10Last Post: 29th Sep 2015, 08:50 -
1920x1080 vs full screen in VLC Media player on 1920x1080 screen
By Circlotron in forum Software PlayingReplies: 4Last Post: 17th Apr 2015, 06:16 -
Projecting 1920X1080 video
By Saramack in forum Latest Video NewsReplies: 23Last Post: 24th Jun 2014, 20:59 -
Cropping AVI 4:3 to 16:9 need software that allows floating cropping area
By tonyclem in forum EditingReplies: 11Last Post: 26th Nov 2012, 06:48 -
1920x1080 playback
By Intel Core i7 in forum Software PlayingReplies: 6Last Post: 5th Jul 2012, 20:13