Skip to content

Commit

Permalink
update(docs): whipinto rtp input sdp file support #140
Browse files Browse the repository at this point in the history
  • Loading branch information
a-wing committed Jul 24, 2024
1 parent 09096fc commit ab2ffee
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
25 changes: 13 additions & 12 deletions docs/guide/ffmpeg.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -40,15 +37,19 @@ 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

```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
Expand Down
25 changes: 13 additions & 12 deletions docs/zh/guide/ffmpeg.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -40,15 +37,19 @@ 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

```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
Expand Down

0 comments on commit ab2ffee

Please sign in to comment.