注意:提问前,请先看FAQ(Please read FAQ before file an issue) #2716
描述(Description)
描述你遇到了什么问题(Please description your issue here)
- SRS版本(Version):
srs-4.0.198
- SRS的日志如下(Log):
[1970-01-01 09:36:21.998][Trace][418][p7u6j85b] XCORE-SRS/4.0.198(Leo)
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] config parse complete
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] write log to console
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b][MAIN] SRS/4.0.198(Leo), MIT
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] authors: https://github.com/ossrs/srs/blob/4.0release/trunk/AUTHORS.txt
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] contributors: Winlin<winlin@vip.126.com> Winlin<winterserver@126.com> Winlin<chengli.ycl@alibaba-inc.com> Wenjie<zhaowenjie@tal.com> Wenjie<740936897@qq.com> Wenjie<wenjie.zhao@chinacache.com> xiangcheng.liu<liuxc0116@foxmail.com> naijia.liu<youngcow@youngcow.net> alcoholyi<alcoholyi@qq.com> byteman<wangchen2011@gmail.com> chad.wang<chad.wang.cn@gmail.com> suhetao<suhetao@gmail.com> Johnny<fengjihu@163.com> karthikeyan<keyanmca@gmail.com> StevenLiu<lq@chinaffmpeg.org> zhengfl<zhengfl_1989@126.com> tufang14<breadbean1449@gmail.com> allspace<allspace@gmail.com> niesongsong<nie950@gmail.com> rudeb0t<nimrod@themanxgroup.tw> CallMeNP<np.liamg@gmail.com> synote<synote@qq.com> lovecat<littlefawn@163.com> panda1986<542638787@qq.com> YueHonghui<hongf.yue@hotmail.com> ThomasDreibholz<dreibh@simula.no> JuntaoLiu<juntliu@gmail.com> RocFang<fangpeng1986@gmail.com> MakarovYaroslav<yaroslav.makarov.97@mail.ru> MirkoVelic<mvelic@inoxx.net> HuiZhang(huzhang2)<huzhang2@cisco.com> OtterWa<simpleotter23@gmail.com> walkermi<172192667@qq.com> haofz<fuzhuang.hao@vhall.com> ME_Kun_Han<hanvskun@hotmail.com> ljx0305<ljx0305@gmail.com> cenxinwei<censhanhe@163.com> StarBrilliant<m13253@hotmail.com> xubin<xubin@chnvideo.com> intliang<yintiliang@gmail.com> flowerwrong<sysuyangkang@gmail.com> YLX<568414379@qq.com> J<guotaojiang@qq.com> Harlan<hailiang@gvrcraft.com> hankun<hankun@bravovcloud.com> JonathanBarratt<jonathan.barratt@gmail.com> KeeganH<keeganwharris@gmail.com> StevenLiu<lingjiujianke@gmail.com> liuxc0116<liuxc0116@gmail.com> ChengdongZhang<lmajzcd@sina.com> lovacat<lovecat@china.sina.com> qiang.li<qiang.li@verycdn.com.cn> HungMingWu<u9089000@gmail.com> Himer<xishizhaohua@qq.com> XiaLixin<xialixin@kanzhun.com> XiaLixin<68469352@qq.com> XiaLixin<xlx0625@163.com> XiaLixin<xialx@yuntongxun.com> alphonsetai<tyh_123@163.com> Michael.Ma<wnpllr@gmail.com> lam2003<linmin3@yy.com> ShiWei<shiwei05@kuaishou.com> ShiWei<shi.weibd@hotmail.com> XiaofengWang<wasphin@gmail.com> XiaoZhihong<hondaxiao@tencent.com> XiaoZhihong<xiaozhihong8@gmail.com> XiaoZhihong<xiaozhihong@huya.com> yanghuiwen<cainiaodj@qq.com> WuPengqiang<309554135@qq.com> WuPengqiang<pengqiang.wpq@alibaba-inc.com> l<22312935+lam2003@github> xfalcon<x-falcon@github> ChenGuanghua<jinxue.cgh@alibaba-inc.com> ChenGuanghua<chengh_math@126.com> LiPeng<mozhan.lp@alibaba-inc.com> LiPeng<lipeng19811218@gmail.com> yajun18<yajun18@staff.sina.com.cn> liulichuan<liulichuan@kuaishou.com> yapingcat<caoyapingneu@163.com> chenchengbin<chenchengbin@yy.com> ChenHaibo<495810242@qq.com> ChenHaibo<nmgchenhaibo@foxmail.com> jasongwq<jasongwq@gmail.com> yinjiaoyuan<yinjiaoyuan@163.com> PieerePi<pihuibin@hotmail.com> JesseXi<jesse.jinjin@wo.cn> PieerePi<40780488+PieerePi@github> ghostsf<ghost_sf@163.com> xbpeng121<53243357+xbpeng121@github> johzzy<hellojinqiang@gmail.com> stone<bluestn@163.com> cfw11<34058899+cfw11@github> Hung-YiChen<gaod.chen@gmail.com> long<liyalong12345@126.com> matthew1838<77285055+matthew1838@github> rise<rise.worlds@outlook.com>
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] cwd=/mytest/srs, work_dir=./, build: 2021-12-20 09:03:37, configure: --cross-build --cc=aarch64-linux-gnu-gcc --cxx=aarch64-linux-gnu-g++ --ar=aarch64-linux-gnu-ar --ld=aarch64-linux-gnu-ld --randlib=aarch64-linux-gnu-randlib, uname: Linux a-virtual-machine 5.4.0-87-generic #98~18.04.1-Ubuntu SMP Wed Sep 22 10:45:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux, osx: 0
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] configure detail: --prefix=/usr/local/srs --hls=on --hds=off --dvr=on --ssl=on --https=on --ssl-1-0=off --ssl-local=off --sys-ssl=off --transcode=on --ingest=on --stat=on --http-callback=on --http-server=on --stream-caster=on --http-api=on --utest=off --cherrypy=off --srt=off --rtc=on --simulator=off --cxx11=off --cxx14=off --ffmpeg-fit=on --nasm=on --srtp-nasm=on --clean=on --gperf=off --gmc=off --gmd=off --gmp=off --gcp=off --gprof=off --static=off --shared-st=off --shared-srt=off --shared-ffmpeg=off --log-verbose=off --log-info=off --log-trace=on --gcov=off --debug=off --debug-stats=off --cross-build=on --arch=aarch64 --host=aarch64-linux-gnu --cross-prefix=aarch64-linux-gnu- --cc=aarch64-linux-gnu-gcc --cxx=aarch64-linux-gnu-g++ --ar=aarch64-linux-gnu-ar --ld=aarch64-linux-gnu-ld --randlib=aarch64-linux-gnu-randlib
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] srs checking config...
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] ips, iface[0] eno0 ipv4 0x11043 192.168.142.100, iface[1] swp1 ipv4 0x11043 192.168.2.1, iface[2] eno0 ipv6 0x11043 fe80::382b:93ff:fea4:bf78%eno0, iface[3] eno2 ipv6 0x11043 fe80::8056:14ff:fe53:8e15%eno2, iface[4] swp1 ipv6 0x11043 fe80::8056:14ff:fe53:8e15%swp1
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] devices, intranet eno0 192.168.142.100, intranet swp1 192.168.2.1, intranet eno0 fe80::382b:93ff:fea4:bf78%eno0, intranet eno2 fe80::8056:14ff:fe53:8e15%eno2, intranet swp1 fe80::8056:14ff:fe53:8e15%swp1
[1970-01-01 09:36:21.999][Warn][418][p7u6j85b][2] stats network use index=0, ip=192.168.142.100, ifname=eno0
[1970-01-01 09:36:21.999][Warn][418][p7u6j85b][2] stats disk not configed, disk iops disabled.
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] write log to console
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] features, rch:on, dash:on, hls:on, hds:off, srt:off, hc:on, ha:on, hs:on, hp:on, dvr:on, trans:on, inge:on, stat:on, sc:on
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] SRS on aarch64(crossbuild), conf:rtmp2rtc.conf, limit:1000, writev:1024, encoding:little-endian, HZ:100
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] mw sleep:350ms. mr enabled:on, default:0, sleep:350ms
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] gc:on, pq:30000ms, cscc:[0,16), csa:on, tn:on(may hurts performance), ss:auto(guess by merged write)
[1970-01-01 09:36:21.999][Trace][418][p7u6j85b] system default latency(ms): mw(0-350) + mr(0-350) + play-queue(0-30000)
[1970-01-01 09:36:21.999][Warn][418][p7u6j85b][2] SRS/4.0.198 is not stable
[1970-01-01 09:36:22.014][Trace][418][p7u6j85b] fingerprint=3B:0D:96:65:2F:C8:2C:22:0A:D4:13:43:BA:68:DD:EC:49:53:92:74:50:1E:CC:39:42:8B:A5:47:70:1A:56:67
[1970-01-01 09:36:22.014][Trace][418][p7u6j85b] CircuitBreaker: enabled=1, high=2x90, critical=1x95, dying=5x99
[1970-01-01 09:36:22.014][Trace][418][p7u6j85b] http flv live stream, vhost=__defaultVhost__, mount=[vhost]/[app]/[stream].flv
[1970-01-01 09:36:22.014][Trace][418][p7u6j85b] http: root mount to ./objs/nginx/html
[1970-01-01 09:36:22.014][Trace][418][p7u6j85b] server main cid=p7u6j85b, pid=418, ppid=401, asprocess=0
[1970-01-01 09:36:22.014][Trace][418][p7u6j85b] write pid=418 to ./objs/srs.pid success!
[1970-01-01 09:36:22.014][Trace][418][p7u6j85b] RTMP listen at tcp://0.0.0.0:1935, fd=6
[1970-01-01 09:36:22.015][Trace][418][p7u6j85b] HTTP-API listen at tcp://0.0.0.0:1985, fd=7
[1970-01-01 09:36:22.015][Trace][418][p7u6j85b] HTTP-Server listen at tcp://0.0.0.0:8080, fd=8
[1970-01-01 09:36:22.015][Trace][418][p7u6j85b] signal installed, reload=1, reopen=10, fast_quit=15, grace_quit=3
[1970-01-01 09:36:22.015][Trace][418][p7u6j85b] http: api mount /console to ./objs/nginx/html/console
[1970-01-01 09:36:22.015][Trace][418][p7u6j85b] rtc listen at udp://0.0.0.0:8000, fd=9
[1970-01-01 09:36:22.015][Trace][418][404384kk] Hybrid cpu=0.00%,11MB
[1970-01-01 09:36:22.015][Warn][418][03362712][22] use private address as ip: 192.168.142.100, ifname=eno0
[1970-01-01 09:36:22.015][Trace][418][03362712] Startup query id=97fdf2921e2211b2b951253e38a1d56f, eip=192.168.142.100, wait=562s
[1970-01-01 09:36:22.015][Trace][418][0g75y1ua] TCP: connection manager run, conns=0
[1970-01-01 09:36:22.016][Trace][418][97z43td0] UDP #9 LISTEN at 0.0.0.0:8000, SO_SNDBUF(default=212992, expect=10485760, actual=425984, r0=0), SO_RCVBUF(default=212992, expect=10485760, actual=425984, r0=0)
[1970-01-01 09:36:22.016][Trace][418][33v3s691] RTC: connection manager run, conns=0
[1970-01-01 09:36:26.994][Trace][418][404384kk] Hybrid cpu=0.00%,11MB
[1970-01-01 09:36:28.993][Trace][418][00228f89] RTMP client ip=192.168.142.100:41518, fd=10
[1970-01-01 09:36:29.000][Trace][418][00228f89] complex handshake success
[1970-01-01 09:36:29.000][Trace][418][00228f89] connect app, tcUrl=rtmp://192.168.142.100:1935/live/livestream, pageUrl=, swfUrl=, schema=rtmp, vhost=192.168.142.100, port=1935, app=live/livestream, args=null
[1970-01-01 09:36:29.000][Trace][418][00228f89] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=128, out.chunk=128
[1970-01-01 09:36:29.001][Trace][418][00228f89] client identified, type=fmle-publish, vhost=192.168.142.100, app=live/livestream, stream=2, param=, duration=0ms
[1970-01-01 09:36:29.001][Trace][418][00228f89] connected stream, tcUrl=rtmp://192.168.142.100:1935/live/livestream, pageUrl=, swfUrl=, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live/livestream, stream=2, param=, args=null
[1970-01-01 09:36:29.001][Trace][418][00228f89] new source, stream_url=/live/livestream/2
[1970-01-01 09:36:29.001][Trace][418][00228f89] source url=/live/livestream/2, ip=192.168.142.100, cache=1, is_edge=0, source_id=/
[1970-01-01 09:36:29.001][Trace][418][00228f89] new source, stream_url=/live/livestream/2
[1970-01-01 09:36:29.007][Trace][418][00228f89] RTC bridge from RTMP, rtmp2rtc=1, keep_bframe=0, merge_nalus=0
[1970-01-01 09:36:29.008][Trace][418][00228f89] ignore disabled exec for vhost=__defaultVhost__
[1970-01-01 09:36:29.008][Trace][418][00228f89] http: mount flv stream for sid=/live/livestream/2, mount=/live/livestream/2.flv
[1970-01-01 09:36:29.008][Trace][418][00228f89] start publish mr=0/350, p1stpt=20000, pnt=5000, tcp_nodelay=0
[1970-01-01 09:36:29.008][Trace][418][00228f89] got metadata, width=2560, height=1440, vcodec=7, acodec=10
[1970-01-01 09:36:29.008][Trace][418][00228f89] 44B video sh, codec(7, profile=Main, level=5, 2560x1440, 0kbps, 0.0fps, 0.0s)
[1970-01-01 09:36:29.008][Trace][418][00228f89] 4B audio sh, codec(10, profile=LC, 1channels, 0kbps, 16000HZ), flv(16bits, 2channels, 44100HZ)
推流、拉流成功,用rtc-player播放,视频正常,音频杂声;用srs-player视频、音频正常;dvr抓下来的flv的视频、音频正常。
- SRS的配置如下(Config):
listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
http_api {
enabled on;
listen 1985;
}
stats {
network 0;
}
rtc_server {
enabled on;
listen 8000;
# @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate
candidate $CANDIDATE;
}
vhost __defaultVhost__ {
dvr {
enabled on;
dvr_path /disk/[2006]/[01]/[02]-[15].[04].[05].[999].flv;
dvr_plan segment;
dvr_duration 30;
dvr_wait_keyframe on;
#time_jitter full;
}
rtc {
enabled on;
# @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtmp-to-rtc
rtmp_to_rtc on;
# @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtc-to-rtmp
rtc_to_rtmp on;
# keep_bframe on;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
}
重现(Replay)
重现Bug的步骤(How to replay bug?)
./objs/srs -c rtmp2rtc.conf
ffmpeg 推流指令: ffmpeg -rtsp_transport tcp -i "rtsp://admin:12345678@192.168.1.64:554/cam/realmonitor?channel=1&subtype=0" -c copy -f flv -r 25 rtmp://192.168.142.100:1935/live/livestream
日志:
ffmpeg version N-104861-g7fe5c7f02d Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
configuration: --prefix=. --enable-cross-compile --cross-prefix=aarch64-linux-gnu- --arch=arm64 --target-os=linux --pkg-config-flags=--static --pkg-config=pkg-config --pkgconfigdir=/disk2/nxp/build_def --shlibdir=lib --extra-cflags=-I/disk2/nxp/build_def/include --extra-ldflags=-L/disk2/nxp/build_def/lib --extra-libs='-lpthread -lm' --enable-static --enable-pic --disable-doc --enable-gpl --enable-nonfree --enable-hardcoded-tables --enable-openssl --enable-libaom --enable-libfdk-aac --enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-libvpx --enable-libx264 --enable-libx265
libavutil 57. 11.100 / 57. 11.100
libavcodec 59. 14.100 / 59. 14.100
libavformat 59. 10.100 / 59. 10.100
libavdevice 59. 0.101 / 59. 0.101
libavfilter 8. 20.100 / 8. 20.100
libswscale 6. 1.101 / 6. 1.101
libswresample 4. 0.100 / 4. 0.100
libpostproc 56. 0.100 / 56. 0.100
Input #0, rtsp, from 'rtsp://admin:bst12345678@192.168.2.64:554/Streaming/Channels/101':
Metadata:
title : Media Presentation
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 2560x1440, 25 fps, 25 tbr, 90k tbn
Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp
Output #0, flv, to 'rtmp://192.168.142.100:1935/live/livestream/2':
Metadata:
title : Media Presentation
encoder : Lavf59.10.100
Stream #0:0: Video: h264 (Main) ([7][0][0][0] / 0x0007), yuvj420p(pc, bt709, progressive), 2560x1440, q=2-31, 25 fps, 25 tbr, 1k tbn
Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 16000 Hz, mono, fltp
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[flv @ 0xaaab02445ac0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[flv @ 0xaaab02445ac0] Failed to update header with correct duration.972.9kbits/s speed=1.08x
[flv @ 0xaaab02445ac0] Failed to update header with correct filesize.
frame= 444 fps= 27 q=-1.0 Lsize= 17304kB time=00:00:17.78 bitrate=7971.0kbits/s speed=1.07x
video:17230kB audio:60kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.079371%
3、浏览器访问 http://192.168.142.100:8080/players/rtc_player.html?autostart=true
期望行为(Expect)
描述你期望发生的事情(Please describe your expectation)
9条答案
按热度按时间6jygbczu1#
RTSP的音频编码:
这个编解码估计RTC会有点问题,RTMP和FLV问题不大。
ua4mk5z42#
@2653248604 可以把你的dvr录制下来的视频单独用ffmpeg推流测试一下是否有问题吗?你这个原始流我没法测试。我按照你的音频编码格式测试没法复现。
我这里播放正常。
vom3gejh3#
我用dvr录制的视频来推也是音频杂音
./ffmpeg -re -i ../01-00.20.44.241.flv -acodec aac -ar 16000 -ac 1 -vcodec copy -f flv rtmp://192.168.142.100:1935/live/livestream
另外,我把录的视频用vlc或迅雷播放是ok的,dvr录制的视频有27M,无法上传,是否有其他方式传输给你,看下你那边是否能用? 我用的是arm64平台,srs、ffmpeg都是重新编译的,但按我理解,rtc用的是srs进行内部aac解码后转为opus?ffmpeg似乎只是直接copy码流,应该没有进行编解码? srs编译指令:./configure --cross-build \ --cc=aarch64-linux-gnu-gcc --cxx=aarch64-linux-gnu-g++ \ --ar=aarch64-linux-gnu-ar --ld=aarch64-linux-gnu-ld \ --randlib=aarch64-linux-gnu-randlib
ffmpeg编译指令:PKG_CONFIG_PATH=/disk2/nxp/build_def/lib/pkgconfig ./configure \ --prefix=. \ --enable-cross-compile \ --cross-prefix=aarch64-linux-gnu- \ --arch=arm64 \ --target-os=linux \ --pkg-config-flags="--static" \ --pkg-config=pkg-config \ --pkgconfigdir="/disk2/nxp/build_def" \ --shlibdir=lib \ --extra-cflags="-I/disk2/nxp/build_def/include" \ --extra-ldflags="-L/disk2/nxp/build_def/lib" \ --extra-libs="-lpthread -lm" \ --enable-static \ --enable-pic \ --disable-doc \ --enable-gpl \ --enable-nonfree \ --enable-hardcoded-tables \ --enable-openssl \ --enable-libaom \ --enable-libfdk-aac \ --enable-libopus \ --enable-libsvtav1 \ --enable-libdav1d \ --enable-libvpx \ --enable-libx264 \ --enable-libx265 \ --enable-libvmaf
xcitsw884#
如果原始流直接推RTMP播放都有杂音,那就和RTC无关。
排查方向应该是直接把原始流录下来看看。
r6vfmomb5#
不是的,我上面的实验是指把抓下来的dvr文件重新推流后,用vlc播放rtmp以及用srs-player播放都是正常的(音视频),唯独用rtc-player播放,音频有问题,是完全听不出音频,感觉像是采样频率不匹配的杂音…
------------------ 原始邮件 ------------------ 发件人: "ossrs/srs" ***@***.***>; 发送时间: 2021年12月27日(星期一) 中午11:18 ***@***.***>; ***@***.******@***.***>; 主题: Re: [ossrs/srs] RTSP2RTMP2RTC: RTMP和DVR声音正常,RTC声音有杂音 (Issue #2810) 如果原始流直接推RTMP播放都有杂音,那就和RTC无关。 排查方向应该是直接把原始流录下来看看。 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: ***@***.***>
ltqd579y6#
另外补充一下,我另外用其他的电影视频(h264+aac)推流,现象也是一样的(rtmp ok,rtc 音频不ok),rtsp来自海康和大华,他们的acc都是单声道,16000Hz采样率
1dkrff037#
@2653248604 能够给个下载链接或者网盘啥的,我先用你的文件测试一下看看,我看看在mac上是不是表现一样
5uzkadbs8#
https://pan.baidu.com/s/1PHyEe2_4iD0JtFbzV_irDQ  ; 提取码: bac9…
------------------ 原始邮件 ------------------ 发件人: "ossrs/srs" ***@***.***>; 发送时间: 2022年1月4日(星期二) 晚上9:51 ***@***.***>; ***@***.******@***.***>; 主题: Re: [ossrs/srs] RTSP2RTMP2RTC: RTMP和DVR声音正常,RTC声音有杂音 (Issue #2810) @2653248604 能够给个下载链接或者网盘啥的,我先用你的文件测试一下看看,我看看在mac上是不是表现一样 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: ***@***.***>
e5nszbig9#
看来是真遇到了问题,哈哈哈。