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
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in VIDEO
- How to open and read video stream in Matlab
- Extract bytes of specific stream from mpegts file using ffmpeg
- AVQueuePlayer crashes when I try to observe the start of the next video: AVPlayerItem was deallocated with observers
- How to get the time stamp of each frame of a GoPro video in MATLAB?
- DFP Videos Ads Internal error
- Get youtube video information using javascript and Youtube-API
- YouTube views not counting on Wordpress embed
- Videos not working on phones using HTML
- How to track multiple youtube videos in google analytics
- Cloudfront stream only part of the video
- Changing switch statement to include both mp4 and ogg files
- How to detect squares in video with OpenCV?
- Saving iOS video buffer
- dynamic video source change issue in azure media player
- Video Editing For Android
Related Questions in GIF
- C++ Qt How do you make a label display a movie (gif) that you created using the form?
- How can I add a transparent tkinter image in Python 3.3.2?
- How can I convert PNG to GIF keeping the transparency?
- How to display an animated GIF?
- Tracing out the motion of a double pendulum in gnuplot (and gif conversion)?
- How to resize gif with standard php functions without losing the animation
- What is the most efficient method to make gifs from images using PHP?
- Put a gif in JOptionPane
- Getting path of local image instead of URL Android
- Display animated .gif from URL in JLabel
- Show GIF file with Glide (image loading and caching library)
- Why there's some "noise" around the edge of my loading gif on my website?
- Change Contact Form 7 "SUBMIT" text with animated gif AFTER clicked
- swift Export CAShapeLayer animation to gif
- How to implement animated mask in SVG animation
Related Questions in ANDROID-MEDIACODEC
- Android AudioTrack extremely slow on some devices
- Android audio too fast on some devices with MediaCodec and AudioTrack
- Converting ByteBuffer obtained from Mediacodec to a bitmap to store it in SD card
- How to compress mp4 video using MediaCodec Android?
- Will all phones support YUV 420 (Semi) Planar color format in h.264 encoder?
- How to drop frames while recording with MediaCodec and InputSurface?
- Extract a specific portion of video using MediaExtractor
- Android decoder dequeueOutputBuffer returns -1
- Unable to transcode audio via Android MediaCodec API
- Render Android MediaCodec output on two views for VR Headset compatibility
- Configure MediaCodec with the proper MediaFormat from a raw H.264 byte buffer
- Android Media Codec: How long does it take to decode and display one video frame
- Which AVC profile/level will be set in Android MediaCodec if we don't set this value manually?
- Android camera encoding through OpenGL
- Color Banding Playing Live Raw H.264 Stream In Android
Related Questions in TEXTUREVIEW
- Android - rendering same video on Multiple views
- How do I draw Bitmap on TextureView
- TextureView keeps getting SIGSEGV 11
- Render Android MediaCodec output on two views for VR Headset compatibility
- Android TextureView / Drawing / Painting Performance
- Play Videos in a Listview
- Color Banding Playing Live Raw H.264 Stream In Android
- Play video in Android listview
- How to take snapshot of RTSP streaming using LibVLC for Android
- Android: playing many video simultaneously
- why my video doesnot fit the size of the texture as i change the size of the texture
- Many video players using TextureView with MediaController in one fragment
- SurfaceView vs TextureView for Camera?
- Glass camera preview display is garbled
- TextureView throwing fatal signal 11 after resuming application
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 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.