简体   繁体   English

使用live555和FFmpeg流H264

[英]Stream H264 using live555 and FFmpeg

I am trying to stream data encoded using FFMPEg using live555. 我正在尝试使用live555流式传输使用FFMPEg编码的数据。 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. 我有一个自定义帧源,将数据发送到接收器,但我无法弄清楚如何在成帧器中设置SPS和PPS。 I understand that extradata contains this information but I saw only SPS in that. 我知道extradata包含这些信息,但我只看到了SPS。 Does extradata changes while encoding by FFMPeg? 在FFMPeg编码时,extradata是否会更改? If yes how and when we need to update this information in live555 framer. 如果是,我们需要在live555 framer中更新此信息。

Does anyone have a working sample using FFMpeg and live555 to stream H264 有没有人使用FFMpeg和live555来传输H264的工作样本

Live555 is simply a streaming tool, it does not do any encoding. Live555只是一个流媒体工具,它不做任何编码。

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/ ). SPS和PPS是编码的H264流中的NAL单元(或FFMPEG实现的输出)(请参阅以下信息: 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. 如果要更改SPS或PPS信息,则需要在FFMPEG中进行更改。

Examples of FFMPEG and Live555 working together to stream MPG2 and H264 streams are here: FFMPEG和Live555协同工作以流式传输MPG2和H264流的示例如下:
https://github.com/alm865/FFMPEG-Live555-H264-H265-Streamer/ 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. 至于流式传输H264流,您需要将FFMPEG的输出分解为NAL单元,然后再将其发送到离散成帧器以使其正常工作。 You must also strip the leading and trailing NAL bits from the packet (ie remove the NAL identifier 0x00 0x00 0x00 0x01). 您还必须从数据包中去除前导和尾随NAL位(即删除NAL标识符0x00 0x00 0x00 0x01)。

Live555 will automatically read these in and update as necessary. Live555将自动读取这些内容并根据需要进行更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM