{"action":"created","issue":{"url":"https://api.github.com/repos/saki4510t/AudioVideoRecordingSample/issues/3","labels_url":"https://api.github.com/repos/saki4510t/AudioVideoRecordingSample/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/saki4510t/AudioVideoRecordingSample/issues/3/comments","events_url":"https://api.github.com/repos/saki4510t/AudioVideoRecordingSample/issues/3/events","html_url":"https://github.com/saki4510t/AudioVideoRecordingSample/issues/3","id":85165439,"number":3,"title":"Adapt the encoding package to screen record","user":{"login":"RazorPT","id":7467102,"avatar_url":"https://avatars.githubusercontent.com/u/7467102?v=3","gravatar_id":"","url":"https://api.github.com/users/RazorPT","html_url":"https://github.com/RazorPT","followers_url":"https://api.github.com/users/RazorPT/followers","following_url":"https://api.github.com/users/RazorPT/following{/other_user}","gists_url":"https://api.github.com/users/RazorPT/gists{/gist_id}","starred_url":"https://api.github.com/users/RazorPT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RazorPT/subscriptions","organizations_url":"https://api.github.com/users/RazorPT/orgs","repos_url":"https://api.github.com/users/RazorPT/repos","events_url":"https://api.github.com/users/RazorPT/events{/privacy}","received_events_url":"https://api.github.com/users/RazorPT/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-04T16:11:57Z","updated_at":"2015-06-05T13:05:54Z","closed_at":null,"body":"Hi there\r\n\r\nYour code its the first one i found which seems to working flawlessly while recording audio and video with MediaCodec, but i tried to convert the MediaVideoEncoder to capture screen and for that i used small bits of code from https://github.com/yrom/ScreenRecorder but when i try to record it will only record for a second and then stops no matter i long i leave it recording.\r\n\r\nWhat i did was strip the RenderHandler from the  MediaVideoEncoder since it doesnt seem i need it and pass MediaProjection object to the MediaVideoEncoder constructor  and then i just add this to the end of MediaVideoEncoder prepare method:\r\n        \r\nmVirtualDisplay = mMediaProjection.createVirtualDisplay(TAG + \"-display\",\r\n                mWidth, mHeight, mDpi, DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC,\r\n                mSurface, null, null);\r\n\r\nFrom what i understand the mSurface receives input from display after this method, it works and i capture the screen for just a 1 second then it stops any idea what i might be missing?\r\n\r\nThank you for your time"},"comment":{"url":"https://api.github.com/repos/saki4510t/AudioVideoRecordingSample/issues/comments/109288119","html_url":"https://github.com/saki4510t/AudioVideoRecordingSample/issues/3#issuecomment-109288119","issue_url":"https://api.github.com/repos/saki4510t/AudioVideoRecordingSample/issues/3","id":109288119,"user":{"login":"RazorPT","id":7467102,"avatar_url":"https://avatars.githubusercontent.com/u/7467102?v=3","gravatar_id":"","url":"https://api.github.com/users/RazorPT","html_url":"https://github.com/RazorPT","followers_url":"https://api.github.com/users/RazorPT/followers","following_url":"https://api.github.com/users/RazorPT/following{/other_user}","gists_url":"https://api.github.com/users/RazorPT/gists{/gist_id}","starred_url":"https://api.github.com/users/RazorPT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RazorPT/subscriptions","organizations_url":"https://api.github.com/users/RazorPT/orgs","repos_url":"https://api.github.com/users/RazorPT/repos","events_url":"https://api.github.com/users/RazorPT/events{/privacy}","received_events_url":"https://api.github.com/users/RazorPT/received_events","type":"User","site_admin":false},"created_at":"2015-06-05T13:05:54Z","updated_at":"2015-06-05T13:05:54Z","body":"Ok just tried the following:\r\n \r\nImageReader mImageReader = ImageReader.newInstance(mWidth, mHeight, PixelFormat.RGBA_8888, 2);\r\n        mVirtualDisplay = mMediaProjection.createVirtualDisplay(TAG + \"-display\",\r\n                mWidth, mHeight, mDpi, DisplayManager.VIRTUAL_DISPLAY_FLAG_PUBLIC,\r\n                mImageReader.getSurface(), null, null);\r\n\r\n        mImageReader.setOnImageAvailableListener(new ImageReader.OnImageAvailableListener() {\r\n            @Override\r\n            public void onImageAvailable(ImageReader reader) {\r\n                drain();\r\n            }\r\n        }, null);\r\n\r\nBut now i cant even record a second this is what i got on my logcat\r\n06-05 14:02:37.327    9372-9372/? D/MediaMuxerWrapper﹕ path=/storage/emulated/0/Movies/ScreenRecorderULTRA3\r\n06-05 14:02:37.361    9372-9372/? W/VideoCapabilities﹕ Unrecognized profile 2130706433 for video/avc\r\n06-05 14:02:37.384    9372-9372/? I/VideoCapabilities﹕ Unsupported profile 4 for video/mp4v-es\r\n06-05 14:02:37.388    9372-9372/? W/VideoCapabilities﹕ Unrecognized profile 2130706433 for video/avc\r\n06-05 14:02:37.389    9372-9372/? I/MediaVideoEncoder﹕ bitrate=12.36[Mbps]\r\n06-05 14:02:37.392    9372-9443/? I/OMXClient﹕ Using client-side OMX mux.\r\n06-05 14:02:37.465    9372-9443/? E/ACodec﹕ [OMX.qcom.video.encoder.avc] storeMetaDataInBuffers (output) failed w/ err -1010\r\n06-05 14:02:37.466    9372-9443/? W/ACodec﹕ do not know color format 0x7fa30c04 = 2141391876\r\n06-05 14:02:37.466    9372-9443/? W/ACodec﹕ do not know color format 0x7f000789 = 2130708361\r\n06-05 14:02:37.470    9372-9443/? I/ACodec﹕ setupVideoEncoder succeeded\r\n06-05 14:02:37.471    9372-9443/? W/ACodec﹕ do not know color format 0x7f000789 = 2130708361\r\n06-05 14:02:37.709    9372-9390/? V/RenderScript﹕ Application requested CPU execution\r\n06-05 14:02:37.713    9372-9390/? V/RenderScript﹕ 0xaec10200 Launching thread(s), CPUs 4\r\n06-05 14:02:44.995    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.013    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.032    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.051    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.068    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.087    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.105    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.124    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.143    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.162    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.180    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.199    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.218    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.236    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.255    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.274    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.292    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.311    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.330    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.348    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.367    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.386    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.404    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.423    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.441    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.460    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.479    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.498    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.516    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.535    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.554    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.572    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.591    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.610    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.629    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.647    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.666    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.684    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.703    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.722    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.740    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.759    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.778    9372-9388/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.797    9372-9452/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned\r\n06-05 14:02:45.815    9372-9389/? E/BufferQueueProducer﹕ [unnamed-9372-0] dequeueBuffer: BufferQueue has been abandoned "}}