jonataslaw / VideoCompress

Compress videos, remove audio, manipulate thumbnails, and make your video compatible with all platforms through this lightweight and efficient library.
MIT License
232 stars 283 forks source link

getFileThumbnail does not work for Android 10 #71

Open therealansh opened 4 years ago

therealansh commented 4 years ago

I am trying to pick a custom thumbnail for a video

Sample Code:

 thumbnailFile = await VideoCompress.getFileThumbnail(
      rawVideoFile.path,
      quality: 100, // default(100)
      position: _controller.value.position.inSeconds -1, // default(-1)
    );

This always picks up the default frame(the first frame) for Android 10 devices while for other devices it takes up the custom frame where the VideoController is. Any resolution to this?

Logs:

V/Engine  ( 9656): new step: 10322
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23219 encoderDeltaUs:23219 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10323
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): new step: 10324
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): new step: 10325
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): new step: 10326
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10327
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10328
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10329
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): getTrackProgress - readUs:240024671, totalUs:240327000
V/Engine  ( 9656): getTrackProgress - readUs:240024671, totalUs:240327000
V/Engine  ( 9656): progress - video:0.9987420098449197 audio:0.9987420098449197
V/Engine  ( 9656): new step: 10330
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10331
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10332
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10333
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): new step: 10334
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): new step: 10335
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): new step: 10336
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10337
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10338
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10339
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): getTrackProgress - readUs:240256870, totalUs:240327000
V/Engine  ( 9656): getTrackProgress - readUs:240256870, totalUs:240327000
V/Engine  ( 9656): progress - video:0.9997081892588016 audio:0.9997081892588016
V/Engine  ( 9656): new step: 10340
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): new step: 10341
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10342
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10343
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10344
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23219 encoderDeltaUs:23219 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10345
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10346
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10347
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/VideoFrameDropper( 9656): RENDERING - frameRateReciprocalSum:0.04
V/VideoDecoderOutput( 9656): New frame available
V/Engine  ( 9656): new step: 10348
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): new step: 10349
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): getTrackProgress - readUs:240320000, totalUs:240327000
V/Engine  ( 9656): getTrackProgress - readUs:240320000, totalUs:240327000
V/Engine  ( 9656): progress - video:0.9999708730188451 audio:0.9999708730188451
V/Engine  ( 9656): new step: 10350
I/AudioEngine( 9656): process - time stretching - decoderDurationUs:23220 encoderDeltaUs:23220 stretchFactor:1.0
I/AudioEngine( 9656): process - totalInputSize:2048 processedTotalInputSize:2048 outputSize:2048 inputSize:2048
W/AudioEngine( 9656): ensureTempBuffer1 - desiredSize:2048
W/AudioEngine( 9656): ensureTempBuffer2 - desiredSize:2048
V/Engine  ( 9656): new step: 10351
V/Engine  ( 9656): new step: 10352
V/Engine  ( 9656): new step: 10353
I/MPEG4Writer( 9656): Received total/0-length (6008/1) buffers and encoded 6008 frames. - Video
D/MPEG4Writer( 9656): Video track stopping. Stop source
I/MPEG4Writer( 9656): Received total/0-length (10348/1) buffers and encoded 10348 frames. - Audio
D/MPEG4Writer( 9656): Video track source stopping
I/MPEG4Writer( 9656): Audio track drift time: 0 us
D/MPEG4Writer( 9656): Video track source stopped
D/MPEG4Writer( 9656): Video track stopped. Stop source
D/MPEG4Writer( 9656): Audio track stopping. Stop source
D/MPEG4Writer( 9656): Audio track source stopping
D/MPEG4Writer( 9656): Audio track source stopped
D/MPEG4Writer( 9656): Audio track stopped. Stop source
D/MPEG4Writer( 9656): Duration from tracks range is [240303310, 240320000] us
D/MPEG4Writer( 9656): Stopping writer thread
D/MPEG4Writer( 9656): 0 chunks are written in the last batch
D/MPEG4Writer( 9656): Writer thread stopped
I/MPEG4Writer( 9656): Ajust the moov start time from 10 us -> 10 us
I/MPEG4Writer( 9656): The mp4 file will not be streamable.
E/Surface ( 9656): getSlotFromBufferLocked: unknown buffer: 0x0
D/SurfaceUtils( 9656): disconnecting from surface 0xb65af008, reason disconnectFromSurface
D/MPEG4Writer( 9656): Video track stopping. Stop source
D/MPEG4Writer( 9656): Audio track stopping. Stop source
uditswaroopa commented 3 years ago

Hello @jonataslaw I hope you are good, I am facing a similar issue. It would be great if you can look into this issue.