Shopping Cart
FiveM script How to Stream non ogg radio to js radio resource

[How-to] Stream non ogg radio to js radio resource – Modding Tutorials

FiveM Modding Tutorial

Hi,

A little tuto to explain to you a little interesting trick allowing you to stream non-ogg radios to ogg supported by the js radio resource on windows or linux server.

Links:

1 – Install Icecast2 from https://icecast.org/download/
edit the config file icecast2.xml ( C:Program Files (x86)Icecast2Icecast.xml or /etc/icecast2/icecast.xml )
Define the main parameters <location>,<admin> and <hostname> (optional), <sources> is the number of stream to serve, and clients the max client allowed to listen on your server.
Change the <admin-user> and <admin-password> at your convenience (not leave defaut).
Define a hard and useless <relay-password> (not leave defaut).
Define a hard <source-password> which you will need later.
Finally uncomment the line <binddd-adress> and change it from:

<!-- <bind-address>127.0.0.1</bind-address> -->

To

<bind-address>0.0.0.0</bind-address>

Possibly if you want to change the default port which is 8000 …
After that, start icecast with the .bat include with the config file on windows, on linux depending on your installation, /etc/init.d/icecast2 restart or …

2 – Download and extract/install ffmpeg
On windows you need to have the bin/ffmpeg.exe. On linux you need to install it with your distro depot or use a static build to have the binary ffmpeg.

In both cases, the command is almost identical. Create a new text file, .bat on windows, .sh on linux and place the code below, by adapting ‘your_source_password’,‘http://url_from_other_radio/stream.mp3’ and ‘your_radio_name’ parameters
On windows:

a:
ffmpeg -i http://url_from_other_radio/stream.mp3 -c:a libvorbis -q:a 1 -content_type application/ogg -f ogg icecast://source:[email protected]:8000/your_radio_name.ogg
goto a:

On linux:

#!/bin/bash
while true do
ffmpeg -i http://url_from_other_radio/stream.mp3 -c:a libvorbis -q:a 1 -content_type application/ogg -f ogg icecast://source:[email protected]:8000/your_radio_name.ogg
end

Adapt the path of the executable if necessary to it and run this command file. On linux make it executable with chmod +x radio.sh.
Normally, ffmpeg should transcode from the original radio format to ogg in quality fully supported by our GTA =)
Listenable here: http://127.0.0.1:8000/your_radio_name.ogg

FFmpeg may return errors if there are issues such as:
401 – wrong source password with icecast server
libvorbis not supported, under linux depending on your distribution you may need to look for the name of the library allowing you to transcode to ogg.
Remember to open port 8000 on your server.
You can also watch the streams being broadcast at http://127.0.0.1:8000/status.xsl

So, in js radio, the url for your radio to set is http://your_server_address:8000/your_radio_name.ogg

And you can replay as many as you want by recreating a command file, just change the broadcast name at the end of the icecast address (your_radio_name.ogg) and the source url to another radio to stream. Think to edit the icecast.xml if you want to stream more than 5 sources

In case of problems always say, if ever I can help I would!



Original source: https://forum.cfx.re/t/how-to-stream-non-ogg-radio-to-js-radio-resource/1691368

Leave a Reply

Your email address will not be published. Required fields are marked *

FiveM ESX Scripts

The best scripts and maps

Best support

Problems? We are there to help!

Wide range of products

We have a wide range of products

100% Secure Checkout

Stripe

About

Are you creating a FiveM server? Here are the best scripts for it – for a cheap price and a very good quality! Don’t waste time testing and fixing free scripts. Use our premium FiveM scripts.

ESX Scripts is a Network for FiveM Scripts | FiveM Store | FiveM Mods | FiveM Scripts | FiveM EUP | FiveM Cheats | FiveM AntiCheats | FiveM Vehicles | FiveM Cars | FiveM Maps | FiveM Discord | FiveM Clothes | FiveM Launcher | FiveM Servers | FiveM.NeT | FiveM | FiveM RP | FiveM RolePlay | FiveM USA | FiveM Europe | FiveM EU | gta5 store | GTA Role Play | GTA RP | GTA RP | FiveM Asia | FiveM World | FiveM GTA | fivem-store.com | FiveM Tools FiveM Hosting | FiveM Shop | CitizenFX Collective | FiveM CFX, ESX Scripts A global network that aims to strengthen fivem.net roleplay servers. And it’s just to improve the quality of the servers.  We hope we can get your opinion just to improve the quality of your server. You can get maps, vehicles, scripts, eup, tools, etc… right on our shop website!

Help

Need help with a product? Our sellers offer good support. Free for you! Click here to get help.

Are you a creator?

We are looking for people that want to sell their scripts and maps (of FiveM) in our store. Click here to register and sell.

Weekend-Sale
Only this weekend
x