begeekmyfriend / yasea

RTMP live streaming client for Android
MIT License
4.86k stars 1.32k forks source link

推流传入的数据格式是什么? #800

Open abc456879213 opened 3 years ago

abc456879213 commented 3 years ago

我拿到一个源(非手机摄像头)的每帧的NV21数据,要经过什么处理后才推流?

begeekmyfriend commented 3 years ago

NV21的话可以借鉴non-gpuimage分支,安卓摄像头默认采集NV21格式,所以后面的处理你可以借鉴,或者用libyuv去转格式

abc456879213 commented 3 years ago

NV21的话可以对非gpuimage分割,安卓摄像头替代采集NV21格式,所以后面的处理你可以互换,或者用libyuv去转格式

@begeekmyfriend 谢谢!我尝试编译non-gpuimage分支的项目,提示了Cause: executing external native build for ndkBuild E:\studiowork\yasea\library\src\main\cpp\Android.mk,有什么解决办法吗?

begeekmyfriend commented 3 years ago

你更新一下build.gradle试试,欢迎PR,因为我目前没有Android Studio了

abc456879213 commented 3 years ago

你更新一下build.gradle试试,欢迎PR,因为我目前没有Android Studio了

@begeekmyfriend 你好,我现在拿到一个视频源的H264数据,怎样去推流?在H264分支的项目里,我没看到实现逻辑,能指引一下吗

begeekmyfriend commented 3 years ago

推H.264裸流的话,可以用FlvMuxer接口,送数据做好buffer缓冲即可

JohnsCui commented 3 years ago

如果我需要将美颜后的byte[]格式推流,有没有推荐的修改方案

begeekmyfriend commented 3 years ago

美颜一般是RGB(或者HSV美艳之后转成RGB),yasea默认主分支就是RGBA啊(顶多加个alpha通道),直接送即可

mikite commented 2 years ago

NV21的话可以借鉴non-gpuimage分支,安卓摄像头默认采集NV21格式,所以后面的处理你可以借鉴,或者用libyuv去转格式

