[Libav-user] Decoding RTMP stream

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] Decoding RTMP stream

Attila Krüpl

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

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".