使用 ffmpeg 为清单文件插入 SPS、PPS 值

问题描述 投票:0回答:1

我从没有设置 SPS/PPS 参数的 Axis 相机的 RTSP 流中捕获了一堆 ts 段。

因此我无法播放 ts 片段。

尝试使用 ffplay 播放时出现以下错误。

[NULL @ 0x109813830] non-existing PPS 0 referenced
[h264 @ 0x117f0a360] non-existing PPS 0 referenced
[h264 @ 0x117f0a360] decode_slice_header error
[h264 @ 0x117f0a360] no frame!

有没有办法通过在每个 IDR 帧之前插入 sprop 参数(SPS/PPS)来恢复视频?

有办法恢复这些ts段吗?我如何在每个 IDR 之前添加 SPS/PPS?

我也尝试用 gstreamer 做到这一点,但没有运气。

gst-launch-1.0 filesrc location=0.ts ! tsdemux name=demux demux. ! \
 h264parse config-interval=-1 ! mpegtsmux name=mux ! filesink location=0_gstfix.ts demux. ! mux.

非常感谢您的帮助!

ffmpeg gstreamer
1个回答
0
投票

如果你有 sprop 参数集,你可以用 rtph264pay 做到这一点:

gst-launch-1.0 filesrc location=0.ts ! tsdemux ! rtph264pay ! 'application/x-rtp,encoding-name=H264,sprop-parameter-sets=(string)"<your_sprop_parameter_sets>"' ! rtph264depay ! h264parse ! mpegtsmux ! filesink location=0_gstfix.ts
© www.soinside.com 2019 - 2024. All rights reserved.