Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoCropping is not working correctly.It is always cropping top of video(video is shot vertically in a portrait mode) #10

Open
islomov opened this issue Sep 25, 2020 · 4 comments

Comments

@islomov
Copy link

islomov commented Sep 25, 2020

No description provided.

@VivekThummar52
Copy link

Do you mean by camera video??

@Testify-hub
Copy link

Yes it's always cropping top of video.. Any help regarding this problem???

@VivekThummar52
Copy link

This will happens if video is recorded from camera(will not happens in every device and not with all manufacturers(smart phone) brand).. so basically it's not this project's issue, but still you can do a little thing -
If you print video Width and Height(like from cursor or somewhere else) it will print wrong value in your case but if you print the same but from MediaPlayer which you can get from videoView.setOnPreparedListener in onPrepared(MediaPlayer mp), you will get correct values..so you can pass this values in initBounds(...) method of class CropVideoView and refresh the view and i think it's done(as of i know because i'm not able to try more detailed test of this solution but you should try) (you might also needs to change more code in methods like - onSizeChanged(...) or specially in getCropRect()) and please let as know what will happens or possibly the Solution..

@Testify-hub
Copy link

I extract width and height like this
val videoWidth =
Integer.valueOf(
retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH)
.toString()
)
val videoHeight =
Integer.valueOf(
retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT)
.toString()
)
but videos that are capture from camera are not being cropped properly, only cropped from upside. Please help me out I check each and every thing but not getting it.. I am beginner to this plz help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants