Windows/Linux/Android/iOS平臺RTMP功能元件EasyRTMP-Android,推流H264到SRS無法播放原因是什麼?
SRS伺服器是定位於網際網路直播伺服器叢集的開源框架,TSINGSEE青犀視訊研發團隊也會拿SRS伺服器來進行流媒體服務的研發和對比。我們可以推送RTMP到SRS、推送RTSP/UDP/FLV到SRS、拉取流到SRS,同時SRS還支援將接入的RTMP流進行各種變換,譬如將RTMP流轉碼。
研發人員用EasyRTMP-Android測試伺服器推流功能時,選擇了推流到SRS伺服器,但是視訊流播放不了,並且出現如下圖的報錯:
因為RTMP協議的原因,推流庫在只推流視訊時,預設會加上無聲的音訊,取樣率是8000HZ,但是SRS伺服器處理不了這個取樣率的音訊,所以需要改成44.1kHZ的音訊,SRS伺服器才能處理。
原來的音訊格式是這樣的:
// 取樣率8k的音訊資料
private final char[] gAACMuteData = {
0xFF, 0xF9, 0x6C, 0x40, 0x21, 0x5F, 0xFC, 0x01, 0x04, 0x34, 0x28, 0xAC, 0xE4, 0x69,
0x21, 0xBF, 0x1A, 0xD5, 0xEA, 0xE1, 0x49, 0x50, 0x54, 0x2A, 0x00, 0x02, 0x01, 0x96,
0x0C, 0x75, 0xD5, 0xBD, 0x53, 0x86, 0xEA, 0x9E, 0x03, 0x78, 0x92, 0xFE, 0xD1, 0xB0,
0x9D, 0x73, 0xFE, 0xCC, 0x42, 0xC2, 0xE4, 0xCD, 0x4A, 0x18, 0x8B, 0x01, 0xB0, 0xD5,
0xB9, 0x22, 0xD9, 0x93, 0x6C, 0x81, 0x5B, 0x2C, 0xA6, 0xD9, 0x9F, 0x85, 0x54, 0xC9,
0xB2, 0xEE, 0xC2, 0x9E, 0xB5, 0xDD, 0x75, 0x35, 0x57, 0xC9, 0x28, 0x97, 0x19, 0x4E,
0xCB, 0x98, 0x19, 0xEB, 0x29, 0x81, 0x34, 0x28, 0x65, 0x2E, 0x39, 0xD0, 0xD4, 0x02,
0x55, 0x30, 0x23, 0xDD, 0xA6, 0xF0, 0x79, 0xEA, 0x4C, 0x06, 0x93, 0x26, 0xB6, 0xFA,
0x21, 0x1F, 0x5A, 0x40, 0x19, 0x53, 0x03, 0x3D, 0x19, 0x5B, 0x81, 0xF4, 0xDF, 0x8B,
0x97, 0xAC, 0xF7, 0x93, 0x76, 0xE2, 0xF1, 0x42, 0x06, 0x97, 0xB9, 0x8B, 0xD2, 0x2B,
0x5F, 0x08, 0x71, 0xFE, 0x01, 0xB8, 0x04, 0x14, 0x0D, 0xF1, 0x44, 0xA5, 0x8E, 0xBC,
0x35, 0x31, 0x06, 0xAD, 0x4F, 0x2B, 0x18, 0xAF, 0x7E, 0x8B, 0x09, 0xEC, 0x84, 0xBA,
0x72, 0x79, 0x79, 0x5C, 0x91, 0x2B, 0x02, 0x0E, 0x54, 0x31, 0xEA, 0xA1, 0x48, 0x32,
0x1C, 0x98, 0x2C, 0xF9, 0x67, 0x2C, 0x74, 0xE0, 0x7C, 0xBD, 0x4F, 0x1D, 0x77, 0xDD,
0xB5, 0x61, 0x86, 0x34, 0x66, 0xB0, 0xC1, 0x01, 0x66, 0xC4, 0x9C, 0x02, 0xFD, 0xA3,
0x2A, 0xD0, 0xD7, 0x3C, 0x8D, 0x78, 0x2C, 0xC8, 0x01, 0x46, 0x80, 0xC1, 0x69, 0xBE,
0xA3, 0x95, 0x6B, 0x3A, 0xD2, 0x2A, 0x44, 0x97, 0x03, 0x05, 0x05, 0x01, 0xF8, 0x13,
0x81, 0xD5, 0xBB, 0x09, 0xAE, 0x6E, 0xAD, 0x75, 0xA0, 0xBA, 0x59, 0xE9, 0x96, 0x61,
0x18, 0x23, 0xFB, 0x76, 0xC1, 0x63, 0xA6, 0x8D, 0x6C, 0x80, 0xF7, 0xB0, 0x20, 0x70
};
即在aacThread執行緒中推流的預設音訊需要改成這樣:
// 取樣率44.1k的音訊資料
private final char[] gAACMuteData1 = {
0x21, 0x0A, 0xCF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x61, 0xA0, 0x58, 0x20, 0x16,
0x0A,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,
0x7A, 0x95, 0x3C, 0xE4, 0x8B, 0x98, 0xA1, 0x97, 0x02, 0x67, 0xA6, 0x71, 0x20, 0xCD,
0x3C, 0x6E, 0x77, 0x45, 0x22, 0x81, 0x10, 0x43, 0x80, 0xAE, 0xAC, 0x50, 0xF5, 0x4F,
0x04, 0x14, 0x70, 0xAF, 0x02, 0x26, 0x32, 0x7E, 0x6E, 0x37, 0xFF, 0x9F, 0x74, 0xF7,
0x3E, 0x39, 0xA1, 0x83, 0xCC, 0x6E, 0xD4, 0xA7, 0xE8, 0x89, 0x7F, 0x61, 0xF7, 0x54,
0x9C, 0xD3, 0xBC, 0x49, 0xAA, 0xC0, 0x7A, 0x36, 0x94, 0x41, 0xCE, 0xE7, 0x34, 0x51,
0x13, 0x01, 0xBE, 0x53, 0xA0, 0x5F, 0x82, 0x2E, 0x1B, 0x8B, 0xA5, 0xFA, 0xA7, 0x8F,
0xF9, 0x9E, 0x90, 0xED, 0x4B, 0x89, 0x01, 0xE5, 0x95, 0xE8, 0x2C, 0x9F, 0x58, 0x6F,
0x7B, 0xBF, 0x87, 0x72, 0xEE, 0x29, 0xA4, 0x8C, 0x67, 0xE6, 0x72, 0xEF, 0xCA, 0x72,
0x21, 0x7B, 0x7E, 0xB6, 0xFE, 0x5F, 0xF7, 0xF8, 0x72, 0xAF, 0x3C, 0xFE, 0xE8, 0x4F, 0x80
};
相關文章
- android camera採集、H264編碼與Rtmp推流Android
- IOS 整合 Bilibili IJKPlayer播放器,播放rtmp視訊流iOS播放器
- [SRS流媒體]RTMP/HLS 直播伺服器simple-rtmp-server安裝伺服器Server
- FFmpeg開發筆記(三十八)APP如何訪問SRS推流的RTMP直播地址筆記APP
- 基於SRS搭建RTMP直播流媒體伺服器伺服器
- RTMP推流平臺/視訊直播點播分析平臺/人臉識別系統EasyDSS如何實現RTMP負載均衡?負載
- RTSP H264/HEVC 流 Wasm 播放ASM
- Windows平臺RTMP多例項推送探討Windows
- Linux系統中無法ping的原因是什麼?如何檢視?Linux
- Android中使用ffmpeg編碼進行rtmp推流Android
- Nginx-RTMP推流(video)NginxIDE
- Nginx-RTMP推流(audio)Nginx
- Android 如何直播 RTMP 流Android
- 從linux平臺移值資料庫到windows平臺Linux資料庫Windows
- 影片加密播放支援全平臺是什麼意思?加密
- 什麼是組態雲平臺?有什麼功能?
- [流媒體]ijkplayer 播放器,android平臺使用說明播放器Android
- 音視訊學習 (十一) Android 端實現 rtmp 推流Android
- 為什麼Windows平臺下ORACLE執行緒數一直增長無法釋放?WindowsOracle執行緒
- PLC資料雲平臺是什麼?有什麼功能?
- NGINX如何實現rtmp推流服務Nginx
- windows10無法關機什麼原因_windows10無法關機怎麼辦Windows
- ssl證書無效的原因是什麼?
- python利用ffmpeg進行rtmp推流直播Python
- ffmpeg 推流檔案,採用rtmp協議協議
- windows平臺下編輯的內容傳到linux平臺出現中文亂碼的解決辦法WindowsLinux
- 播放RTMP協議的流媒體的幾種選擇協議
- OBS 配合 nginx_rtmp_module 模組 可以多路推流Nginx
- 微信IOS中搖一搖無法播放聲音iOS
- IOT智慧資料採集平臺有什麼功能
- 水汙染環保監控平臺有什麼功能?
- 大資料平臺是什麼?有哪些功能?如何搭建大資料平臺?大資料
- 企業級MQTT物聯網接入平臺是什麼?有什麼功能?MQQT
- 流媒體平臺/影片監控/安防影片EasyCVR播放暫停後,影片畫面黑屏是什麼原因?VR
- 平臺是什麼
- 什麼是平臺?
- FFmpeg開發筆記(三十六)Linux環境安裝SRS實現影片直播推流筆記Linux
- 【OSS排查方案-4】OSS+RTMP推流的JAVA方法Java