问题描述
我在node.js服务器中有RTP数据包,我想转发到ffmpeg。
我在node.js服务器端生成SDP文件,并使用SDP作为输入执行ffmpeg。
SDP:
v = 0
o = mediasoup 21881725401d4e8d56cbd79694c7e2b6e6cacb4a 0 IN IP4 192.168.193.182
s = 21881725401d4e8d56cbd79694c7e2b6e6cacb4a
c = IN IP4 192.168.193.182
t = 0 0
a =组:LS视频音频
m =视频33404 RTP / SAVPF 107
a = rtpmap:107 H264 / 90000
a = fmtp:107电平不对称允许= 1; packetization-mode = 1; profile-level-id = 42e01f
a = control:track0
a = rtcp-fb:107 ccm fir
a = rtcp-fb:107 nack
a = rtcp-fb:107 nack pli
a = rtcp-fb:107 goog-remb
a = rtcp-fb:107 transport-cc
a = extmap:2 urn:ietf:params:rtp- hdrext:toffset
a = extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a = extmap:4 urn:3gpp:video-oriented
a = extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a = extmap:6 http://www.webrtc.org/实验/ rtp-hdrext / playout-delay
a = mid:video
a = sendrecv
m = audio 33402 RTP / SAVPF 111
a = rtpmap:111 opus / 48000
a = fmtp:111 minptime = 10; useinbandfec = 1
a = control:track1
a = rtcp-fb:111 transport-cc
a = extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a = mid:audio
a = sendrecv
命令:
ffmpeg -max_delay 5000 -reorder_queue_size 16384 -protocol_whitelist文件,crypto,udp,rtp -re -i input.sdp -vcodec copy -acodec aac -y output.mp4
与RTMP相同
ffmpeg -max_delay 5000 -reorder_queue_size 16384 -protocol_whitelist文件,crypto,udp,rtp -re -i input.sdp -vcodec copy -acodec aac -f flv rtmp://127.0.0.1:1935 / live / myStream
我有奇怪的视频播放一些vido,然后卡住,然后播放一些音频,回到视频等,它不会一起播放视频和音频。
BTW,当我为vi创建单独的SDP文件音频并将它们作为两个输入流输入到相同的输出中,我获得有效的流,但音频不同步(约一秒钟)。
ffmpeg -max_delay 5000 -reorder_queue_size 16384 -protocol_whitelist文件,crypto,udp,rtp -re -i video.0.sdp -max_delay 5000 -reorder_queue_size 16384 -protocol_whitelist文件,crypto,udp,rtp -re - i audio.1.sdp -vcodec copy -acodec aac -shortest -y output.mp4
什么是我的SDP错了?
我尝试更改分析,probeize,rtbufsize,vsync,framerate,
我甚至尝试使用-map 0:v重映射流-map 0:a,
没有帮助
我也尝试使用RTSP服务器,看日志:
$ g code ffmpeg版本3.2版权所有(c)2000-2016 FFmpeg开发者
内置gcc 4.4.7(GCC)20120313(红帽4.4.7-11)
配置:--prefix = / opt / kaltura / ffmpeg-3.2 --libdir = / opt / kaltura / ffmpeg-3.2 / lib --shlibdir = / opt / kaltura / ffmp eg-3.2 / lib --extra-cflags =' - O2 -g -ipe -Wall -Wp,-D_FORTIFY_SOURCE = 2 -fexceptions -fstack-protector --param = ssp-buffer-size = 4 -m64 -mtune = generic -fPIC'--extra-cflags =' - O2 -g -ipe -Wall -Wp,-D_FORTIFY_SOURCE = 2 -fexceptions -fstack-protector --param = ssp-buffer-size = 4 -m64 -mtune = generic -fPIC -I / opt / kaltura / include'--extra-ldflags = -L / opt / kaltura / lib --disable-devices --enable-bzlib --enable-libgsm --enable-libmp3lame --enable-libschroedinger - enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-avisynth --enable-libxvid --enable-filter = movie --enable-avfilter --enable-libopencore-amrnb --enable -libopencore-amrwb --enable-libopenjpeg --enable-libvpx --enable-libspeex --enable-libass --enable-postproc --enable-pthreads --enable-static --enable-shared --enable-gpl - -disable-debug --disable-optimizations --enable-gpl --enable-pthreads --enable-swscale --enable-vdpau --enable-bzlib --disable-devices --enable-filter = movie --enable- version3 --enable-indev = lavfi --enable-x11grab
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.100 / 57. 64.100
libavformat 57. 56.100 / 57. 56.100
libavdevice 57。 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
拆分命令行。
读取选项'-loglevel'...与参数'debug'匹配为选项'loglevel'(设置日志记录级别)。
读取选项'-max_delay'...匹配为AVOption'max_delay',参数'500000'。
读取选项'-reorder_queue_size'...与参数'16384'匹配为AVOption'reorder_queue_size'。
读取选项'-analyzeduration'...与参数'2147483647'匹配为AVOption'analyzeuration'。
阅读选项'-probesize'...与参数'2147483647'匹配为AVOption'probesize'。
读取选项'-protocol_whitelist'...与参数'file,crypto,tcp,udp,rtp'匹配为AVOption'protocol_whitelist'。
读取选项'-re'...匹配为选项're'(以本机帧速率读取输入),参数为'1'。
读取选项'-i'...匹配为参数'rtsp://192.168.193.182:5000 / IcL8tHJdU9oWEK3rAAAA.sdp'的输入文件。
读取选项'-vcodec'...匹配为选项'vcodec'(强制视频编解码器('复制'复制流))与参数'h264'。
读取选项'-acodec'...匹配为选项'acodec'(强制音频编解码器('复制'复制流))与参数'aac'。
读取选项'-max_interleave_delta'...匹配为AVOption'max_interleave_delta',参数为'30000000'。
读取选项'-y'...与参数'1'匹配为选项'y'(覆盖输出文件)。
读取选项'/opt/mediasoup_sample/recordings/IcL8tHJdU9oWEK3rAAAA.mp4'...匹配为输出文件。
完成分割命令行。
解析一组选项:全局。
使用参数调试应用选项loglevel(设置日志级别)。
用参数1应用选项y(覆盖输出文件)。
成功解析了一组选项。
解析一组选项:输入文件rtsp://192.168.193.182:5000 / IcL8tHJdU9oWEK3rAAAA.sdp。
应用选项re(以本机帧速率读取输入)与参数1.
成功解析了一组选项。
打开输入文件:rtsp://192.168.193.182:5000 / IcL8tHJdU9oWEK3rAAAA.sdp。
[rtsp @ 0x19b4fa0] SDP:
v = 0
o = mediasoup IcL8tHJdU9oWEK3rAAAA 0 IN IP4 192.168.193.182
s = IcL8tHJdU9oWEK3rAAAA
c = IN IP4 192.168.193.182
t = 0 0
a =组:LS音频视频
m =音频0 RTP / SAVPF 111
a = rtpmap:111 opus / 48000
a = fmtp:111 minptime = 10; useinbandfec = 1
a = control:streamid = 0
a = rtcp-fb:111 transport-cc
a = extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a = mid:audio
a = sendrecv
a = rtcp-mux
m =视频0 RTP / SAVPF 107
a = rtpmap:107 H264 / 90000
a = fmtp:不对称允许= 1;分组化模式= 1; profile-level-id = 42e01f
a = control:streamid = 1
a = rtcp-fb:107 ccm fir
a = rtcp-fb: 107 nack
a = rtcp-fb:107 nack pli
a = rtcp-fb:107 goog-remb
a = rtcp-fb:107 transport-cc
a = extmap:2 urn: ietf:params:rtp-hdrext:toffset
a = extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a = extmap:4 urn:3gpp:视频导向
a = extmap:5 http://www.ietf.org/id/draft-holme r-rmcat-transport-wide-cc-extensions-01
a = extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a = mid:video
a = sendrecv
a = rtcp-mux
[rtsp @ 0x19b4fa0]音频编解码器设置为:opus
[rtsp @ 0x19b4fa0]音频采样设置为:48000
[rtsp @ 0x19b4fa0]音频通道设置为:1
[rtsp @ 0x19b4fa0]视频编解码器设置为:h264
[rtsp @ 0x19b4fa0] RTP打包模式:1
[rtsp @ 0x19b4fa0] RTP个人资料IDC:42个人资料IOP:e0级别:1f
[udp @ 0x19b5d60]结束接收缓冲区大小报告为131072
[udp @ 0x19ba020]结束接收缓冲区大小报告为131072
[rtsp @ 0x19b4fa0]将抖动缓冲区大小设置为16384
[udp @ 0x19b7a00]结束接收缓冲区大小报告为131072
[udp @ 0x19daca0]报告的结束接收缓冲区大小为131072
[rtsp @ 0x19b4fa0]设置抖动缓冲区大小为16384
[rtsp @ 0x19b4fa0] hello state = 0
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] nal_unit _type:5,nal_ref_idc:3
最后的消息重复3次
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0 ]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]无框!
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x19b9ac0] nal_unit_type:1,nal_ref_idc:3
最后的消息重复3次
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]无框!
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x19b9ac0] nal_unit_type:1,nal_ref_idc:3
最后的消息重复3次
...很多相同...
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]不存在PPS 0引用
[h264 @ 0x19b9ac0] decode_slice_header错误
[h264 @ 0x19b9ac0]无框!
[h264 @ 0x19b9ac0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x19b9ac0] nal_unit_type:7,nal_ref_idc:3
[h264 @ 0x19b9ac0] nal_unit_type:8,nal_ref_idc:3
[h264 @ 0x19b9ac0] nal_unit_type:5,nal_ref_idc:3
最后的消息重复3次
[h264 @ 0x19b9ac0]将上下文重新设置为640x480,pix_fmt:yuv420p
[h264 @ 0x19b9ac0] nal_unit_type :9,nal_ref_idc:0
[h264 @ 0x19b9ac0] nal_unit_type:1,nal_ref_idc:3
最后的消息重复3次
[h264 @ 0x19b9ac0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x19b9ac0] nal_unit_type:1,nal_ref_idc:3
最后的消息重复3次
[h264 @ 0x19b9ac0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x19b9ac0] nal_unit_type:1 ,nal_ref_idc:3
最后的消息重复3次
[h264 @ 0x19b9ac0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x19b9ac0] nal_unit_type:1,nal_ref_idc:3
最后消息重复3次
[h264 @ 0x19b9ac0] nal_unit_type:9,nal_ref_idc :0
[h264 @ 0x19b9ac0] nal_unit_type:1,nal_ref_idc:3
最后的消息重复3次
[h264 @ 0x19b9ac0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x19b9ac0] nal_unit_type:1,nal_ref_idc:3
最后一条消息重复3次
[rtsp @ 0x19b4fa0]发现所有信息
输入#0,rtsp,from'rtsp://192.168.193.182: 5000 / IcL8tHJdU9oWEK3rAAAA.sdp':
元数据:
标题:IcL8tHJdU9oWEK3rAAAA
持续时间:不适用,开始:0.000000,比特率:N / A
流#0:0,146 ,1/48000:音频:opus,48000 Hz,mono,fltp
流#0:1,88,1/90000:视频:h264(约束基线),1参考帧,yuv420p(渐进,左) 640x480,0 / 1,30fps,30 tbr,90k tbn,60 tbc
成功打开文件。
解析一组选项:输出文件/opt/mediasoup_sample/recordings/IcL8tHJdU9oWEK3rAAAA.mp4。
应用选项vcodec(强制视频编解码器('复制'复制流))与参数h264。
应用选项acodec(强制音频编解码器('复制'复制流))与参数aac。
成功解析了一组选项。
打开输出文件:/opt/mediasoup_sample/recordings/IcL8tHJdU9oWEK3rAAAA.mp4。
编码器'h264'的匹配编码器'libx264'。
[file @ 0x1b7bb80]设置默认白名单'文件,加密'
成功打开文件。
检测到1个逻辑内核
[图0输入从流0:1 @ 0x1b788c0]将'video_size'设置为值'640x480'
[从流0输入的图0:1 @ 0x1b788c0]设置'pix_fmt'值为'0'
[从流0输入的图0:1 @ 0x1b788c0]将'time_base'设置为'1/90000'
[从流0输入的图0:1 @ 0x1b788c0将'pixel_aspect'设置为值'0/1'
[从流0输入的图0:1 @ 0x1b788c0]将'sws_param'设置为值'flags = 2'
[从流0输入的图0 :1 @ 0x1b788c0]将'frame_rate'设置为值'30 / 1'
[从流0输入的图0:1 @ 0x1b788c0] w:640 h:480 pixfmt:yuv420p tb:1/90000 fr:30 / 1 sar:0/1 sws_param:flags = 2
[format @ 0x1a78e00] compat:使用args = [yuv420p | yuvj420p | yuv422p | yuvj422p | yuv444p | yuvj444p | nv12 | nv16]调用
[format @ 0x1a78e00]将'pix_fmts'设置为值'yuv420p | yuvj420p | yuv422p | yuvj422p | yuv444p | yuvj444p | nv12 | nv16'
[AVFilterGraph @ 0x19ba180] query_forma ts:4查询,3合并,0已经完成,0延迟
[图1从流0输入0:0 @ 0x1b89ae0]将'time_base'设置为值'1/48000'
[图1输入将sample_rate设置为值48000
[从流0输入的图1:0 @ 0x1b89ae0]将'sample_fmt'设置为值'fltp'
[图1从流0:0 @ 0x1b89ae0]将'channel_layout'设置为'0x4'
[从流0输入的图1:0 @ 0x1b89ae0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x4
[输出流的音频格式0:1 @ 0x1a7aa00]将'sample_fmts'设置为值'fltp'
[输出流0的音频格式:1 @ 0x1a7aa00]将'sample_rates'设置为值96000 | 88200 | 64000 | 4个查询,9个合并,0个已经完成,0个延迟
[h264 @ 0x1b779a0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x1b779a0] nal_unit_type :7,nal_ref_idc:3
[h264 @ 0x1b779a0] nal_unit_type:8,nal_ref_idc:3
[h264 @ 0x1b779a0]忽略使用cpu功能的extradata
[libx264 @ 0x1a6b5e0]中的NAL类型9: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x1a6b5e0] profile高,级别3.0
[libx264 @ 0x1a6b5e0] 264 - 核心140 - H.264 / MPEG-4 AVC编解码器 - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options:cabac = 1 ref = 3 deblock = 1:0:0 analyze = 0x3:0x113 me = hex subme = 7 psy = 1 psy_rd = 1.00:0.00 mixed_ref = 1 me_range = 16 chroma_me = 1 trellis = 1 8x8dct = 1 cqm = 0死区= 21,11 fast_pskip = 1 chroma_qp_offset = -2 threads = 1 lookahead_threads = 1 sliced_threads = 0 nr = 0 decimate = 1 interlaced = 0 bluray_compat = 0 constrained_intra = 0 bframe = 3 b_pyramid = 2 b_adapt = 1 b_bias = 0 direct = 1 weightb = 1 open_gop = 0 weightp = 2 keyint = 250 keyint_min = 25 scenecut = 40 intra_refresh = 0 rc_lookahead = 40 rc = crf mbtree = 1 crf = 23.0 qcomp = 0.60 qpmin = 0 qpmax = 69 qpstep = 4 ip_ratio = 1.40 aq = 1:1.00
输出#0,mp4到'/ opt / mediasoup_sample / recordin gs / IcL8tHJdU9oWEK3rAAAA.mp4':
元数据:
标题:IcL8tHJdU9oWEK3rAAAA
编码器:Lavf57.56.100
流#0:0,0,1/15360:视频:h264(libx264 ),1个参考帧([33] [0] [0] [0] / 0x0021),yuv420p(左),640x480,0 / 1,q = -1--1,30fps,15360tbn,30 tbc
元数据:
编码器:Lavc57.64.100 libx264
边数据:
cpb:bitrate max / min / avg:0/0/0缓冲区大小:0 vbv_delay:-1
流#0:1,0,1/48000:音频:aac(LC)([64] [0] [0] [0] / 0x0040),48000 Hz,mono,fltp,延迟1024,69 kb / s
元数据:
编码器:Lavc57.64.100 aac
流映射:
流#0:1 - > #0:0(h264(native))> h264(libx264))
流#0:0 - > #0:1(opus(native))> aac(native))
按[q]停止,[?]帮助
cur_dts无效(如果发生在
最后的消息重复1次
[SWR @ 0x1af80a0]在过滤器之间内部使用fltp
cur_dts是无效的(如果在每个流的开始发生一次,这是无害的)
最后的消息重复48次
[h264 @ 0x1b779a0] nal_unit_type:5,nal_ref_idc:3
最后的消息重复3次
[h264 @ 0x1b779a0]将上下文重定向到640x480,pix_fmt:yuv420p
*** 67 dup!
[libx264 @ 0x1a6b5e0] frame = 0 QP = 16.76 NAL = 3 Slice:I Poc:0 I:1200 P:0 SKIP:0 size = 29147 bytes
[libx264 @ 0x1a6b5e0] frame = 1 QP = 15.49 NAL = 2切片:P Poc:8 I:1 P:198 SKIP:1001尺寸= 588字节
...很多相同...
[libx264 @ 0x1a6b5e0] frame = 25 QP = 16.64 NAL = 2 Slice:P Poc:56 I:0 P:15 SKIP:1185 size = 72 bytes
[libx264 @ 0x1a6b5e0] frame = 26 QP = 27.00 NAL = 2切片:B Poc:52 I:0 P:18 SKIP:1182 size = 44 bytes
frame = 68 fps = 38 q = 29.0 size = 32kB time = 00:00:00.80 bitrate = 332.6kbits / s dup = 67 drop = 0 speed = 0.453x
[h264 @ 0x1b779a0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x1b779a0] nal_unit_type:1,nal_ref_idc:3
最后的消息重复3次
[h264 @ 0x1b779a0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x1b779a0] nal_unit_type:1,nal_ref_idc:3
最后的消息重复3次
...很多相同...
***从ts 0的流0中丢弃帧68
[h264 @ 0x1b779a0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x1b779a0] nal_unit_type:1,nal_ref_idc:3
最后的消息重复3次
***丢帧68 from stream 0 at ts 65
[libx264 @ 0x1a6b5e0] frame = 27 QP = 29.00 NAL = 0 Slice:B Poc:50 I:0 P:1 SKIP:1199 size = 19 bytes
[h264 @ 0x1b779a0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x1b779a0] nal_unit_type:1,nal_ref_idc:3
最后的消息重复3次
...很多相同...
[libx264 @ 0x1a6b5e0] frame = 362 QP = 24.00 NAL = 2切片:B Poc:208 I:0 P:6 SKIP:1194 size = 30 bytes
[ libx264 @ 0x1a6b5e0] frame = 363 QP = 26.00 NAL = 0 Slice:B Poc:206 I:0 P:0 SKIP:1200 size = 19 bytes
[h264 @ 0x1b779a0] nal_unit_type:1,nal_ref_idc:3
[h264 @ 0x1b779a0]隐藏880 DC,880 AC,880 MV错误在P帧
*** 1 dup!
[libx264 @ 0x1a6b5e0] frame = 364 QP = 26.00 NAL = 0 Slice:B Poc:210 I:0 P:0 SKIP:1200 size = 19 bytes
[libx264 @ 0x1a6b5e0] frame = 365 QP = 16.71 NAL = 2切片:P Poc:220 I:0 P:8 SKIP:1192 size = 51 bytes
frame = 407 fps = 16 q = 29.0 size = 306kB time = 00:00:17.48 bitrate = 143.2 kbits / s dup = 329 drop = 65 speed = 0.675x
[rtsp @ 0x19b4fa0]达到最大延迟。需要消耗数据包
[rtsp @ 0x19b4fa0] RTP:missed 2 packets
[h264 @ 0x1b779a0] nal_unit_type:9,nal_ref_idc:0
[h264 @ 0x1b779a0] nal_unit_type:1,nal_ref_idc:3
[h264 @ 0x1b779a0]隐藏920 DC,920 AC,920 MV错误在P帧
*** 1 dup!
...很多相同...
[libx264 @ 0x1a6b5e0] frame = 420 QP = 25.50 NAL = 0切片:B Poc:322 I:0 P:280 SKIP:920 size = 282 bytes
[libx264 @ 0x1a6b5e0] frame = 421 QP = 24.51 NAL = 2切片:P Poc:326 I:0 P:43 SKIP:1157 size = 112 bytes
[aac @ 0x1a79de0]尝试除了队列以外的320个样本
frame = 422 fps = 8.7 q = 29.0 Lsize = 379kB time = 00:00:17.54 bitrate = 176.7kbits / s dup = 338 drop = 65 speed = 0.36x
视频:240kB音频:123kB字幕:0kB其他流:0kB全局头文件:0kB多路复用开销:4.257356%
输入文件#0(rtsp://192.168.193.182: 5000 / IcL8tHJdU9oWEK3rAAAA.sdp)
输入流#0:0(音频):725包读取(54182字节); 725帧解码(696000个样本);
输入流#0:1(视频):读取150个数据包(203332字节); 150帧解码;
总共:875个数据包(257514个字节)复制
输出文件#0(/opt/mediasoup_sample/recordings/IcL8tHJdU9oWEK3rAAAA.mp4):
输出流#0:0(视频):422帧编码; 422个数据包复用(245681字节);
输出流#0:1(音频):680帧编码(696000个样本); 681个数据包复用(126146字节);
总共:1103个数据包(371827字节)多路复用
875帧成功解码,0个解码错误
[AVIOContext @ 0x1a6c4e0]统计:60寻找,1148写出
[libx264 @ 0x1a6b5e0] frame I:3 Avg QP:17.89 size:17026
[libx264 @ 0x1a6b5e0] frame P:120 Avg QP:18.27 size:1244
[libx264 @ 0x1a6b5e0] frame B:299 Avg QP:24.50 size: 149
[libx264 @ 0x1a6b5e0]连续B帧:4.7%1.9%1.4%91.9%
[libx264 @ 0x1a6b5e0] mb I I16..4:19.9%48.9%31.1%
[ libx264 @ 0x1a6b5e0] mb P I16..4:2.1%5.2%0.8%P16..4:10.3%1.2%0.6%0.0%0.0%跳过:79.7%
[libx264 @ 0x1a6b5e0] mb B I16 .. 4:0.1%0.1%0.0%B16..8:5.4%0.2%0.0%直接:0.8%跳过:93.5%L0:56.3%L1:43.1%BI:0.5%
[libx264 @ 0x1a6b5e0] 8x8变换内部:60.5%inter:62.3%
[libx264 @ 0x1a6b5e0]编码y,uvDC,uvAC intra:40.2%49.9%19.0%inter:0.7%3.2%0.1%
[libx264 @ 0x1a6b5e0] i16 v ,h,dc,p:26%30%9%36%
[libx264 @ 0x1a6b5e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:44%27%13%3%2%2%3%3%3%
[libx264 @ 0x1a6b5e0] dc,ddl,ddr,vr,hd,vl,hu:38%28%11%3%5%4%5%4%3%
[libx264 @ 0x1a6b5e0] i8c dc,h,v,p: 38%28%23%12%
[libx264 @ 0x1a6b5e0]加权P帧:Y:2.5%UV:2.5%
[libx264 @ 0x1a6b5e0] ref P L0:82.7%3.3%10.6%3.3 %0.0%
[libx264 @ 0x1a6b5e0] ref B L0:86.6%12.6%0.7%
[libx264 @ 0x1a6b5e0] ref B L1:96.5%3.5%
[libx264 @ 0x1a6b5e0] kb / s:139.34
[aac @ 0x1a79de0] Qavg:212.691
谢谢,
Johnathan Kanarek
显然,我的SDP或RTP数据包没有任何错误,它完全由VLC播放,我会尝试使用更高版本的ffmpeg,但显然问题是与ffmpeg。
I have RTP packets in node.js server and I want to forward them to ffmpeg.I generate SDP files in the node.js server side and execute ffmpeg with the SDP as input.
SDP:
v=0
o=mediasoup 21881725401d4e8d56cbd79694c7e2b6e6cacb4a 0 IN IP4 192.168.193.182
s=21881725401d4e8d56cbd79694c7e2b6e6cacb4a
c=IN IP4 192.168.193.182
t=0 0
a=group:LS video audio
m=video 33404 RTP/SAVPF 107
a=rtpmap:107 H264/90000
a=fmtp:107 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=control:track0
a=rtcp-fb:107 ccm fir
a=rtcp-fb:107 nack
a=rtcp-fb:107 nack pli
a=rtcp-fb:107 goog-remb
a=rtcp-fb:107 transport-cc
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=mid:video
a=sendrecv
m=audio 33402 RTP/SAVPF 111
a=rtpmap:111 opus/48000
a=fmtp:111 minptime=10;useinbandfec=1
a=control:track1
a=rtcp-fb:111 transport-cc
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=mid:audio
a=sendrecv
Command:
ffmpeg -max_delay 5000 -reorder_queue_size 16384 -protocol_whitelist file,crypto,udp,rtp -re -i input.sdp -vcodec copy -acodec aac -y output.mp4
Same with RTMP
ffmpeg -max_delay 5000 -reorder_queue_size 16384 -protocol_whitelist file,crypto,udp,rtp -re -i input.sdp -vcodec copy -acodec aac -f flv rtmp://127.0.0.1:1935/live/myStream
I get weird video that plays some vidoe, then get stuck, then plays some audio, back to video and so on, it never plays both video and audio together.
BTW, when I created separate SDP files for the video and the audio and stream them as two inputs into the same output, I get valid stream but the audio is not in sync (about a second offset).
ffmpeg -max_delay 5000 -reorder_queue_size 16384 -protocol_whitelist file,crypto,udp,rtp -re -i video.0.sdp -max_delay 5000 -reorder_queue_size 16384 -protocol_whitelist file,crypto,udp,rtp -re -i audio.1.sdp -vcodec copy -acodec aac -shortest -y output.mp4
What is wrong with my SDP?
I tried changing analyzeduration, probesize, rtbufsize, vsync, framerate,I even tried to remap the streams using -map 0:v -map 0:a,nothing helped
I also tried to use RTSP server, see log:
ffmpeg version 3.2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
configuration: --prefix=/opt/kaltura/ffmpeg-3.2 --libdir=/opt/kaltura/ffmpeg-3.2/lib --shlibdir=/opt/kaltura/ffmpeg-3.2/lib --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -I/opt/kaltura/include' --extra-ldflags=-L/opt/kaltura/lib --disable-devices --enable-bzlib --enable-libgsm --enable-libmp3lame --enable-libschroedinger --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libx265 --enable-avisynth --enable-libxvid --enable-filter=movie --enable-avfilter --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libvpx --enable-libspeex --enable-libass --enable-postproc --enable-pthreads --enable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --enable-gpl --enable-pthreads --enable-swscale --enable-vdpau --enable-bzlib --disable-devices --enable-filter=movie --enable-version3 --enable-indev=lavfi --enable-x11grab
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.100 / 57. 64.100
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-max_delay' ... matched as AVOption 'max_delay' with argument '500000'.
Reading option '-reorder_queue_size' ... matched as AVOption 'reorder_queue_size' with argument '16384'.
Reading option '-analyzeduration' ... matched as AVOption 'analyzeduration' with argument '2147483647'.
Reading option '-probesize' ... matched as AVOption 'probesize' with argument '2147483647'.
Reading option '-protocol_whitelist' ... matched as AVOption 'protocol_whitelist' with argument 'file,crypto,tcp,udp,rtp'.
Reading option '-re' ... matched as option 're' (read input at native frame rate) with argument '1'.
Reading option '-i' ... matched as input file with argument 'rtsp://192.168.193.182:5000/IcL8tHJdU9oWEK3rAAAA.sdp'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'h264'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
Reading option '-max_interleave_delta' ... matched as AVOption 'max_interleave_delta' with argument '30000000'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '/opt/mediasoup_sample/recordings/IcL8tHJdU9oWEK3rAAAA.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file rtsp://192.168.193.182:5000/IcL8tHJdU9oWEK3rAAAA.sdp.
Applying option re (read input at native frame rate) with argument 1.
Successfully parsed a group of options.
Opening an input file: rtsp://192.168.193.182:5000/IcL8tHJdU9oWEK3rAAAA.sdp.
[rtsp @ 0x19b4fa0] SDP:
v=0
o=mediasoup IcL8tHJdU9oWEK3rAAAA 0 IN IP4 192.168.193.182
s=IcL8tHJdU9oWEK3rAAAA
c=IN IP4 192.168.193.182
t=0 0
a=group:LS audio video
m=audio 0 RTP/SAVPF 111
a=rtpmap:111 opus/48000
a=fmtp:111 minptime=10;useinbandfec=1
a=control:streamid=0
a=rtcp-fb:111 transport-cc
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=mid:audio
a=sendrecv
a=rtcp-mux
m=video 0 RTP/SAVPF 107
a=rtpmap:107 H264/90000
a=fmtp:107 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=control:streamid=1
a=rtcp-fb:107 ccm fir
a=rtcp-fb:107 nack
a=rtcp-fb:107 nack pli
a=rtcp-fb:107 goog-remb
a=rtcp-fb:107 transport-cc
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=mid:video
a=sendrecv
a=rtcp-mux
[rtsp @ 0x19b4fa0] audio codec set to: opus
[rtsp @ 0x19b4fa0] audio samplerate set to: 48000
[rtsp @ 0x19b4fa0] audio channels set to: 1
[rtsp @ 0x19b4fa0] video codec set to: h264
[rtsp @ 0x19b4fa0] RTP Packetization Mode: 1
[rtsp @ 0x19b4fa0] RTP Profile IDC: 42 Profile IOP: e0 Level: 1f
[udp @ 0x19b5d60] end receive buffer size reported is 131072
[udp @ 0x19ba020] end receive buffer size reported is 131072
[rtsp @ 0x19b4fa0] setting jitter buffer size to 16384
[udp @ 0x19b7a00] end receive buffer size reported is 131072
[udp @ 0x19daca0] end receive buffer size reported is 131072
[rtsp @ 0x19b4fa0] setting jitter buffer size to 16384
[rtsp @ 0x19b4fa0] hello state=0
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] nal_unit_type: 5, nal_ref_idc: 3
Last message repeated 3 times
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] no frame!
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x19b9ac0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] no frame!
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x19b9ac0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
... a lot of the same ...
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] non-existing PPS 0 referenced
[h264 @ 0x19b9ac0] decode_slice_header error
[h264 @ 0x19b9ac0] no frame!
[h264 @ 0x19b9ac0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x19b9ac0] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x19b9ac0] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x19b9ac0] nal_unit_type: 5, nal_ref_idc: 3
Last message repeated 3 times
[h264 @ 0x19b9ac0] Reinit context to 640x480, pix_fmt: yuv420p
[h264 @ 0x19b9ac0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x19b9ac0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
[h264 @ 0x19b9ac0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x19b9ac0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
[h264 @ 0x19b9ac0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x19b9ac0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
[h264 @ 0x19b9ac0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x19b9ac0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
[h264 @ 0x19b9ac0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x19b9ac0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
[h264 @ 0x19b9ac0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x19b9ac0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
[rtsp @ 0x19b4fa0] All info found
Input #0, rtsp, from 'rtsp://192.168.193.182:5000/IcL8tHJdU9oWEK3rAAAA.sdp':
Metadata:
title : IcL8tHJdU9oWEK3rAAAA
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0, 146, 1/48000: Audio: opus, 48000 Hz, mono, fltp
Stream #0:1, 88, 1/90000: Video: h264 (Constrained Baseline), 1 reference frame, yuv420p(progressive, left), 640x480, 0/1, 30 fps, 30 tbr, 90k tbn, 60 tbc
Successfully opened the file.
Parsing a group of options: output file /opt/mediasoup_sample/recordings/IcL8tHJdU9oWEK3rAAAA.mp4.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument h264.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument aac.
Successfully parsed a group of options.
Opening an output file: /opt/mediasoup_sample/recordings/IcL8tHJdU9oWEK3rAAAA.mp4.
Matched encoder 'libx264' for codec 'h264'.
[file @ 0x1b7bb80] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 1 logical cores
[graph 0 input from stream 0:1 @ 0x1b788c0] Setting 'video_size' to value '640x480'
[graph 0 input from stream 0:1 @ 0x1b788c0] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:1 @ 0x1b788c0] Setting 'time_base' to value '1/90000'
[graph 0 input from stream 0:1 @ 0x1b788c0] Setting 'pixel_aspect' to value '0/1'
[graph 0 input from stream 0:1 @ 0x1b788c0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:1 @ 0x1b788c0] Setting 'frame_rate' to value '30/1'
[graph 0 input from stream 0:1 @ 0x1b788c0] w:640 h:480 pixfmt:yuv420p tb:1/90000 fr:30/1 sar:0/1 sws_param:flags=2
[format @ 0x1a78e00] compat: called with args=[yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16]
[format @ 0x1a78e00] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16'
[AVFilterGraph @ 0x19ba180] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[graph 1 input from stream 0:0 @ 0x1b89ae0] Setting 'time_base' to value '1/48000'
[graph 1 input from stream 0:0 @ 0x1b89ae0] Setting 'sample_rate' to value '48000'
[graph 1 input from stream 0:0 @ 0x1b89ae0] Setting 'sample_fmt' to value 'fltp'
[graph 1 input from stream 0:0 @ 0x1b89ae0] Setting 'channel_layout' to value '0x4'
[graph 1 input from stream 0:0 @ 0x1b89ae0] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x4
[audio format for output stream 0:1 @ 0x1a7aa00] Setting 'sample_fmts' to value 'fltp'
[audio format for output stream 0:1 @ 0x1a7aa00] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[AVFilterGraph @ 0x1a7a6e0] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
[h264 @ 0x1b779a0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x1b779a0] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x1b779a0] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x1b779a0] Ignoring NAL type 9 in extradata
[libx264 @ 0x1a6b5e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x1a6b5e0] profile High, level 3.0
[libx264 @ 0x1a6b5e0] 264 - core 140 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/opt/mediasoup_sample/recordings/IcL8tHJdU9oWEK3rAAAA.mp4':
Metadata:
title : IcL8tHJdU9oWEK3rAAAA
encoder : Lavf57.56.100
Stream #0:0, 0, 1/15360: Video: h264 (libx264), 1 reference frame ([33][0][0][0] / 0x0021), yuv420p(left), 640x480, 0/1, q=-1--1, 30 fps, 15360 tbn, 30 tbc
Metadata:
encoder : Lavc57.64.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream #0:1, 0, 1/48000: Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, mono, fltp, delay 1024, 69 kb/s
Metadata:
encoder : Lavc57.64.100 aac
Stream mapping:
Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:0 -> #0:1 (opus (native) -> aac (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Last message repeated 1 times
[SWR @ 0x1af80a0] Using fltp internally between filters
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Last message repeated 48 times
[h264 @ 0x1b779a0] nal_unit_type: 5, nal_ref_idc: 3
Last message repeated 3 times
[h264 @ 0x1b779a0] Reinit context to 640x480, pix_fmt: yuv420p
*** 67 dup!
[libx264 @ 0x1a6b5e0] frame= 0 QP=16.76 NAL=3 Slice:I Poc:0 I:1200 P:0 SKIP:0 size=29147 bytes
[libx264 @ 0x1a6b5e0] frame= 1 QP=15.49 NAL=2 Slice:P Poc:8 I:1 P:198 SKIP:1001 size=588 bytes
... a lot of the same ...
[libx264 @ 0x1a6b5e0] frame= 25 QP=16.64 NAL=2 Slice:P Poc:56 I:0 P:15 SKIP:1185 size=72 bytes
[libx264 @ 0x1a6b5e0] frame= 26 QP=27.00 NAL=2 Slice:B Poc:52 I:0 P:18 SKIP:1182 size=44 bytes
frame= 68 fps= 38 q=29.0 size= 32kB time=00:00:00.80 bitrate= 332.6kbits/s dup=67 drop=0 speed=0.453x
[h264 @ 0x1b779a0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x1b779a0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
[h264 @ 0x1b779a0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x1b779a0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
... a lot of the same ...
*** dropping frame 68 from stream 0 at ts 64
[h264 @ 0x1b779a0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x1b779a0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
*** dropping frame 68 from stream 0 at ts 65
[libx264 @ 0x1a6b5e0] frame= 27 QP=29.00 NAL=0 Slice:B Poc:50 I:0 P:1 SKIP:1199 size=19 bytes
[h264 @ 0x1b779a0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x1b779a0] nal_unit_type: 1, nal_ref_idc: 3
Last message repeated 3 times
... a lot of the same ...
[libx264 @ 0x1a6b5e0] frame= 362 QP=24.00 NAL=2 Slice:B Poc:208 I:0 P:6 SKIP:1194 size=30 bytes
[libx264 @ 0x1a6b5e0] frame= 363 QP=26.00 NAL=0 Slice:B Poc:206 I:0 P:0 SKIP:1200 size=19 bytes
[h264 @ 0x1b779a0] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0x1b779a0] concealing 880 DC, 880 AC, 880 MV errors in P frame
*** 1 dup!
[libx264 @ 0x1a6b5e0] frame= 364 QP=26.00 NAL=0 Slice:B Poc:210 I:0 P:0 SKIP:1200 size=19 bytes
[libx264 @ 0x1a6b5e0] frame= 365 QP=16.71 NAL=2 Slice:P Poc:220 I:0 P:8 SKIP:1192 size=51 bytes
frame= 407 fps= 16 q=29.0 size= 306kB time=00:00:17.48 bitrate= 143.2kbits/s dup=329 drop=65 speed=0.675x
[rtsp @ 0x19b4fa0] max delay reached. need to consume packet
[rtsp @ 0x19b4fa0] RTP: missed 2 packets
[h264 @ 0x1b779a0] nal_unit_type: 9, nal_ref_idc: 0
[h264 @ 0x1b779a0] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0x1b779a0] concealing 920 DC, 920 AC, 920 MV errors in P frame
*** 1 dup!
... a lot of the same ...
[libx264 @ 0x1a6b5e0] frame= 420 QP=25.50 NAL=0 Slice:B Poc:322 I:0 P:280 SKIP:920 size=282 bytes
[libx264 @ 0x1a6b5e0] frame= 421 QP=24.51 NAL=2 Slice:P Poc:326 I:0 P:43 SKIP:1157 size=112 bytes
[aac @ 0x1a79de0] Trying to remove 320 more samples than there are in the queue
frame= 422 fps=8.7 q=29.0 Lsize= 379kB time=00:00:17.54 bitrate= 176.7kbits/s dup=338 drop=65 speed=0.36x
video:240kB audio:123kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.257356%
Input file #0 (rtsp://192.168.193.182:5000/IcL8tHJdU9oWEK3rAAAA.sdp):
Input stream #0:0 (audio): 725 packets read (54182 bytes); 725 frames decoded (696000 samples);
Input stream #0:1 (video): 150 packets read (203332 bytes); 150 frames decoded;
Total: 875 packets (257514 bytes) demuxed
Output file #0 (/opt/mediasoup_sample/recordings/IcL8tHJdU9oWEK3rAAAA.mp4):
Output stream #0:0 (video): 422 frames encoded; 422 packets muxed (245681 bytes);
Output stream #0:1 (audio): 680 frames encoded (696000 samples); 681 packets muxed (126146 bytes);
Total: 1103 packets (371827 bytes) muxed
875 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x1a6c4e0] Statistics: 60 seeks, 1148 writeouts
[libx264 @ 0x1a6b5e0] frame I:3 Avg QP:17.89 size: 17026
[libx264 @ 0x1a6b5e0] frame P:120 Avg QP:18.27 size: 1244
[libx264 @ 0x1a6b5e0] frame B:299 Avg QP:24.50 size: 149
[libx264 @ 0x1a6b5e0] consecutive B-frames: 4.7% 1.9% 1.4% 91.9%
[libx264 @ 0x1a6b5e0] mb I I16..4: 19.9% 48.9% 31.1%
[libx264 @ 0x1a6b5e0] mb P I16..4: 2.1% 5.2% 0.8% P16..4: 10.3% 1.2% 0.6% 0.0% 0.0% skip:79.7%
[libx264 @ 0x1a6b5e0] mb B I16..4: 0.1% 0.1% 0.0% B16..8: 5.4% 0.2% 0.0% direct: 0.8% skip:93.5% L0:56.3% L1:43.1% BI: 0.5%
[libx264 @ 0x1a6b5e0] 8x8 transform intra:60.5% inter:62.3%
[libx264 @ 0x1a6b5e0] coded y,uvDC,uvAC intra: 40.2% 49.9% 19.0% inter: 0.7% 3.2% 0.1%
[libx264 @ 0x1a6b5e0] i16 v,h,dc,p: 26% 30% 9% 36%
[libx264 @ 0x1a6b5e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 44% 27% 13% 3% 2% 2% 3% 3% 3%
[libx264 @ 0x1a6b5e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 28% 11% 3% 5% 4% 5% 4% 3%
[libx264 @ 0x1a6b5e0] i8c dc,h,v,p: 38% 28% 23% 12%
[libx264 @ 0x1a6b5e0] Weighted P-Frames: Y:2.5% UV:2.5%
[libx264 @ 0x1a6b5e0] ref P L0: 82.7% 3.3% 10.6% 3.3% 0.0%
[libx264 @ 0x1a6b5e0] ref B L0: 86.6% 12.6% 0.7%
[libx264 @ 0x1a6b5e0] ref B L1: 96.5% 3.5%
[libx264 @ 0x1a6b5e0] kb/s:139.34
[aac @ 0x1a79de0] Qavg: 212.691
Thanks,Johnathan Kanarek
Apparently there is nothing wrong in my SDP or in the RTP packets, it plays perfectly by VLC, I'll try to use a higher version of ffmpeg but obviously the issue is with ffmpeg.
这篇关于使用SDP流式传输RTP数据包到ffmpeg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!