h264 转flv后fps问题
h264 转flv后fps不对,如果再加上音频后悔导致音画不用同步问题
h264源文件是什么格式的? 裸文件没有时间戳信息,fps默认为25,可以根据实际情况修改。
h264是裸流,包含pps和sps,应该是可以计算出fps的,我写MP4文件就是OK的
写mp4文件的帧率是多少? 时间戳怎么生成的?
mp4是用mp4v2库写的,// MP4TrackId MP4AddH264VideoTrack(MP4FileHandle hFile, // uint32_t timeScale, // MP4Duration sampleDuration, // uint16_t width, // uint16_t height, // uint8_t AVCProfileIndication, // uint8_t profile_compat, // uint8_t AVCLevelIndication, timeScale 和sampleDuration可以从SPS中获得,确定了fps
libflv确实没有读VUI信息,如果需要生成准确的时间戳,只能借助第三方库了。可以试试https://github.com/ireader/avcodec,里面有个h264解析模块,可以读到VUI。