I need to make a video player that can gradually change playback speed from 0 to roughly 200%. It has to be performing very fast, as it will be playing HD movies recorded at high framerates (60 FPS). Lower resolution can be used if impossible to support HD.
The code only needs to run on relatively high end Android tablets with hardware h264 decoder, and ICS (no Jelly Bean available for the target tablets).
I have not found any support for changing video playback rate in the Android system, and I suspect I need to dig pretty deep into the JNI to get there, but would like to ask here first if anyone has some code, suggestions or pointers that can help me.
The capability of speeding up or slowing down the original speed of audio or video content.
To adjust the speed of a TV show or movie: Tap on a TV show or movie while it's playing. Select the speed icon and choose the playback speed.
I got android custom player from vitamio. In that, the media player have an option of setplayback speed. ie mMediaPlayer.setPlaybackSpeed(speed); Set video and audio playback speed Parameters: speed e.g. 0.8 or 2.0, default to 1.0, range in [0.5-2]
Please refer the link: http://www.vitamio.org/en/docs/news/2013/0529/19.html
I have been looking into doing something similar, and here are some of my findings that may be useful to you:
minSdkVersion = 14
, so it should work on your ICS devices.I tested this on the only ICS+ device available to me, a 16GB ASUS Nexus7 running 4.2 (Jellybean), and I got the following outputs in my log of note (omitting my own debug statements)
01-15 14:19:33.384: W/libOpenSLES(6037): class MediaPlayer interface 1 requested but unavailable MPH=75
01-15 14:19:33.384: W/libOpenSLES(6037): Leaving Object::GetInterface (SL_RESULT_FEATURE_UNSUPPORTED)
01-15 14:19:33.384: A/libc(6037): jni/native-media-jni.c:409: Java_com_example_nativemedia_NativeMedia_createStreamingMediaPlayer: assertion "XA_RESULT_SUCCESS == res" failed
01-15 14:19:33.384: A/libc(6037): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 6037 (ple.nativemedia)
in the function that loads up a media stream (or file) and creates the native mediaplayer instance. These errors quite pointedly indicate that the feature either isn't supported on my device/decoder, my OS or my file type. I'm not actually sure which one (or combination) it is, but if it's the first one, it probably means there aren't very many devices out there that will support the feature you want. Maybe the Nexus7 is an outlier, but that's still a sizable chunk of the tablet space, unfortunately, and means we can't expect much consistency in other devices.
If anyone follows these notes and has success in getting things to run, do comment - I will keep hacking away at this and try to get this working, and will update with any progress.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With