【发布时间】:2015-11-22 19:33:19
【问题描述】:
我正在使用 rtp 和 ffmpeg 使用此命令流式传输实时视频:
ffmpeg -re -f v4l2 -framerate 30 -video_size 640x480 -i /dev/video0 -c:v libx265 -tune zerolatency -s 320x240 -preset ultrafast -pix_fmt yuv420p -r 10 -strict experimental -f rtp rtp://127.0.0.1:49170 > ffmpeg.sdp
生成的sdp文件为:
v=0 o=- 0 0 IN IP4 127.0.0.1 s=No Name c=IN IP4 127.0.0.1 t=0 0 a=tool:libavformat 56.36.100 m=video 49170 RTP/AVP 96 a=rtpmap:96 H265/9000
Vlc 给出以下错误:
无法检测到“file:///home/username/ffmpeg.sdp”的格式。详情请查看日志。
终端出现以下错误:
[0xaf801010] ps demux error: cannot peek
[0xaf801010] mjpeg demux error: cannot peek
[0xaf801010] mpgv demux error: cannot peek
[0xaf801010] ps demux error: cannot peek
[0xb6d00618] main input error: no suitable demux module for `file/:///home/username/ffmpeg.sdp'
如果我只是在命令中更改 libx265 -> libx264 和 H265 -> H264,则流运行得非常好。
但是我需要在 H265 上进行流式传输。有什么建议吗?
【问题讨论】:
-
显然在 FFmpeg (ffmpeg.org/pipermail/ffmpeg-devel/2014-September/163213.html) 和 VLC (patches.videolan.org/patch/4313) 中都添加了对
HEVC而非RTP的支持。即使使用ffplay也无法播放ffmpeg输出,因此可能存在某种回归。我删除了我的答案,因为很明显版本不是问题。 -
您是否尝试使用我发布的命令?并复制场景。
-
是的,
ffplay失败,[hevc @ 0x7fe4f80049e0] Error parsing NAL unit #0. [hevc @ 0x7fe4f80049e0] PPS id out of range: 00KB sq= 0B f=0/0 [sdp @ 0x7fb1a40008c0] decoding for stream 0 failed [sdp @ 0x7fb1a40008c0] Could not find codec parameters for stream 0 (Video: hevc, none): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options ffmpeg.sdp: could not find codec parameters
标签: ffmpeg video-streaming vlc h.265