CrendKing / avisynth_filter

DirectShow filters that put AviSynth and VapourSynth into video playing
MIT License
107 stars 8 forks source link

Source PAR is not respected after frame size change #39

Closed chainikdn closed 3 years ago

chainikdn commented 3 years ago

looks like changes from https://github.com/CrendKing/avisynth_filter/commit/6a4951b9eddbe0cfb68078f8842b239feacecea6 were lost at some point

CrendKing commented 3 years ago

Version to reproduce?

chainikdn commented 3 years ago

any version you're just not using the old PAR value at all

CrendKing commented 3 years ago

I remember when I was reviewing your change, I theorized that someone put something like

return ColorBars(500, 300)

in the avs. I thought using script video's SAR as new DAR made sense.

Also, our results only differ if the original video's SAR is already different to the DAR in vih, i.e. newBmi->biWidth * newVih2->dwPictAspectRatioY != newBmi->biHeight * newVih2->dwPictAspectRatioX. You code would scale the DAR by the factor of new_sar / old_sar, while my code simply use new_sar. I don't have any video that meets the prerequisite, so I don't know if this is a right-or-wrong situation.

If you have any video and/or avs script that shows your logic makes more sense, I'm happy to change.

chainikdn commented 3 years ago

take a video with PAR != 1.0 imagine a script that does simple crop what will you see? https://github.com/CrendKing/avisynth_filter/issues/35#issuecomment-769769831

CrendKing commented 3 years ago

I generated a video which is 1280x720 with some absurd DAR like 5:1, plugin a crop function in avs. I can see your logic would scale the 5:1 DAR to the cropped frames, while my logic would lose that DAR. I think preserving the property of the original video is more important. I'll switch to your logic.

https://github.com/CrendKing/avisynth_filter/commit/a6508914481206aa98b812b1f2c51ab8419d00d2

AviSynthFilter.zip