-
Notifications
You must be signed in to change notification settings - Fork 117
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
Video is getting stretched in android 12 samsung A 52 device #72
Comments
Hello @a914-gowtham |
@PatelJa02 Could you share the code you used to open video trimmer activity.
|
TrimVideo.activity(fileUri.toString()) |
@PatelJa02 looks like you pass static height and width cause this issue. could you try following snippet. default compress option will use framerate=30, bitRate=1M, TrimVideo.activity(fileUri.toString())
.setTrimType(TrimType.MIN_MAX_DURATION)
.setMinToMax(15.toLong(), 60.toLong())
.setCompressOption(
CompressOption())
.start(this, startForResult)
|
Sure Let me do it and then give you the update |
@a914-gowtham The above code is working fine but the problem with the code is when I record the video of 59 seconds the size of the trimmed video will remain around 100 MB which is throwing out of the memory during the API upload so I need the video size almost near to 1 or 2 MB(Max 7 MB). Can you please help? |
@PatelJa02 You can try this. but, I'm not sure about the compressed video quality. val list= TrimmerUtils.getVideoWidthHeight(this, fileUri.toString()) // will return width and height in a list [width,height]
log.d("TAG","Video width $list[0]")
log.d("TAG","Video height $list[1]")
val reducedWidth= list[0]/3 //check the video size after trimming it. if it is still large try increasing the 3 to 4 and more
val reducedHeight= list[1]/3 //. do the same like width
TrimVideo.activity(fileUri.toString())
.setTrimType(TrimType.MIN_MAX_DURATION)
.setMinToMax(15.toLong(), 60.toLong())
.setCompressOption(
CompressOption().apply {
frameRate = 30
bitRate = 1M. //you can try changing bit rate between 500k to 900k
width = reducedWidth
height = reducedHeight
})
.start(this, startForResult)
|
Thanks for the code, I have checked the above code but again the video is stretched. even tried different alternations with the width and height but still the same. |
Hello @a914-gowtham I have applied the below code and the video is not stretched in the android 11 Samsung A50 device but it's stretched in the android 12 Samsung A52 device. val list= TrimmerUtils.getVideoWidthHeight(this, fileUri.toString()) // will return width and height in a list [width,height] TrimVideo.activity(fileUri.toString()) |
No description provided.
The text was updated successfully, but these errors were encountered: