Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stream H264 using live555 and FFmpeg

I am trying to stream data encoded using FFMPEg using live555. I have a custom framesource that sends the data to sink but I am unable to figure out how to set SPS and PPS in the framer. I understand that extradata contains this information but I saw only SPS in that. Does extradata changes while encoding by FFMPeg? If yes how and when we need to update this information in live555 framer.

Does anyone have a working sample using FFMpeg and live555 to stream H264

like image 327
sarbjitsingh Avatar asked Jun 06 '14 02:06

sarbjitsingh


1 Answers

Live555 is simply a streaming tool, it does not do any encoding.

The SPS and PPS are NAL units within the encoded H264 stream (or the output from your FFMPEG implementation) (see some info here: http://www.cardinalpeak.com/blog/the-h-264-sequence-parameter-set/).

If you want to change the SPS or PPS information you need to do it in FFMPEG.

Examples of FFMPEG and Live555 working together to stream MPG2 and H264 streams are here:
https://github.com/alm865/FFMPEG-Live555-H264-H265-Streamer/

As for streaming a H264 stream, you need to break the output from FFMPEG into NAL units before you send if off to the discrete framer for it to work correctly. You must also strip the leading and trailing NAL bits from the packet (i.e. remove the NAL identifier 0x00 0x00 0x00 0x01).

Live555 will automatically read these in and update as necessary.

like image 147
ALM865 Avatar answered Oct 07 '22 06:10

ALM865