[FFmpeg-user] Writing H.264 data to a file

Austin Einter austin.einter at gmail.com
Tue Apr 3 10:35:03 EEST 2018

In  a call, I am receiving H.264 data in RTP packet.
I need to write it to a mkv file to and then I should be able to play it
using ffmpeg.

It looks that I am always getting single NAL unit in RTP packet.
My understanding is, I need to remove RTP packetization data (rfc 6184),
and remove immediate next byte (F | NRI | TYPE), and then write remaining
data to file prefixed with 0x00 0x00 00x1.

After I prepare buffer, then I use av_write_xxx apis to write it using

The resultant file, I am not able to play.

Kindly help me by pointing whats wrong here.


More information about the ffmpeg-user mailing list