On Thu, Jun 23, 2011 at 3:51 AM, Miguel Morales <therevolti...@gmail.com>wrote:
> I wouldn't bother trying to split up the video content. > MediaPlayers should have no problem streaming the data from the file just > like it can stream from a url. > > I've never done it before, but make sure you are using the API correctly. > Read: http://developer.android.com/guide/topics/media/index.html > > Call prepare() before start(). Also, notice how you can specify a file > descriptor directly: > http://developer.android.com/reference/android/media/MediaPlayer.html#setDataSource(java.io.FileDescriptor,%20long,%20long)<http://developer.android.com/reference/android/media/MediaPlayer.html#setDataSource%28java.io.FileDescriptor,%20long,%20long%29> > > It is pretty annoying answering questions for outsourced developers, seeing > as we're losing jobs to much less competent people. > > On Wed, Jun 22, 2011 at 2:09 PM, Spooky <spooky1...@gmail.com> wrote: > >> On Jun 22, 9:55 am, NaveenShrivastva >> <kumarnaveen.si...@gmail.com> wrote: >> >> > > >>> > when i am trying to play large video then getting >> > > >>> > exception outofmemory. >> >> You mentioned that you are loading a 1 GB video file. Are you >> trying to load the entire file into memory at the same time? >> >> I don't know if most video players load entire video files into >> memory or not, so I can't help you with THAT part. However, I >> might be able to help in another area.... If you're getting an >> out of memory error, my guess is that you are trying to load the >> entire video file into memory, and just don't have enough free >> RAM to hold it. Again, I don't know if this is even "normal" >> behavior or not. >> >> > i am trying but not getting success.when trying to divide data >> > in chunk then video file this difficult to handle header. >> >> Here's where I might have your answer. From what you write >> above, it sounds like what you're trying to say is that you >> have tried, and failed, to divide the video into smaller video >> files and play them in sequence with no gap in-between. If >> that is the case, remember, with CODECs like Divx and Xvid, >> for example, which encode only the changes since the last key >> frame, each segment *MUST* begin with a key frame. Most >> consumer-level video editing software doesn't re-encode the >> video if you break between key frames...it just gives you >> garbage at the breaks that aren't cut in the right place, >> until the next key frame. If this sounds like what you are >> seeing, see http://www.videohelp.com for more information. >> >> By the way, this is also true when editing out portions of a >> video. The bit you are editing can be cut anywhere, but the >> next portion MUST begin with a key frame. >> >> If not, sorry, can't help.... >> >> Later, --jim >> >> PS: If you are doing the editing on a PC running Windows, >> look for Virtualdub under the Tools section. Also look >> for Avisynth. >> >> -- >> 73 DE N5IAL (/4) | DMR: So fsck was originally called >> http://jdgapps/com | something else. >> < Running FreeBSD 7.0 > | Q: What was it called? >> ICBM / Hurricane: | DMR: Well, the second letter was different. >> 30.44406N 86.59909W | -- Dennis M. Ritchie, Usenix, June 1998. >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to android-developers@googlegroups.com >> To unsubscribe from this group, send email to >> android-developers+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > > > -- > ~ Jeremiah:9:23-24 > Android 2D MMORPG: http://solrpg.com/, > http://www.youtube.com/user/revoltingx > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > By using MediaPlayer code: ============================= private void playVideo() { try { String path = mPath.getText().toString(); Log.v(TAG, "path: " + path); if (path.equals(current) && mp != null) { mp.start(); return; } path="/sdcard/watch/movie.mp4" ; holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); mp = new MediaPlayer (); mp.setOnErrorListener(this); mp.setOnBufferingUpdateListener(this); mp.setOnCompletionListener(this); mp.setOnPreparedListener(this); // mp.setAudioStreamType(AudioManager.STREAM_MUSIC); mp.setScreenOnWhilePlaying(true); mp.setDisplay(mPreview.getHolder()); mp.setDataSource(path); mp.prepare(); Log.v(TAG, "Duration: ===>" + mp.getDuration()); mp.start(); } catch (Exception e) { Log.e(TAG, "error: "+ e.getMessage(), e); if (mp != null) { mp.stop(); mp.release(); } } } => Sir, i know, i am able to play video from weburl with uri parse.but need is play from sdcard. Now i am able to play video from sdcard by using MediaPlayer -Android api without any exception, here sound is listening , but video view not displaying on surface.Please help me how to display video on screen by using mediaplayer api . Thanks, Naveen Kumar -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en