[Libav-user] Decoding RTMP stream
Attila Krüpl
krupl.attila at gmail.com
Thu May 30 13:14:39 EEST 2019
Hi all,
I’m reading RTMP stream with LibRTMP ( RTMP_Read ). I’m processing the FLV
as follows:
- I’m reading the header
- I’m reading the tag
- Getting the frame type codec byte out of the tag
- If the codec is AVC, than I’m reading the package byte, and the
3 bytes of the composition time.
- I’m passing the rest of the data to the av_parser_parse2 function
- passing the parsed packet to the avcodec_send_packet function
- calling the avcodec_receive_frame every time, when getting past
the avcodec_send_packet successfully.
Upon receiving metadata ( onMetaData ) I’m reading the AMF0 object, and
creating the h264 codec according to the metadata received.
The problem is, that avcodec_send_packet mainly returns with invalid data
error message, and even if it doesn’t avcodec_receive_frame returns with
EAGAIN error message.
This code works perfectly fine when I’m feeding in encoded data from own
source ( encoding raw data from camera device ), but it fails when I’m
trying to decode data taken from RTMP stream.
What else should be read / set to configure decoding? Can anyone please
help?
Best Regards,
Attila
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20190530/b6d43535/attachment.html>
More information about the Libav-user
mailing list