Windsander / Android-UltimateGPUImage

provide video record method with filter and other cool staff. Yes, It's a full functional video recorder
199 stars 37 forks source link

some thought of couldn't play video bug. #10

Closed Windsander closed 7 years ago

Windsander commented 7 years ago

Thx to YeYuanYuan's support. I think I have some clue of this problem. Our project use MediaCodec as the engine code. For this, if it is working, it should come out with the fallowing log information. D/ACodec: dataspace changed to 0x10c10000 (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M)) (R:2(Limited), S:1(BT709), T:3(SMPTE_170M) So the encoder could receive the status of buffer at initialization phase. encoderStatus == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED that means the color pixel of the current frame is changed by filter you set. But the problem is , when we start to use filter, every pixels operate relay to the OnFrameAvailable function which should be used in engine's locked render thread. And That WILL Cause a dead lock. The Render thread no longer been able to notify each other at the start of recording initialization. Since the OnframeAvailable function has been stuck, the buffer could not be updated. As the result, the MeidaCodec never get the INFO_OUTPUT_FORMAT_CHANGED status.

I think maybe I should check the frameAvailable() or frameAvailableSoon() is keeping update when recording start.

Windsander commented 7 years ago

OK, I think I have some problem with Muxer, and cause a recording system shut down. I will deal it later. Maybe I should consider to reconstruct my recorder engine. 好吧,我好像把我的混合器调坏了,不过暴露出了原来没有发现的问题。我在考虑是不是重新架构一下好了,正好解决录制音视频混合同步帧的问题。

Windsander commented 7 years ago

this month will be a hard time. I'm working at a new project which is requested by PM, so this project will be slow down. But ur guys sound't be worried about this, because I will NEVER give it up. And it's also a good time to let me think this project structure, and make it better. The problem remain is my video handler thread couldn't get my input frame, which cause black screen problem, in recording. if u have any ideas, please let me know. The branch is willowenchance&_bugfix.

Windsander commented 7 years ago

I have locate where the bug occured. I think it was caused by frame refresh and record buffer not sync.

Windsander commented 7 years ago

now it done, I need a few to test it for safety