shortstheory / APStreamline

Live Video Streaming Made Easy!
GNU General Public License v3.0
117 stars 35 forks source link

Add config-interval to h264parse element #7

Closed kellyschrock closed 4 years ago

kellyschrock commented 4 years ago

Adds a config-interval setting to h264parse to send SPS/PPS config frames periodically so codecs can configure.

shortstheory commented 4 years ago

Thank you for the contribution. May I know why you picked 3 seconds for the config-interval?

kellyschrock commented 4 years ago

Hi, an interval of 3 seconds is short enough to allow a codec to configure quickly when first opening the stream, but avoids sending config frames so often that they significantly increase the volume of data being transferred.

In my case, I'm using a decoder that needs SPS/PPS config frames to be sent at least once so it can configure and display the stream properly. That's not likely to be true for everyone. The real issue is that different setups call for different gstreamer configurations, which currently must be specified the way I did here, by hard-coding them as pipeline parameters in the source code.

Based on this, I think I should close this PR and come up with a more comprehensive solution, such as a way to read an external configuration file that contains the gstreamer pipeline specification, and shipping with defaults configured the way you have them here. That way, I (for example) could use config-interval=3 for my setup, and someone using a different setup could specify something else. Thoughts?

kellyschrock commented 4 years ago

This is closing in favor of one that allows an entire config to be externalized.