我使用gstreamer通过RTP发送H.264字节流。如何使rtpjitterbuffer在没有时间戳的流上工作?
# sender
gst-launch-1.0 filesrc location=my_stream.h264 ! h264parse disable-passthrough=true ! rtph264pay config-interval=10 pt=96 ! udpsink host=localhost port=5004
然后我接收帧,解码并在其他gstreamer实例中显示。
# receiver
gst-launch-1.0 udpsrc port=5004 ! application/x-rtp,payload=96,media="video",encoding-name="H264",clock-rate="90000" ! rtph264depay ! h264parse ! decodebin ! xvimagesink
这样工作,但我想尝试添加一个rtpjitterbuffer为了完美平滑播放。
# receiver
gst-launch-1.0 udpsrc port=5004 ! application/x-rtp,payload=96,media="video",encoding-name="H264",clock-rate="90000" ! rtpjitterbuffer ! rtph264depay ! h264parse ! decodebin ! xvimagesink
但是,只要我这样做,接收器只显示一个帧并冻结。
如果我用MP4文件替换.h264文件,播放效果很好。
我假设我的h264流没有所需的时间戳来启用抖动缓冲器的功能。
我通过添加identity datarate=1000000
取得了轻微进展。这允许jitterbuffer播放,但是这与我的帧率有关,因为P帧比I帧少。很明显,identity
元素添加了正确的时间戳,但只是错误的数字。
是否可以通过在某处正确指定“帧率”大小来自动为发件人生成时间戳?到目前为止,我的尝试没有奏效。
随着身份元素的到位,您是否尝试“调整”抖动缓冲区上的“延迟”? –