We use ExoPlayer version 'r2.4.4' to show videos from Giphy to users. It looks like sometimes a metadata of incoming videos is not correct. We use standard VideoListener to make our video fullscreen achieving "Center crop" effect. As a result, our videos appear "squeezed". The question is if there is a way to get actual video dimensions (because the video is shown correctly in ExoPlayer itself). Also, screenshots from MacBook file info showing correct dimensions of the same file are attached. Another screenshot shows Video debug panel of ExoPlayer demo app that shows incorrect dimensions (152x200) with a strange pixels ratio (1.73).
We use usual video listener to get width and height.
exoPlayer.setVideoListener(new VideoListener() {
@Override
public void onVideoSizeChanged(int width, int height, int unappliedRotationDegrees,
float pixelWidthHeightRatio) {
viewerSurfaceView.setVideoSize(height, width);
presenter.onVideoSizeChanged(width, height);
}
@Override
public void onRenderedFirstFrame() {
super.onRenderedFirstFrame();
exoPlayer.
}
});
https://media1.giphy.com/media/9aZ3Snou3bdlu/200.mp4
r2.4.4 (the same is for 2.6.1)
Sony Xperia z1 Compact, Android 5.1, Google Pixel Android 8.0, several AS emulators wit Android 6, 7
Bugreport captured on Android Emulator API 23 in ExoPlayer demo app
bugreport.txt


The video resolution really is 152x200 pixels, but the pixels are not square (indicated by pixelAspectRatio being not equal to 1). VLC also reports this resolution. You need to fix your code to take pixelAspectRatio into account. Note that:
(width * pixelAspectRatio) = (152 * 1.73) = 263
so the Macbook file info is actually showing the width in pixels multiplied by the pixelAspectRatio.
Most helpful comment
The video resolution really is 152x200 pixels, but the pixels are not square (indicated by pixelAspectRatio being not equal to 1). VLC also reports this resolution. You need to fix your code to take pixelAspectRatio into account. Note that:
so the Macbook file info is actually showing the width in pixels multiplied by the pixelAspectRatio.