q191201771 / lal

🔥 Golang audio/video live streaming lib/client/server. support RTMP, RTSP(RTP/RTCP), HLS, HTTP[S]/WebSocket-FLV/TS, GB28181, H264/H265/AAC/G711/OPUS, relay, cluster, record, HTTP Notify/API/UI. 直播

Home Page:https://pengrl.com/lal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

网页hls 播放无音频声音

czlin opened this issue · comments

使用ffmpeg推流
ffmpeg -rtsp_transport tcp -re -stream_loop -1 -y -i "rtsp://admin:qt123123@192.168.13.51:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1" -c:v copy -acodec pcm_alaw -f flv rtmp://192.168.14.12:1935/MjYwNy0xNjkzMzYwMjk1LTE2OTMzOTA4MDA/live
或者
ffmpeg -rtsp_transport tcp -re -stream_loop -1 -y -i "rtsp://admin:qt123123@192.168.13.51:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1" -c:v copy -c:a copy -f flv rtmp://192.168.14.12:1935/MjYwNy0xNjkzMzYwMjk1LTE2OTMzOTA4MDA/live
都无法正常播放音频

ffmpeg 输出日志如下:

ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04.1)
configuration: --prefix=/usr/local/ffmpeg/ --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --extra-libs='-lpthread -lm' --bindir=/usr/local/ffmpeg/bin --enable-shared --enable-ffplay --enable-cuda --enable-cuvid --enable-nvenc --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
Input #0, rtsp, from 'rtsp://admin:qt123123@192.168.13.51:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1':
Metadata:
title : Media Presentation
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1280x720, 25 fps, 25 tbr, 90k tbn
Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (pcm_alaw (native) -> pcm_alaw (native))
Press [q] to stop, [?] for help
Output #0, flv, to 'rtmp://192.168.14.12:1935/MjYwNy0xNjkzMzYwMjk1LTE2OTMzOTA4MDA/live':
Metadata:
title : Media Presentation
encoder : Lavf60.3.100
Stream #0:0: Video: h264 (Main) ([7][0][0][0] / 0x0007), yuv420p(progressive), 1280x720, q=2-31, 25 fps, 25 tbr, 1k tbn
Stream #0:1: Audio: pcm_alaw ([7][0][0][0] / 0x0007), 8000 Hz, mono, s16, 64 kb/s
Metadata:
encoder : Lavc60.3.100 pcm_alaw
[flv @ 0x55c6389fd000] 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

使用hls播放视频正常,无音频。
使用vlc 播放rtsp://admin:qt123123@192.168.13.51:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1 是有声音的。
lalserver.conf.json 使用的是默认配置。

ts不支持g711a或者g711u,你换成aac试下