wang-bin / QtAV

A cross-platform multimedia framework based on Qt and FFmpeg. 基于Qt和FFmpeg的跨平台高性能音视频播放框架. Recommand to use new sdk https://github.com/wang-bin/mdk-sdk
http://qtav.org
3.98k stars 1.5k forks source link

Parse h264 NALU #899

Open ealloradai opened 7 years ago

ealloradai commented 7 years ago

Hi all, Is there a way to get the H264 NAL packet before it is decoded or i need to use a custom h264 decoder? Thanks

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/46445062-parse-h264-nalu?utm_campaign=plugin&utm_content=tracker%2F307703&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F307703&utm_medium=issues&utm_source=github).
wang-bin commented 7 years ago

You have to modify AVDemuxer or decoder

ealloradai commented 7 years ago

Thank you for the reply. Basically, I need to read the embedded data in the custom NAL packets (using NALU 30 and 31) and report it at GUI level by passing some reference to AVDemuxer or decoder as you suggested. I tried to do this with libvlc using the openh264 (BSD license) codec, but libvlc seems too complex for my task. I could reuse the openh264 codec anyway. Could you suggest me the best approach?

ealloradai commented 7 years ago

Hi wang-bin, could you suggest me where to modify AVDemux or decoder? I found that ffmpeg in /libavformat/rtpdec_h264.c seems to completely discard NAL with type >= 1 && type <= 23. So where ca i recover them? Thanks