【发布时间】:2016-03-05 00:18:23
【问题描述】:
我正在尝试使用 libav 实现 RTSP 到 RTMP 流媒体。 “ffmpeg”命令工作正常:
ffmpeg -i "rtsp://localhost:8884/live" -vcodec copy -f rtsp "rtmp://user:password@localhost:1935/live/stream"
但是当我使用 libav 进行 RTMP 身份验证时出现错误。这些是我尝试过的方法:
avformat_alloc_output_context2(&m_outformat, NULL, "rtsp", "rtmp://user:password@localhost:1935/live/stream");
avformat_alloc_output_context2(&m_outformat, NULL, "rtsp", "rtmp://localhost:1935/live/stream?user&password");
avformat_alloc_output_context2(&m_outformat, NULL, "rtsp", "rtmp://localhost:1935/live?user&password/stream");
avformat_alloc_output_context2(&m_outformat, NULL, "rtsp", "rtmp://localhost:1935/live/stream?username=user&password=password");
avformat_alloc_output_context2(&m_outformat, NULL, "rtsp", "rtmp://localhost:1935/live?username=user&password=password/stream");
avformat_alloc_output_context2(&m_outformat, NULL, "rtsp", "rtsp://user:password@localhost:1935/live/stream")
谁能告诉我如何启用 RTMP 身份验证。
正如您在上面看到的,我们使用“rtsp”作为“format_name”,并且 URL 以“rtmp://”开头。这是因为当我们在两者中都保留“rtsp”时,“m_outformat->pb”会以 NULL 的形式出现,随后对“avio_open”的调用会出错。
【问题讨论】:
标签: authentication rtmp wowza libavcodec libav