ffmpeg -re -streamloop -1 -i h264-aac-768x320.mp4 -c:v libx264 -b:v 1.5M -minrate 1M…
- User
ffmpeg -re -stream_loop -1 -i h264-aac-768x320.mp4 -c:v libx264 -b:v 1.5M -minrate 1M -maxrate 2M -bufsize 3M -r 25 -x264-params "slice-max-size=1300:ssim=1" -c:a aac -b:a 128k -ar 44100 -ac 2 -payload_type 98 -sdp_file test.sdp -f rtp -payload_type 100 rtp://192.168.1.101:8000 报错:[rtp @ 0x56322b0dad00] Only one stream supported in the RTP muxer Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Error initializing output stream 0:0 -- 期望:音频包和视频包都往8000端口推流
- Assistant
ffmpeg 不支持将音频和视频同时推送到同一个RTP端口。您需要为音频和视频分别使用不同的端口。您可以尝试将音频推送到8002端口,将视频推送到8000端口。下面是一个示例命令:
ffmpeg -re -stream_loop -1 -i h264-aac-768x320.mp4 -c:v libx264 -b:v 1.5M -minrate 1M -maxrate 2M -bufsize 3M -r 25 -x264-params "slice-max-size=1300:ssim=1" -c:a aac -b:a 128k -ar 44100 -ac 2 -sdp_file test.sdp \ -f rtp -payload_type 98 -map 0:v:0 rtp://192.168.1.101:8000 \ -f rtp -payload_type 100 -map 0:a:0 rtp://192.168.1.101:8002您可能还需要更新
test.sdp文件,以包含音频和视频流的信息。SDP 文件应具有类似于以下格式的内容:v=0 o=- 0 0 IN IP4 127.0.0.1 s=No Name c=IN IP4 192.168.1.101 t=0 0 a=tool:libavformat 58.45.100 m=video 8000 RTP/AVP 98 a=rtpmap:98 H264/90000 m=audio 8002 RTP/AVP 100 a=rtpmap:100 MPEG4-GENERIC/44100/2
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.