我尝试将NV21的帧数据转为RGB8888 遇到以下错误: 2021-11-30 18:05:44.977 1860-2407/? E/OMXNodeInstance: getConfig(0xb3a996e0:google.aac.encoder, ConfigAndroidVendorExtension(0x6f100004)) ERROR: Undefined(0x80001001) 2021-11-30 18:05:45.023 1860-2277/? E/OMXNodeInstance: getConfig(0xb23e7a04:allwinner.encoder.avc, ConfigLatency(0x6f800005)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.024 1860-2277/? E/OMXNodeInstance: getConfig(0xb23e7a04:allwinner.encoder.avc, ConfigAndroidVendorExtension(0x6f100004)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.025 1860-2277/? E/OMXNodeInstance: getConfig(0xb23e7a04:allwinner.encoder.avc, ConfigAndroidIntraRefresh(0x6f60000a)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.025 1860-1952/? E/omx_venc: : getparameter: unknown param 0xb3af0700  2021-11-30 18:05:45.025 1860-1952/? E/OMXNodeInstance: getParameter(0xb23e7a04:allwinner.encoder.avc, ParamVideoIntraRefresh(0x6000006)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.212 1860-1952/? E/OMXNodeInstance: getConfig(0xb3a99bc0:google.aac.encoder, ConfigAndroidVendorExtension(0x6f100004)) ERROR: Undefined(0x80001001) 2021-11-30 18:05:45.260 1860-2275/? E/OMXNodeInstance: getConfig(0xb06f0404:allwinner.encoder.avc, ConfigLatency(0x6f800005)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.261 1860-2275/? E/OMXNodeInstance: getConfig(0xb06f0404:allwinner.encoder.avc, ConfigAndroidVendorExtension(0x6f100004)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.263 1860-2275/? E/OMXNodeInstance: getConfig(0xb06f0404:allwinner.encoder.avc, ConfigAndroidIntraRefresh(0x6f60000a)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.263 1860-2275/? E/omx_venc: : getparameter: unknown param 0xb3af0b40  2021-11-30 18:05:45.264 1860-2275/? E/OMXNodeInstance: getParameter(0xb06f0404:allwinner.encoder.avc, ParamVideoIntraRefresh(0x6000006)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.496 1860-2275/? E/OMXNodeInstance: getConfig(0xb3a9a0a0:google.aac.encoder, ConfigAndroidVendorExtension(0x6f100004)) ERROR: Undefined(0x80001001) 2021-11-30 18:05:45.576 1860-2407/? E/OMXNodeInstance: getConfig(0xaf57be04:allwinner.encoder.avc, ConfigLatency(0x6f800005)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.577 1860-2407/? E/OMXNodeInstance: getConfig(0xaf57be04:allwinner.encoder.avc, ConfigAndroidVendorExtension(0x6f100004)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.577 1860-2275/? E/OMXNodeInstance: getConfig(0xaf57be04:allwinner.encoder.avc, ConfigAndroidIntraRefresh(0x6f60000a)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.578 1860-2407/? E/omx_venc: : getparameter: unknown param 0xb3af0d80  2021-11-30 18:05:45.578 1860-2407/? E/OMXNodeInstance: getParameter(0xaf57be04:allwinner.encoder.avc, ParamVideoIntraRefresh(0x6000006)) ERROR: UnsupportedIndex(0x8000101a) 2021-11-30 18:05:45.579 4823-5337/com.temp.ess A/MediaCodec: frameworks/av/media/libstagefright/MediaCodec.cpp:1619 CHECK_EQ( mState,CONFIGURING) failed: 10 vs. 3 2021-11-30 18:05:45.579 4823-5337/com.temp.ess A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 5337 (MediaCodec_loop), pid 4823 (ercn.smarthouse) 2021-11-30 18:05:45.748 5345-5345/? A/DEBUG: 2021-11-30 18:05:45.749 5345-5345/? A/DEBUG: Build fingerprint: 'Allwinner/venus_a3/venus-a3:8.1.0/OPM1.171019.026/20210621-234151:userdebug/test-keys' 2021-11-30 18:05:45.749 5345-5345/? A/DEBUG: Revision: '0' 2021-11-30 18:05:45.749 5345-5345/? A/DEBUG: ABI: 'arm' 2021-11-30 18:05:45.749 5345-5345/? A/DEBUG: pid: 4823, tid: 5337, name: MediaCodec_loop >>> com.pointercn.smarthouse <<< 2021-11-30 18:05:45.749 5345-5345/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- 2021-11-30 18:05:45.759 5345-5345/? A/DEBUG: Abort message: 'frameworks/av/media/libstagefright/MediaCodec.cpp:1619 CHECK_EQ( mState,CONFIGURING) failed: 10 vs. 3' 2021-11-30 18:05:45.759 5345-5345/? A/DEBUG: r0 00000000 r1 000014d9 r2 00000006 r3 00000008 2021-11-30 18:05:45.760 5345-5345/? A/DEBUG: r4 000012d7 r5 000014d9 r6 8f17f3ac r7 0000010c 2021-11-30 18:05:45.760 5345-5345/? A/DEBUG: r8 00000000 r9 a7bda900 sl 8f17f8fc fp 00000000 2021-11-30 18:05:45.760 5345-5345/? A/DEBUG: ip 93fe8a64 sp 8f17f398 lr b3483a4b pc b347d47c cpsr 200f0030 2021-11-30 18:05:45.894 5345-5345/? A/DEBUG: backtrace: 2021-11-30 18:05:45.894 5345-5345/? A/DEBUG: #00 pc 0001a47c /system/lib/libc.so (abort+63) 2021-11-30 18:05:45.895 5345-5345/? A/DEBUG: #01 pc 000065c3 /system/lib/liblog.so (android_log_assert+154) 2021-11-30 18:05:45.895 5345-5345/? A/DEBUG: #02 pc 000da8c1 /system/lib/libstagefright.so (android::MediaCodec::onMessageReceived(android::sp const&)+8924) 2021-11-30 18:05:45.895 5345-5345/? A/DEBUG: #03 pc 0000fa81 /system/lib/libstagefright_foundation.so (android::AHandler::deliverMessage(android::sp const&)+24) 2021-11-30 18:05:45.895 5345-5345/? A/DEBUG: #04 pc 00011f75 /system/lib/libstagefright_foundation.so (android::AMessage::deliver()+60) 2021-11-30 18:05:45.895 5345-5345/? A/DEBUG: #05 pc 000106e7 /system/lib/libstagefright_foundation.so (android::ALooper::loop()+470) 2021-11-30 18:05:45.895 5345-5345/? A/DEBUG: #06 pc 0000d2af /system/lib/libutils.so (android::Thread::_threadLoop(void)+270) 2021-11-30 18:05:45.895 5345-5345/? A/DEBUG: #07 pc 0006dd45 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void)+80) 2021-11-30 18:05:45.895 5345-5345/? A/DEBUG: #08 pc 00047b93 /system/lib/libc.so (__pthread_start(void*)+22) 2021-11-30 18:05:45.896 5345-5345/? A/DEBUG: #09 pc 0001b057 /system/lib/libc.so (start_thread+32) 2021-11-30 18:05:51.351 2023-2130/system_process E/InputDispatcher: channel '702405c com.pointercn.smarthouse/com.zzwtec.monitor.view.GetCameraFrameActivity (server)' ~ Channel is unrecoverably broken