Y
Y
Yaroslav2015-11-20 15:32:17
PHP
Yaroslav, 2015-11-20 15:32:17

How can I save a radio broadcast from another site on my server?

Good day dear!
There is a radio broadcast: bfm.hostingradio.ru:8004/fm
I need to create a web application where the user can save the broadcast at a certain time to my web server. Due to the lack of experience, it is very difficult to understand how to organize the server way to save the broadcast. Can someone come across such projects, please tell me how it could be done? I will be very grateful!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ernest Faizullin, 2015-11-20
@erniesto77

See how the php-ffmpeg module is used, I think this is what you need. Converts, manages bitrate and other audio/video settings. After installation on the server, you can use it through exec or shell_exec, here is an example
or connect the PHP-FFMpeg/PHP-FFMpeg library and work in the usual object style, specifying the path to ffmpeg and ffprobe on the server in the options, here is an example

$ffmpeg = FFMpeg\FFMpeg::create();
$audio = $ffmpeg->open('track.mp3');

$format = new FFMpeg\Format\Audio\Flac();
$format->on('progress', function ($audio, $format, $percentage) {
    echo "$percentage % transcoded";
});

$format
    -> setAudioChannels(2)
    -> setAudioKiloBitrate(256);

$audio->save($format, 'track.flac');

Good luck in this difficult task)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question