Snowknight26
21st March 2009, 01:27
I have a 720p OAR HDTV cap and a 1080p non-OAR Blu-ray of a short video that I'd like to encode. The Blu-ray is higher bitrate than the HDTV cap so I'm going to encode that solely for the purpose of better archiving quality. The only issue is the mismatched AR.
What I'm trying to do is somehow find a way to dynamically/programatically resize my 720p HDTV cap so that when I Overlay() it ontop of the Blu-ray, it matches. From there, I want to crop the Blu-ray's video so that it becomes OAR and the finally resize down to 720p. This should make the final output look better than my HDTV cap and also have the same framing.
What I'm thinking is make a function that first resizes the video A (HDTV cap) up to match the size of video B (Blu-ray). It would take several parameters, such as best guess width, best guess height, best guess x-position, best guess y-position, and Overlay subtract tolerance. From there, some kind of loop resizes video A 1 pixel at a time using the parameters as a starting point, somehow calculate black levels of Overlay(mode=subtract), loop till the resulting overlay output returns the most black frame (not taking into consideration the parts of video B that haven't been covered by video A), then output that frame accordingly cropped and resized. From there, continue to the next frame. After its all done, resize to 720p. From what I can best determine, this should return video B cropped and resized to match the framing of video A - or so I'd like to hope.
I know it seems very cumbersome (at least for me), but I'm positive that it would be much faster than manually checking each frame, resizing in photoshop, finding the necessary resize/positions, etc.
If anyone has any helps on how to get started with this, a filter or combinations of filters that can already achieve this, or a completely different way at tackling this, I'd be very greatful. Any help at all is appreciated.
What I'm trying to do is somehow find a way to dynamically/programatically resize my 720p HDTV cap so that when I Overlay() it ontop of the Blu-ray, it matches. From there, I want to crop the Blu-ray's video so that it becomes OAR and the finally resize down to 720p. This should make the final output look better than my HDTV cap and also have the same framing.
What I'm thinking is make a function that first resizes the video A (HDTV cap) up to match the size of video B (Blu-ray). It would take several parameters, such as best guess width, best guess height, best guess x-position, best guess y-position, and Overlay subtract tolerance. From there, some kind of loop resizes video A 1 pixel at a time using the parameters as a starting point, somehow calculate black levels of Overlay(mode=subtract), loop till the resulting overlay output returns the most black frame (not taking into consideration the parts of video B that haven't been covered by video A), then output that frame accordingly cropped and resized. From there, continue to the next frame. After its all done, resize to 720p. From what I can best determine, this should return video B cropped and resized to match the framing of video A - or so I'd like to hope.
I know it seems very cumbersome (at least for me), but I'm positive that it would be much faster than manually checking each frame, resizing in photoshop, finding the necessary resize/positions, etc.
If anyone has any helps on how to get started with this, a filter or combinations of filters that can already achieve this, or a completely different way at tackling this, I'd be very greatful. Any help at all is appreciated.