Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1129383
  • 博文数量: 188
  • 博客积分: 1156
  • 博客等级: 少尉
  • 技术积分: 2173
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-16 15:01
个人简介

go!go!go!

文章分类

全部博文(188)

文章存档

2024年(2)

2023年(11)

2022年(13)

2021年(15)

2020年(38)

2019年(3)

2018年(6)

2016年(1)

2015年(16)

2014年(13)

2013年(24)

2012年(46)

分类: LINUX

2021-01-14 11:39:25

Streaming a simple RTP audio stream from FFmpeg?



FFmpeg can stream a single stream using the RTPprotocol. In order to avoid buffering problems on the otherhand, the streaming should be done through the -re option, whichmeans that the stream will be streamed in real-time (i.e. it slowsit down to simulate a live streaming source.


For example the following command will generate a signal, andwill stream it to the port 1234 on localhost:



点击(此处)折叠或打开

  1. ffmpeg -re -f lavfi -i aevalsrc="sin(400*2*PI*t)" -ar 8000 -f mulaw -f rtp rtp://127.0.0.1:1234


To play the stream with ffplay, run the command:

点击(此处)折叠或打开

  1. ffplay rtp://127.0.0.1:1234


Note that rtp by default uses UDP, which, for large streams, cancause packet loss. See the "point to point" section in thisdocument for hints if this ever happens to you.

阅读(5680) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~