Streaming single image with ffmpeg

本文介绍了一种通过使用ffmpeg工具循环播放一张静态图片到Red5流媒体服务器的方法,以实现临时替代直播视频流的目的。这种方法可以避免客户端显示无限缓冲的情况,并向用户显示“视频不可用”的提示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I was asked to disable live video broadcast for a day or two. If I stop feeding into Red5 streaming service the flash player will display as if buffering for ever. Not nice for end users who will report this as an error. It would be nice to show a message say “Video not available”. I made a picture for this purpose. ffmpeg works like a charm again this time.

ffmpeg -loop 1 -i not_available.png -r 5 -vcodec libx264 -pix_fmt yuv420p -f flv rtmp://red5server:1935/live/myStream

The only trick here is the colour space which if I don’t specify will result a black background showing on flash players. This may only apply to PNG file since I didn't try JPEG but the official site recommends using this parameter when producing video from a single image.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值