no more cropping while watching tv in normal mode? (1 Viewer)

MPUserFromGER

MP Donator
  • Premium Supporter
  • July 31, 2006
    403
    3
    Germany
    Home Country
    Germany Germany
    I can confirm this. German TV stations need some cropping and with todays SVN it works again. No side effects for me.

    Thanks a lot, great job!
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    Hi!

    Sadly something is broken too.

    tontsa can confirm this as well.

    When showing a 16:9 anamorphic channel on a 4:3 display you get the video displayed as 4:3 .-- so the result is stretched persons = wrong AR.

    I tried reverting MP back to rev. 172 ..and all is dandy again.

    black bars at top and bottom should be applied in order to have the 16:9 anamorphic video being shown in correct AR.

    I've modified SVN.
    I hope nothing is broke.

    /Gibman
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    I've modified SVN.
    I hope nothing is broke.
    /Gibman

    Actually i think you did break something. The problem is that when you have big crop values the aspect ratio between the full video frame and the cropped video frame can be significantly different, and hence computing the destination rectangle based on the complete source frame will cause stretch distortion of the video.

    You wont see this much with small crop values, but if you use for example the autocropper (which will cut black bars out of letterboxed material) you will see it.

    Im sure the problem is that the way i calculated the cropped output frame ratio is wrong.

    I did it like this:
    float fCroppedOutputFrameRatio = ((float)croppedImageWidth / (float)croppedImageHeight) / PixelRatio;

    At the time i thought that the PixelRatio would adjust for anamorphic sources, but that maybe thats just the displays pixel ratio?

    So whats the correct way to calculate the outputFrameRatio from the cropped dimensions?

    Im pretty sure that if that single calculation is correctly adjusted the previous revision will work just fine.

    BTW: Im on holiday now, and dont have a development machine nearby, so i cant fix it myself (i wouldnt be able to compile or test it anyway).
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    As mentioned in my post below, the problem that was experienced with anamorphic was due to the cropped output frame ratio being calculated wrong because it didnt take the source pixel aspect ratio into account.

    I believe a simple fix is all thats needed (to Geometry.cs rev 15177).

    Instead of the code line in the previous post it should read this:

    float fSourcePixelRatio = fSourceFrameRatio / ( (float) ImageWidth / (float) ImageHeight);

    float fCroppedOutputFrameRatio = fSourcePixelRatio * ((float)croppedImageWidth / (float)croppedImageHeight) / PixelRatio;

    (fSourcePixelRatio is the aspect ratio of each pixel in the source.)

    As mentioned im on holiday and dont have a chance to test (or even compile) this change, so maybe someone else would be nice and do it?
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    Ok, the stuff is SVN.
    Look out for the changelog then test it.

    So far no probs here.

    /Gibman
     

    ziphnor

    Retired Team Member
  • Premium Supporter
  • August 4, 2005
    755
    13
    Copenhagen
    Home Country
    Denmark Denmark
    gibman, i think you applied my fix to the wrong SVN version as i can see that fCroppedOutputFrameRatio isnt used in the Normal zoom mode calculations (i discovered this as i got home from vacation to aspect incorrect cropping :)

    I corrected this, so hopefully now there is both aspect correct cropping and also no problems with anamorphic sources. Change included as of rev. 15728.
     

    puffin

    New Member
    September 14, 2007
    3
    0
    Home Country
    Scotland Scotland
    I wonder if this bug is the cause of the problems I reported here?

    Incidentally, by shutting down and restarting MP several times I can make it behave - very weird.
     

    Users who are viewing this thread

    Top Bottom