I am following ExtractMpegFramesTest post to extract PNG frames from video. This works fine with videos that are recorded in landscape mode but doesn't work with videos that are recorded in portrait mode.
Does anybody know how to generate PNG frames from portrait video using solution provided in above link ?
I have tested this with 720p and 1080p videos.
Couple of things i observed is,
MediaExtractor gives width and height 1280 and 720 of 720p video regardless of orientation. this should be 1280 x 720 in landscape and 720 x 1280 in portrait. simillar case in 1080p videos.
Other thing is when i pass false in the Method drawFrame in invert parameter, PNG frame is fine but upside down.
Edit:
With ExtractMpegFramesTest i'm getting this result
Landscape video with invert parameter true gives perfect Image http://postimg.org/image/qdliypuj5/
portrait video with invert parameter true gives distorted Image http://postimg.org/image/vfb7dwvdx/
portrait video with invert parameter false gives perfect upside down Image.(According to @Peter Tran's answer output can be fixed by rotating the Bitmap.) http://postimg.org/image/p7km4iimf/