以下命令通过 UDP 传输音频时遇到问题,是否缺少参数?
ffmpeg -f alsa -ac 1 -i hw:1 -ar 44100 -f mpegts udp://10.255.255.255:10000?pkt_size=1316
服务器识别它,这里是一个tcpdump
端口10000
:
IP 10.255.255.255.54260 > 10.255.255.253.10000: UDP, length 1316
IP 10.255.255.255.54260 > 10.255.255.253.10000: UDP, length 1316
IP 10.255.255.255.54260 > 10.255.255.253.10000: UDP, length 940
IP 10.255.255.255.54260 > 10.255.255.253.10000: UDP, length 1316
IP 10.255.255.255.54260 > 10.255.255.253.10000: UDP, length 1316
在查看了WireShark:
source destination protocol size description
192 kb/s 44.1 kHz MPEG-1 1358 Audio Layer 3[Malformed Packet]
10.255.255.255 10.255.255.253 MPEG TS 1358 Source port: 46947 Destination port: distinct
我一直在关注本教程。
答案1
这是有效的命令:
ffmpeg -f alsa -i hw:1 -acodec libvo_aacenc -f mpegts udp://10.255.255.255:9999?pkt_size=1316