Closed tingting007xxx closed 4 years ago
https://github.com/sonysuqin/WasmVideoPlayer/blob/master/decoder.c
ErrorCode processDecodedVideoFrame(AVFrame *frame) { ErrorCode ret = kErrorCode_Success; double timestamp = 0.0f; do { if (frame == NULL || decoder->videoCallback == NULL || decoder->yuvBuffer == NULL || decoder->videoBufferSize <= 0) { ret = kErrorCode_Invalid_Param; break; }
if (decoder->videoCodecContext->pix_fmt != AV_PIX_FMT_YUV420P) {
simpleLog("Not YUV420P, but unsupported format %d.", decoder->videoCodecContext->pix_fmt);
ret = kErrorCode_Invalid_Format;
break;
}
目前写死了只支持YUV420P,这个文件是YUVJ420P ,这两个就是颜色范围有点区别,数据格式是一样,这里你让这个条件通过就好了。如果是其他格式的话,就需要修改一下copyYuvData函数,就能处理其他格式的了。
这个视频文件为什么会报错?https://4dkk2.4dage.com/test/test114.mp4