解决android下MediaExtractor无法解析的问题

This commit is contained in:
xiongziliang 2018-08-30 10:05:50 +08:00
parent 9cf0ccc6b9
commit 3ee2a14cf6

View File

@ -207,13 +207,13 @@ void RtspToRtmpMediaSource::makeMetaData() {
if (m_pParser->containVideo()) { if (m_pParser->containVideo()) {
metaData.set("width", m_pParser->getVideoWidth()); metaData.set("width", m_pParser->getVideoWidth());
metaData.set("height", m_pParser->getVideoHeight()); metaData.set("height", m_pParser->getVideoHeight());
metaData.set("videocodecid", 7); //h.264 metaData.set("videocodecid", "avc1"); //h.264
metaData.set("videodatarate", 5000); metaData.set("videodatarate", 5000);
metaData.set("framerate", m_pParser->getVideoFps()); metaData.set("framerate", m_pParser->getVideoFps());
makeVideoConfigPkt(); makeVideoConfigPkt();
} }
if (m_pParser->containAudio()) { if (m_pParser->containAudio()) {
metaData.set("audiocodecid", 10); //aac metaData.set("audiocodecid", "mp4a"); //aac
metaData.set("audiodatarate", 160); metaData.set("audiodatarate", 160);
metaData.set("audiosamplerate", m_pParser->getAudioSampleRate()); metaData.set("audiosamplerate", m_pParser->getAudioSampleRate());
metaData.set("audiosamplesize", m_pParser->getAudioSampleBit()); metaData.set("audiosamplesize", m_pParser->getAudioSampleBit());