2022-11-20, 02:50 PM
Hello,
I'm wondering if anyone can offer a bit of guidance on this one. I am working on a project to make an FM radio tuner input for NextPVR, but in an effort to keep it simple I'm intending to make it look like an IPTV device. Maybe best if I describe the idea first.
What I'm trying to achieve is something similar to NextPVR's own method of http://nextpvr:8866/live?channel=1 , such that a channel (frequency) can be requested, and the response is an MPEG-TS stream. I believe that NextPVR is using VLC to create the stream?
I am using a Raspberry Pi with an FM radio tuner IC attached to it (Si4703). The R Pi will listen for http requests formatted in such a way that the URL requested contains the frequency the radio IC should tune to. I have this part largely working as expected. For example, tuning to http://radio-pi:80/freq=878 tunes to 87.8 MHz.
The output of the FM radio IC is line level analogue audio, and I am feeding this into a USB soundcard. I can run FFMPEG to capture this and create an MPEG-TS stream, and listen to this using VLC on another computer.
I'm wondering, can anyone give me guidance on how to respond to the http request with the MPEG-TS stream? At the moment, the URL request just sends back a very basic HTML page. I am familiar enough with starting another program from Python, but how do I redirect the output of FFMPEG back to the client making the tuning request?
I'm programming in Python. I'm happy to switch to VLC on the server to create the MPEG-TS steam (or any other tool) should there be an easier way to crack this nut!
Thank you
I'm wondering if anyone can offer a bit of guidance on this one. I am working on a project to make an FM radio tuner input for NextPVR, but in an effort to keep it simple I'm intending to make it look like an IPTV device. Maybe best if I describe the idea first.
What I'm trying to achieve is something similar to NextPVR's own method of http://nextpvr:8866/live?channel=1 , such that a channel (frequency) can be requested, and the response is an MPEG-TS stream. I believe that NextPVR is using VLC to create the stream?
I am using a Raspberry Pi with an FM radio tuner IC attached to it (Si4703). The R Pi will listen for http requests formatted in such a way that the URL requested contains the frequency the radio IC should tune to. I have this part largely working as expected. For example, tuning to http://radio-pi:80/freq=878 tunes to 87.8 MHz.
The output of the FM radio IC is line level analogue audio, and I am feeding this into a USB soundcard. I can run FFMPEG to capture this and create an MPEG-TS stream, and listen to this using VLC on another computer.
I'm wondering, can anyone give me guidance on how to respond to the http request with the MPEG-TS stream? At the moment, the URL request just sends back a very basic HTML page. I am familiar enough with starting another program from Python, but how do I redirect the output of FFMPEG back to the client making the tuning request?
I'm programming in Python. I'm happy to switch to VLC on the server to create the MPEG-TS steam (or any other tool) should there be an easier way to crack this nut!
Thank you
"It's better than a box!"