10000 Cache issue for some video · Issue #128 · brianwernick/ExoMedia · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cache issue for some video #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
softgears opened this issue Mar 3, 2016 · 11 comments
Closed

Cache issue for some video #128

softgears opened this issue Mar 3, 2016 · 11 comments
Labels

Comments

@softgears
Copy link

I have a recycleview with EMVideoView inside each item. When i try to play video from URL: https://onex1.blob.core.windows.net/posts/3-android-post-item-1456900560.mp4 (recorded on Android camera) it cache and plays well, but when i close app and open it again - video from this URL is wont playing (stuck on preparing stage).
When i remove app and install it again, all works fine in first launch, in second - stucks. This appears to be a caching issue. This appear to be not for all video. For video like: https://onex1.blob.core.windows.net/posts/3-post-item-1453872771.54758.mp4 (recorded on iPhone camera) it always works fine.
So, is there a way to clear local exo player cache?

@brianwernick
Copy link
Owner

Is there any log output from ExoMedia that points to any specific issues?
And are you correctly releasing the EMVideoViews when they are no longer needed. (see #13 for a previous discussion on RecyclerView support)

@softgears
Copy link
Author

This was found in Log output:

03-04 12:10:58.348  13115-13347/net.onexapp.onex E/ExoPlayerImplInternal﹕ Internal track renderer error.
    com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.extractor.ExtractorSampleSource$UnrecognizedInputFormatException: None of the av
8000
ailable extractors (WebmExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, TsExtractor, FlvExtractor) could read the stream.
            at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:263)
            at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:149)
            at com.google.android.exoplayer.ExoPlayerImplInternal.incrementalPrepareInternal(ExoPlayerImplInternal.java:283)
            at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:205)
            at android.os.Handler.dispatchMessage(Handler.java:98)
            at android.os.Looper.loop(Looper.java:135)
            at android.os.HandlerThread.run(HandlerThread.java:61)
            at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
     Caused by: com.google.android.exoplayer.extractor.ExtractorSampleSource$UnrecognizedInputFormatException: None of the available extractors (WebmExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, TsExtractor, FlvExtractor) could read the stream.
            at com.google.android.exoplayer.extractor.ExtractorSampleSource$ExtractorHolder.selectExtractor(ExtractorSampleSource.java:787)
            at com.google.android.exoplayer.extractor.ExtractorSampleSource$ExtractingLoadable.load(ExtractorSampleSource.java:718)
            at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:209)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at java.lang.Thread.run(Thread.java:818)
03-04 12:11:02.342  13115-13115/net.onexapp.onex E/ActivityThread﹕ Performing stop of activity that is not resumed: {net.onexapp.onex/net.onexapp.onex.IntroActivity}
    java.lang.RuntimeException: Performing stop of activity that is not resumed: {net.onexapp.onex/net.onexapp.onex.IntroActivity}
            at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3325)
            at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3406)
            at android.app.ActivityThread.access$1100(ActivityThread.java:147)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1310)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5253)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:948)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:743)

@softgears
Copy link
Author

@brianwernick
Copy link
Owner

I'm unable to duplicate this issue with the video you provided. Would you please answer the following questions to better help us diagnose the issue:

  • What ExoMedia version
  • What Android Version
  • What is the device manufacturer
  • Is every EMVideoView being correctly released
  • Does this happen immediately, or do you need to scroll through the list for a while before you notice the issue

@ykorshev
Copy link

Tested on ASUS ZenFone 2 with Android 5.0.1. Some times this bug appears, but some times not. Mostly, it appears after downloading and viewing full video and dragging seek bar. But if bug appears, the video becames completly unplayable until the app is reinstalled. I guess the problem with invalid local cache management (i think localy cached file became broken and the reader could not obtain metadata from it).

I have the following layout structure:

  • Recycler View
  • - View Holder
  • - - View Pager
  • - - - EMVideoView

So, maybe you can advice me a workaround which provides correct EMVideoView releasing in described above layout structure? I am calling .release() method for previously initialized views before populating a new views, or maybe i should call reset locally cached streams or provides correct release procedure.

Thanks.

@brianwernick
Copy link
Owner

Thanks for the info. I'll try to reproduce it again when I get some time.

In the meantime, calling .release() when populating new views won't perform the cleanup when the activity (or fragment) is destroyed; so you will leak contexts which may cause the issue.

In this case I would have the RecyclerView.Adapter keep a list of all the EMVideoViews and in the onDetachFromWindow() method call .release() on all of them. Just keep in mind that the onDetachFromWindow() isn't called unless you call recyclerView.setAdapter(null) in the Activities or Fragments onDestroy() method.

@kinsleykajiva
Copy link

hi, i have just started using this library but i seem to see that this library fails to cache for both audio and video stream playback.
I have tried to tweak classes i know to cache the streams but i am still failing to cache the streams in a real device.
Pleas can you help to create a cache that when i use one URL the player should reuse the created cache to play the video before closure, hence the concept of caching .

Also this point it may be of or not related but the player seems to behave better in the emulator than the real device i don't know if anyone has noticed this ,this a thought....
please can you aid me in the highlighted aspects . Thanks in advance

@brianwernick
Copy link
Owner

The ExoPlayer doesn't keep a cache in the normal sense. Instead it keeps a buffer for the current playing media. If you need to create an actual cache then you will need to override the RenderBuilders and provide your own DataSource which performs the caching for you. (see #86 and the related changes)

@kinsleykajiva
Copy link

Thanks for the reply i have been implementing this for HLS and DASH streams but for mp3 and mp4 ...its a different issue bro. i am really stuck as in no where to get help .....

Anyways thanks for the response and time.


From: Brian Wernick notifications@github.com
Sent: Wednesday, March 30, 2016 4:57 PM
To: brianwernick/ExoMedia
Cc: Kinsley Kajiva
Subject: Re: [brianwernick/ExoMedia] Cache issue for some video (#128)

The ExoPlayer doesn't keep a cache in the normal sense. Instead it keeps a buffer for the current playing media. If you need to create an actual cache then you will need to override the RenderBuilders and provide your own DataSource which performs the caching for you. (see #86#86 and the related changes)

You are receiving this because you commented.
Reply to this email directly or view it on GitHubhttps://github.com//issues/128#issuecomment-203474201

@eygraber
Copy link
Contributor
eygraber commented Apr 8, 2016

Here's an OkHttp implementation of a DataSource. If there is a Cache set up with the OkHttpClient videos should be cached - https://gist.github.com/eygraber/8e935e19eedc70d2d8e3

@brianwernick
Copy link
Owner
brianwernick commented Apr 30, 2016

@softgears In the current source code I am still having issues reproducing this. It may have been fixed by any of the many changes for the 3.0 release or by an ExoPlayer update. I have created a branch (issue_128) for testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
0