0

I have a php page which runs ffmpeg from shell with the exec() function as follows ffmpeg -i rtsp://address:port/stream -b:v 512k output.mp4 and since many people could visit the page at once it could fire up many ffmpeg processes for different rtsp streams simultaneously which will eat up my bandwidth. Is there some way for me to reduce the bitrate at which the streams are opened?

Note: I assumed the bitrate is the most effective factor for reducing bandwidth, please correct me if you have any better suggestions.

Xeno Boss
  • 39
  • 7
  • you can reduce the 512k value, but that will impact quality. does each asset have to be unique, or could you create a single asset (that can then be cached/buffered) or instead push your stream to a platform like Azure Media Services which is designed for live streams at scale? – Offbeatmammal Feb 23 '18 at 01:04
  • If I reduce the 512k bitrate wouldn't that only affect the bitrate of the output file ? because I am trying to limit the bitrate at which my server is going to read data from the input so as to consume less bandwidth fetching the video from the rtsp stream. – Xeno Boss Feb 23 '18 at 02:34
  • ah, yeah, if you're opening one output for each visitor and encoding from the source stream, unless you throttle that at source you'll be consuming full bandwidth on the input side. Best to look at using a platform better designed for this – Offbeatmammal Feb 23 '18 at 10:32
  • Isn't there anything that can be done to reduce the bitrate of the source from ffmpeg itself ? Thank you for reccomending it but using an existing commercial product for this is not really a viable option for me at the moment. – Xeno Boss Feb 23 '18 at 15:06
  • no ffmpeg will take the stream as is. unless you can reduce the bitrate from the source itself it will be difficult. why do you need a stream for every user? – Offbeatmammal Feb 23 '18 at 22:01
  • So that means I will have to amp up the bandwidth no way around it... the purpose of the application is to access a stream specified by the user. – Xeno Boss Feb 24 '18 at 12:05

0 Answers0