From ab2ffeed5a5606614744257df19f6c5889d4636b Mon Sep 17 00:00:00 2001 From: a-wing <1@233.email> Date: Thu, 25 Jul 2024 00:48:29 +0800 Subject: [PATCH] update(docs): whipinto rtp input sdp file support #140 --- docs/guide/ffmpeg.md | 25 +++++++++++++------------ docs/zh/guide/ffmpeg.md | 25 +++++++++++++------------ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/docs/guide/ffmpeg.md b/docs/guide/ffmpeg.md index b61657e7..74fd3d2f 100644 --- a/docs/guide/ffmpeg.md +++ b/docs/guide/ffmpeg.md @@ -13,24 +13,21 @@ ffmpeg -> whipinto -> live777 -> whepfrom -> ffplay Video Test Src ```bash -ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -vcodec libvpx -f rtp 'rtp://127.0.0.1:5003?pkt_size=1200' +# send RTP and Create SDP file +ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -vcodec libvpx -f rtp 'rtp://127.0.0.1:5002' -sdp_file stream.sdp ``` For ffplay. You Need a sdp file ```bash -cat > stream.sdp << EOF -v=0 -m=video 5004 RTP/AVP 96 -c=IN IP4 127.0.0.1 -a=rtpmap:96 VP8/90000 -EOF +ffplay -protocol_whitelist rtp,file,udp -i stream.sdp ``` -Use ffplay +You can use `whipinto` tools receiver RTP and convert to WebRTC -```bash -ffplay -protocol_whitelist rtp,file,udp -i stream.sdp +``` +# Use SDP file as input +whipinto -i stream.sdp -w http://localhost:7777/whip/777 ``` ## Video: VP9 @@ -40,7 +37,9 @@ Packetizing VP9 is experimental and its specification is still in draft state. P ::: ```bash -ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -strict experimental -vcodec libvpx-vp9 -f rtp 'rtp://127.0.0.1:5003?pkt_size=1200' +ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -strict experimental -vcodec libvpx-vp9 -f rtp 'rtp://127.0.0.1:5002' -sdp_file stream.sdp + +whipinto -i stream.sdp -w http://localhost:7777/whip/777 ``` ## Video: H264 @@ -48,7 +47,9 @@ ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -strict experimental -vcodec ```bash ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -vcodec libx264 \ -x264-params "level-asymmetry-allowed=1:packetization-mode=1:profile-level-id=42001f" \ --f rtp 'rtp://127.0.0.1:5003?pkt_size=1200' +-f rtp 'rtp://127.0.0.1:5002' -sdp_file stream.sdp + +whipinto -i stream.sdp -w http://localhost:7777/whip/777 ``` ## Video: AV1 diff --git a/docs/zh/guide/ffmpeg.md b/docs/zh/guide/ffmpeg.md index b61657e7..74fd3d2f 100644 --- a/docs/zh/guide/ffmpeg.md +++ b/docs/zh/guide/ffmpeg.md @@ -13,24 +13,21 @@ ffmpeg -> whipinto -> live777 -> whepfrom -> ffplay Video Test Src ```bash -ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -vcodec libvpx -f rtp 'rtp://127.0.0.1:5003?pkt_size=1200' +# send RTP and Create SDP file +ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -vcodec libvpx -f rtp 'rtp://127.0.0.1:5002' -sdp_file stream.sdp ``` For ffplay. You Need a sdp file ```bash -cat > stream.sdp << EOF -v=0 -m=video 5004 RTP/AVP 96 -c=IN IP4 127.0.0.1 -a=rtpmap:96 VP8/90000 -EOF +ffplay -protocol_whitelist rtp,file,udp -i stream.sdp ``` -Use ffplay +You can use `whipinto` tools receiver RTP and convert to WebRTC -```bash -ffplay -protocol_whitelist rtp,file,udp -i stream.sdp +``` +# Use SDP file as input +whipinto -i stream.sdp -w http://localhost:7777/whip/777 ``` ## Video: VP9 @@ -40,7 +37,9 @@ Packetizing VP9 is experimental and its specification is still in draft state. P ::: ```bash -ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -strict experimental -vcodec libvpx-vp9 -f rtp 'rtp://127.0.0.1:5003?pkt_size=1200' +ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -strict experimental -vcodec libvpx-vp9 -f rtp 'rtp://127.0.0.1:5002' -sdp_file stream.sdp + +whipinto -i stream.sdp -w http://localhost:7777/whip/777 ``` ## Video: H264 @@ -48,7 +47,9 @@ ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -strict experimental -vcodec ```bash ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -vcodec libx264 \ -x264-params "level-asymmetry-allowed=1:packetization-mode=1:profile-level-id=42001f" \ --f rtp 'rtp://127.0.0.1:5003?pkt_size=1200' +-f rtp 'rtp://127.0.0.1:5002' -sdp_file stream.sdp + +whipinto -i stream.sdp -w http://localhost:7777/whip/777 ``` ## Video: AV1