a914-gowtham / android-video-trimmer

Helps to trim local videos with compress option on Android applications using Exoplayer 2 and FFmpeg.
Other
380 stars 117 forks source link

Preview not working in some devices in larger videos #59

Open felipesangiorge opened 3 years ago

felipesangiorge commented 3 years ago

I'm trying to trim some videos more than 200 mb but in my Pocophone F1 (Xiaomi) it never shows the preview, i always receive an error in the Exoplayer -> E/ExoPlayerImplInternal: Playback error com.google.android.exoplayer2.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/hevc, hvc1.1.6.H153.B0, -1, null, [3840, 2160, 59.947292], [-1, -1]), format_supported=YES

Any idea of what causing it and how to solve it?.

a914-gowtham commented 3 years ago

@felipesangiorge Can you share the filepath of the video and the video file. so, I can try to reproduce it

felipesangiorge commented 3 years ago

Hello @a914-gowtham sure the path is always -> file:///storage/emulated/0/Android/data/com.mypackage.mypackage.dev/files/TrimmedVideo/trimmed_video_2021_6_30_18_5_11.MOV

the file i shared in a drive -> https://drive.google.com/drive/folders/18qRqgD64oDKQuK72HayGZygCfKO74vwV?usp=sharing

Valuable information is some points -> This doesn't happen with small-sized videos minus than 100mb for example ( Always work) If you kill the instance and open again the error didn't appear, for example, i selected to trim that video the first time opening the app with a fresh install, and worked. If you try to trim again the same video it doesn't show the preview (The video preview is black and i receive the error). If i uninstall and install again the app, it works at the first try. I was search things related to exoplayer on the internet, they recommend to release the player when we are leaving the fragment, so this is a possible solution for it. *It never happen with my samsung s20.

a914-gowtham commented 3 years ago

this error was in the <1.7.0 versions. can you share file path of the video too which you pass in the TrimVideo.activity(String.valueOf(videoUri)) and the library version

felipesangiorge commented 3 years ago

Hello, @a914-gowtham sorry for the late answer didn't have too much time yesterday. The version that im using is -> implementation 'com.github.a914-gowtham:Android-video-trimmer:1.7.1'

And the path of the file is -> content://media/external/video/media/96635

Like I said always work on the first try.