Stream H264 using live555 and FFmpeg
Asked Answered
W

1

5

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

Whisky answered 6/6, 2014 at 2:28 Comment(0)
M
9

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.

Marcosmarcotte answered 13/6, 2014 at 1:47 Comment(1)
the sample links just saved me from killing my self !!Recto

© 2022 - 2024 — McMap. All rights reserved.