grafika

Issue in passing Egl configured surface to native and push the data

余生颓废 提交于 2019-12-09 23:53:53
问题 First, thanks to fadden for your wonderful examples. I tried following this ContinuousCapture.java example, and produced the below program. 1) I am trying to display the image into TextureView in the native layer by getting its ANativeWwindow reference, and using ANative lock and unlockpost methods to acquire the BufferQueue and to fill the data. Ie: ANativeWindow_lock(*window, &buffer, NULL) ANativeWindow_unlockAndPost(*window); 2) At the same time i want to retrieve the data from this

Orientation Issue while video recording in Portrait Mode android grafika

杀马特。学长 韩版系。学妹 提交于 2019-12-07 21:48:41
问题 I set the device Orientation Landscape mode then it saves the video perfectly. if I capture a video with both sides. But I set the device orientation Portrait Mode this work weird. For Example: Below Screenshot while i Recording video : But when i save the video and see in MXPlayer then it's look like this: I use below code : Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); if (display.getRotation() == Surface.ROTATION_0) { mCamera

Orientation Issue while video recording in Portrait Mode android grafika

拜拜、爱过 提交于 2019-12-06 14:09:37
I set the device Orientation Landscape mode then it saves the video perfectly. if I capture a video with both sides. But I set the device orientation Portrait Mode this work weird. For Example: Below Screenshot while i Recording video : But when i save the video and see in MXPlayer then it's look like this: I use below code : Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay(); if (display.getRotation() == Surface.ROTATION_0) { mCamera.setDisplayOrientation(90); // layout.setAspectRatio((double) cameraPreviewSize.height / cameraPreviewSize.width); } else if

Android MediaCodec backward seeking

百般思念 提交于 2019-12-06 05:14:55
I'm trying to implement precise seeking for video using MediaCodec and MediaExtractor . By following Grafika's MoviePlayer , I've managed to implement the forward seeking. However I'm still having problem with backward seeking. The relevant bit of code is here: public void seekBackward(long position){ final int TIMEOUT_USEC = 10000; int inputChunk = 0; long firstInputTimeNsec = -1; boolean outputDone = false; boolean inputDone = false; mExtractor.seekTo(position, MediaExtractor.SEEK_TO_PREVIOUS_SYNC); Log.d("TEST_MEDIA", "sampleTime: " + mExtractor.getSampleTime()/1000 + " -- position: " +

Issue in passing Egl configured surface to native and push the data

£可爱£侵袭症+ 提交于 2019-12-04 20:24:08
First, thanks to fadden for your wonderful examples. I tried following this ContinuousCapture.java example, and produced the below program. 1) I am trying to display the image into TextureView in the native layer by getting its ANativeWwindow reference, and using ANative lock and unlockpost methods to acquire the BufferQueue and to fill the data. Ie: ANativeWindow_lock(*window, &buffer, NULL) ANativeWindow_unlockAndPost(*window); 2) At the same time i want to retrieve the data from this Surface and pass it to the encoder. Or, display it into another surface. As a first step, I have created the

Android Decode raw h264 stream with MediaCodec

橙三吉。 提交于 2019-12-04 04:23:46
问题 I have troubles with decoding and drawing raw h264 data with MediaCodec on the TextureView. I recieve the raw data in byte arrays, each of the array is NAL unit (starts with 0x00 0x00 0x00 0x01 ), also there are SPS and PPS NAL units in constant intervals. When new data arrives, I'm putting it into LinkedBlockingQueue : public void pushData(byte[] videoBuffer) { dataQueue.add(videoBuffer); if (!decoderConfigured) { // we did not receive first SPS NAL unit, we want to throw away all data until

Android Precise seeking of video

陌路散爱 提交于 2019-12-03 08:17:42
I'm struggling with precise seeking using MediaExtractor's seekTo() . While I can seek to sync frames without problems, I would like to seek to specific time. This question led me to some ideas how to do this, but I'm not sure if they are valid. Basicly, I would have to seek to closest previous sync frame and then advance() the extractor until target time is reached. Every frame in the process would be fed to the decoder, i.e the first I-frame and the rest P-frames. This is related code snippet (based on google/grafika 's MoviePlayer): extractor.seekTo((long) seekTarget[threadNr],

Android Video Circular Buffer with Sound

雨燕双飞 提交于 2019-12-03 05:18:12
问题 I am using Google's Open Source Example: Grafika . I am using it's ContinuousCaptureActivity.java The CircularBuffer's Implementation is demonstrated in this Activity, but there is no audio included in the resultant Video file. I want to add the Audio Recording functionality within this Activity and add the recorded Audio into the Video in the same CircularBuffered Fashion. For achieving this i have explored the MediaCodec Library, which was introduced in 4.3+ versions. I have also used

Android Video Circular Buffer with Sound

冷暖自知 提交于 2019-12-02 19:43:09
I am using Google's Open Source Example: Grafika . I am using it's ContinuousCaptureActivity.java The CircularBuffer's Implementation is demonstrated in this Activity, but there is no audio included in the resultant Video file. I want to add the Audio Recording functionality within this Activity and add the recorded Audio into the Video in the same CircularBuffered Fashion. For achieving this i have explored the MediaCodec Library, which was introduced in 4.3+ versions. I have also used MediaMuxer to capture Video and Audio Streams and Muxed them into a single Video. But, I am not sure about

android grafika ContinuousCapture activity issues

不想你离开。 提交于 2019-12-02 02:19:08
问题 I'm using android grafika for video recording and I'll change all things that I want. Everything works perfectly. There are only 2 problems: If I save video after 7 seconds like 2 seconds or below 7 seconds then it saves a 7 second video. If I take a video 15 seconds or more then it takes the last 7 seconds of video. I want to solution : if I save after 7 second video like for a 2 second then save the video for 2 second I want to save first 7 seconds of video This Github link which I follow :