I am developing a chat and we have high quality emoticons with extension mp4 (file size of about 300kb). GIF format is not used because of the poor quality and limited colors (256).
I need to display the files in the ListView as cyclic video.
Now I'm trying to do this using TextureView and MediaCodec classes.
Sources can be found at https://github.com/google/grafika.
The problem is that when you try to play more than 4 video simultaneously, an error occurs
IllegalStateException at android.media.MediaCodec.dequeueOutputBuffer.
I think this happens because of the large memory consumption,
on my device (HTC ONE M7) while playing four videos, the processor is loaded more than 60% !
How can I solve this problem? Maybe I need to use third party codecs?
Or the idea of using video to display smileys is bad and I need to give it up and use something like GIF ?
Android: playing many video simultaneously
1.2k Views Asked by Dmitriy Puchkov At
1
There are 1 best solutions below
Related Questions in ANDROID
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in VIDEO
- Media player stops about every 5 minutes
- Video Format is not supported or source is unavailable. - Opera
- How to get text and other elements to display over the Video in Tkinter?
- Can I use local resources for mp4 playback?
- Merge (concat) all video file present in '43. DP (Part1)' and put it into '43. DP (Part1)' and give name merged (concat) file to folder name
- Google Chrome is consuming a lot of CPU on a video call?
- How do I automate a video download with Selenium and Python (Meta Quest Store Trailer Download)
- Safari skipping 5 seconds into react-player video - anyone have experience with this?
- Why is toDataURL() returning blank image? (with p5 video)
- How do I circular crop using matlab?
- Cannot find 'IsacCodec' in scope
- playing multiple videos with libvlcsharp on multiple monitors
- Video controls are hidden behind input feature?
- Anyone around Good at both Javascript and Youtube api?, I am using lite-youtube js and I am confused in adding an eventlistener for onStateChange
- videos are resizing themselves while scrolling
Related Questions in GIF
- How to put a gif in a program
- SharePoint - Successfully adding GIFS to a thumbnail in a modern page news article
- Playing gifs bug in flutter
- Is there a way to create a GIF from network images in flutter?
- Java swing problem transparent animation gif
- Animation of geom_circle in ggplot2 displays unintentional interpolated circles
- Desynchronizing GIFs
- Start a Gif on Hover
- How to get an IP address and IP based location of another computer/user embedded on a gif without asking the users permission using javascript?
- How to Adjust Frame Delay for Each Image in Swift when Generating a GIF?
- gif tumbnails goes blank after upload and when used they are still blank
- Can't Detect Gif Selection From TextInput In React Native
- Memory leak issue trying to combine [UIImage] to single GIF image
- Create gif from tiff images and preserve resolution using PIL
- Using saveGif with graphics object in p5.js?
Related Questions in ANDROID-MEDIACODEC
- Android mediacodec avc/h264 encoder always produces 1MB output buffer size
- Encoding bitmap to video using MediaCodec and Kotlin
- Android record video from multiple cameras and composite the multiple videos into one video
- How to set Mode of H263 when use MediaCodec in Android?
- MediaCodec Pcm to Aac, missing the last 50ms of data
- How can I convert output buffer of MediaCodec into OpenCV Mat?
- Android media codec: Mismatch between encoder and decoder buffer sizes
- How to check whether a decoder in Android support dolby vision video?
- android pause/resume video decoder implemented by MediaCodec
- Using MediaCodec to trim causes black frames when advancing encoder to reach newStartAt time
- MediaCodec Async mode with NDK not triggering callback functions
- Audio File Conversion by Encoding and Decoding using MediaCodec in Android
- Differences in Performance: MediaCodec in Kotlin vs NDK
- .NET MAUI Android how to transcode the video resolution to 720p to reduce the upload time to server
- Android: Get native HardwareBuffer Format (ImageFormat.PRIVATE)
Related Questions in TEXTUREVIEW
- Play same video on multiple views on Android
- Using Hardware acceleration in different fragments
- TextureView.getSurfaceTexture() returns null
- ExoPlayer always automatically stops when playing videos
- Is it possible to synchronize the content draw by OpenGL and the position of a View in Android?
- Max texture views accessible per fragment shader in wgpu-rs
- Play multiple videos at the same time using TextureView in Android programmatically
- Synchronization of Android Views on top of GLSurfaceView
- Rendering frames from a webcam to a DirectX 11 texture
- Is it a good practise in Android to update a flow from an activity class and consume it in non-activity class?
- Playing video after another video on textureview
- Display android.graphics.Bitmap constantly in TextureView
- Use TextureView programmatically with ExoPlayer?
- How to display SurfaceTextures on a TextureView in android
- Can not take texture view screenshot in android
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There is a limit on the number of simultaneous decoders, if for no other reason than at some point you'll exceed the maximum bandwidth of the hardware. On some devices I've seen it switch to software decoding after two hardware decoders are configured. AFAIK there's no enforced behavior here.
One possible solution to your problem is to have a single multiplexed video, where you have all of your emoticons in a single .mp4 file. Play that into a SurfaceTexture, which is then used as a "sprite sheet". This approach requires that all animations have roughly the same number of frames, so you may have to adjust some or just pad out the sequence.
Update: according to this link, the 'M' release is scheduled to add
MediaCodecInfo.CodecCapabilities.getMaxSupportedInstances(), which provides "a hint for the max number of the supported concurrent codec instances." Doesn't really help with your issue, but at least it'd give you a number. Hopefully the API will take the video resolution(s) into account.