【问题标题】:Record stream using SDP file & ffmpeg使用 SDP 文件和 ffmpeg 录制流
【发布时间】:2019-11-13 09:41:48
【问题描述】:

我使用以下命令使用 ffmpeg 创建了一个流:

ffmpeg -re -thread_queue_size 4 -i video.mp4 -strict -2 -vcodec copy -an -f rtp rtp://127.0.0.1:51372 -sdp_file test.sdp

这会在通过 RTP 流式传输本地视频文件时创建一个 .sdp 文件。

SDP 文件:

v=0
o=- 0 0 IN IP4 127.0.0.1
s=Serenity - HD DVD Trailer
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat 58.29.100
m=video 51372 RTP/AVP 96
b=AS:4674
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z2QAKaw05QFAFuhAAZdOwExLQCPGDEWA,aO68sA==; profile-level-id=640029

现在我想使用另一个 ffmpeg 实例来记录这个流并保存到一个文件中(假设它是网络中的另一台机器)。

我尝试了以下命令,但它给出了错误。

ffmpeg -i test.sdp -c copy -flags +global_header -f segment -segment_time 60 -protocol_whitelist file,udp,rtp -segment_format_options movflags=+faststart -reset_timestamps 1 test.mp4

错误:

Protocol 'rtp' not on whitelist 'file,crypto'!
custom.sdp: Invalid data found when processing input

【问题讨论】:

    标签: ffmpeg


    【解决方案1】:

    您可以尝试添加-protocol_whitelist file,crypto,udp,rtp。我不确定在哪里放置这些参数,但 ffmpeg 似乎依赖于这些东西。

    问候 约阿希姆

    【讨论】:

      猜你喜欢
      • 2021-03-15
      • 1970-01-01
      • 2012-05-07
      • 2017-08-11
      • 2014-09-24
      • 1970-01-01
      • 2018-04-18
      • 2012-03-04
      • 2015-11-22
      相关资源
      最近更新 更多