Skip to content
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

Failed to stop the muxer (timestamps problem?) #23

Closed
RazorPT opened this issue Apr 17, 2015 · 3 comments
Closed

Failed to stop the muxer (timestamps problem?) #23

RazorPT opened this issue Apr 17, 2015 · 3 comments

Comments

@RazorPT
Copy link

RazorPT commented Apr 17, 2015

I have been going for 2 days and cant run your app it fails with Unable to generate content dialog and this shows on the logcat. My device is a samsung tablet running cynogenmod 12.1 (Lollipop 5.1)
Any ideas?

04-17 15:11:12.552    4577-4606/com.android.grafika E/MPEG4Writer﹕ timestampUs 125000 < lastTimestampUs 375000 for Video track
04-17 15:11:12.557    2184-2474/? W/GraphicBufferSource﹕ Dropped back down to Loaded without Executing
04-17 15:11:12.598    2184-2184/? E/BufferQueueProducer﹕ [GraphicBufferSource] cancelBuffer: BufferQueue has been abandoned
04-17 15:11:12.602    4577-4596/com.android.grafika D/MPEG4Writer﹕ Video track stopping
04-17 15:11:12.602    4577-4596/com.android.grafika D/MPEG4Writer﹕ Video track source stopping
04-17 15:11:12.602    4577-4596/com.android.grafika D/MPEG4Writer﹕ Video track source stopped
04-17 15:11:12.602    4577-4596/com.android.grafika D/MPEG4Writer﹕ Stopping writer thread
04-17 15:11:12.602    4577-4605/com.android.grafika D/MPEG4Writer﹕ 0 chunks are written in the last batch
04-17 15:11:12.603    4577-4596/com.android.grafika D/MPEG4Writer﹕ Writer thread stopped
04-17 15:11:12.605    4577-4596/com.android.grafika W/Grafika﹕ Failed while generating content
    java.lang.IllegalStateException: Failed to stop the muxer
            at android.media.MediaMuxer.nativeStop(Native Method)
            at android.media.MediaMuxer.stop(MediaMuxer.java:225)
            at com.android.grafika.GeneratedMovie.releaseEncoder(GeneratedMovie.java:145)
            at com.android.grafika.MovieEightRects.create(MovieEightRects.java:74)
            at com.android.grafika.ContentManager.prepare(ContentManager.java:154)
            at com.android.grafika.ContentManager.access$000(ContentManager.java:39)
            at com.android.grafika.ContentManager$GenerateTask.doInBackground(ContentManager.java:235)
            at com.android.grafika.ContentManager$GenerateTask.doInBackground(ContentManager.java:203)
            at android.os.AsyncTask$2.call(AsyncTask.java:292)
            at java.util.concurrent.FutureTask.run(FutureTask.java:237)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
            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)
@fadden
Copy link
Contributor

fadden commented Apr 17, 2015

The inability to generate content, which is expected on emulators but not on physical devices, does not prevent all of the app from working. The activities which rely on the generated content, such as "double decode", will fail unless you copy your own video clips into the app data directory, but things like "show + capture camera" should work fine.

My guess would be a cyanogen bug. Generally speaking, the stuff Grafika does is also exercised by CTS tests, so any devices that pass CTS should be able to run Grafika.

"Failed to stop the muxer" can happen when you tell the muxer to stop without ever having sent it any data. (It doesn't think it started, so it doesn't think it needs to stop, but instead of ignoring the redundant call it throws an exception at you.) I'm guessing the code that feeds Surface input to MediaCodec is failing, hence the BufferQueueProducer error, but the muxer error is what is getting reported.

@RazorPT
Copy link
Author

RazorPT commented Apr 17, 2015

Hum just tried "show + capture camera" and it also fails with same timestamp problem, i am developing screen capture app and tried several ways to record the screen tried the code from https://github.com/yrom/ScreenRecorder and also gave me the timestamp problems i thought it was a problem with cynogen but to my surprise "AZ Recorder" and "Lollipop Screen Recorder" run fine on my device.

After so many hours/days and going into frustration i reversed enginered AZ Recorder (not cool i know) just to see what kind of code he was using, it was not easy with proguard but i managed to identify that he was using your code from http://bigflake.com/mediacodec/CameraToMpegTest.java.txt adapted to capture screen.

So i also took your example and made the changes he did for what i could see and again i got the timestamp error how is that even possible? The only difference i saw was that his app seems to record with a resolution of 1228x720 a weird resolution but if i use that resolution in my app it instantly crashs on MediaEnconder config.

Lollipop Screen Recorder can also record my screen without problem using a resolution of 480x720 which i also tried to no avail. I am so lost right now.

@fadden
Copy link
Contributor

fadden commented Apr 18, 2015

I'm afraid I don't have any insights into this. I've never used Cyanogen, and I'm not in a position to investigate this further (I left Google about 10 months back).

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

No branches or pull requests

2 participants