deep5050 / radio-active

Play any radios around the globe right from the terminal :zap:
https://www.radio-browser.info/#/
MIT License
497 stars 25 forks source link

Could not connect to the station - Protocol not found #81

Closed izmailoff closed 11 months ago

izmailoff commented 11 months ago

Describe the bug Can't play some stations due to protocol issues. NOTE this is not a problem with radio-active but rather with ffmpeg configuration I faced. I thought it will be useful for others if they face same problems. You can see resolution below and close this issue.

To Reproduce Steps to reproduce the behavior:

Playing some station with debug logging shows the problem and the URL we can use to test:

Type the result ID to play: 1
     ...    | Selected: {'changeuuid': '39b0ea90-9bf6-491f-8e22-2969e0689bd5', 'stationuuid': '18ab1514-a53b-4f44-936e-f8583a68b5aa', 'serveruuid': '977da0f8-e0af-434e-a3f1-0d1517402cb1', 'name': '__TECHNO__ by rautemusik.fm', 'url': 'https://streams.rautemusik.fm/techno/mp3-192/?ref=radiobrowser', 'url_resolved': 'https://rautemusik-de-hz-fal-stream14.radiohost.de/rautemusik-techno_mp3-192?ref=radiobrowser', 'homepage': 'https://rm.fm/techno', 'favicon': 'https://i.postimg.cc/tTwRg418/techno.jpg', 'tags': 'ambient techno,deep techno,dub techno,hard techno,house techno,minimal techno,techno', 'country': 'Germany', 'countrycode': 'DE', 'iso_3166_2': None, 'state': 'North Rhine-Westphalia', 'language': 'deutsch fränkisch,english,german', 'languagecodes': 'de,en', 'votes': 55, 'lastchangetime': '2023-07-30 20:21:33', 'lastchangetime_iso8601': '2023-07-30T20:21:33Z', 'codec': 'MP3', 'bitrate': 192, 'hls': 0, 'lastcheckok': 1, 'lastchecktime': '2023-10-18 09:40:39', 'lastchecktime_iso8601': '2023-10-18T09:40:39Z', 'lastcheckoktime': '2023-10-18 09:40:39', 'lastcheckoktime_iso8601': '2023-10-18T09:40:39Z', 'lastlocalchecktime': '2023-10-18 09:40:39', 'lastlocalchecktime_iso8601': '2023-10-18T09:40:39Z', 'clicktimestamp': '2023-10-18 20:31:47', 'clicktimestamp_iso8601': '2023-10-18T20:31:47Z', 'clickcount': 68, 'clicktrend': 1, 'ssl_error': 0, 'geo_lat': 50.46100111599232, 'geo_long': 8.261718750000002, 'has_extended_info': False}
     ...    | Searching API for: 18ab1514-a53b-4f44-936e-f8583a68b5aa
      i     | Station found: __TECHNO__ by rautemusik.fm
     ...    | {
     ...    |    "changeuuid": "39b0ea90-9bf6-491f-8e22-2969e0689bd5",
     ...    |    "stationuuid": "18ab1514-a53b-4f44-936e-f8583a68b5aa",
     ...    |    "serveruuid": "977da0f8-e0af-434e-a3f1-0d1517402cb1",
     ...    |    "name": "__TECHNO__ by rautemusik.fm",
     ...    |    "url": "https://streams.rautemusik.fm/techno/mp3-192/?ref=radiobrowser",
     ...    |    "url_resolved": "https://rautemusik-de-hz-fal-stream14.radiohost.de/rautemusik-techno_mp3-192?ref=radiobrowser",
     ...    |    "homepage": "https://rm.fm/techno",
     ...    |    "favicon": "https://i.postimg.cc/tTwRg418/techno.jpg",
     ...    |    "tags": "ambient techno,deep techno,dub techno,hard techno,house techno,minimal techno,techno",
     ...    |    "country": "Germany",
     ...    |    "countrycode": "DE",
     ...    |    "iso_3166_2": null,
     ...    |    "state": "North Rhine-Westphalia",
     ...    |    "language": "deutsch fr\u00e4nkisch,english,german",
     ...    |    "languagecodes": "de,en",
     ...    |    "votes": 55,
     ...    |    "lastchangetime": "2023-07-30 20:21:33",
     ...    |    "lastchangetime_iso8601": "2023-07-30T20:21:33Z",
     ...    |    "codec": "MP3",
     ...    |    "bitrate": 192,
     ...    |    "hls": 0,
     ...    |    "lastcheckok": 1,
     ...    |    "lastchecktime": "2023-10-18 09:40:39",
     ...    |    "lastchecktime_iso8601": "2023-10-18T09:40:39Z",
     ...    |    "lastcheckoktime": "2023-10-18 09:40:39",
     ...    |    "lastcheckoktime_iso8601": "2023-10-18T09:40:39Z",
     ...    |    "lastlocalchecktime": "2023-10-18 09:40:39",
     ...    |    "lastlocalchecktime_iso8601": "2023-10-18T09:40:39Z",
     ...    |    "clicktimestamp": "2023-10-18 20:31:47",
     ...    |    "clicktimestamp_iso8601": "2023-10-18T20:31:47Z",
     ...    |    "clickcount": 68,
     ...    |    "clicktrend": 1,
     ...    |    "ssl_error": 0,
     ...    |    "geo_lat": 50.46100111599232,
     ...    |    "geo_long": 8.261718750000002,
     ...    |    "has_extended_info": false
     ...    | }
     ...    | increased click count for: 18ab1514-a53b-4f44-936e-f8583a68b5aa
     ...    | player: url => https://streams.rautemusik.fm/techno/mp3-192/?ref=radiobrowser
     ...    | FFplay: /usr/local/bin/ffplay
     ...    | player: ffplay => PID 1111707 initiated
     ...    | Saving the current station: {'name': '__TECHNO__ by rautemusik.fm', 'uuid_or_url': 'https://streams.rautemusik.fm/techno/mp3-192/?ref=radiobrowser'}
     ...    | Dumping station information
╭─────────────────────────────────────── 📻 ────────────────────────────────────────╮
│                            __TECHNO__ by rautemusik.fm                            │
╰───────────────────────────────────────────────────────────────────────────────────╯
      i     | Press '?' to see available commands
Enter a command to perform an action: 
    [!!!]   | Could not connect to the station
     ...    | https://streams.rautemusik.fm/techno/mp3-192/?ref=radiobrowser: Protocol not found
    [!!!]   | Protocol not found
     ...    | Radio is not currently playing
     ...    | You pressed Ctrl+C!
     ...    | Stopping the radio
      i     | Exiting now

Expected behavior Supposed to play the station but gives an error

Screenshots NA (use text :))

Desktop (please complete the following information): Software version is not important.

Reproduce with FFMPEG

ffplay https://streams.rautemusik.fm/techno/mp3-192/?ref=radiobrowser
ffplay version N-112066-gced62a0c01 Copyright (c) 2003-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
  configuration: --enable-shared --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-cuvid --enable-nvdec --enable-nvenc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-libsrt --enable-libx264 --enable-encoder=libx264 --enable-libx265 --enable-encoder=libx265 --enable-gpl --enable-libvpx --enable-libvorbis --enable-libopus --enable-libfdk-aac --enable-ffplay
  libavutil      58. 24.100 / 58. 24.100
  libavcodec     60. 26.100 / 60. 26.100
  libavformat    60. 12.101 / 60. 12.101
  libavdevice    60.  2.101 / 60.  2.101
  libavfilter     9. 11.100 /  9. 11.100
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
https protocol not found, recompile FFmpeg with openssl, gnutls or securetransport enabled.
https://streams.rautemusik.fm/techno/mp3-192/?ref=radiobrowser: Protocol not found
    nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   

Useful error from FFMPEG above. Perhaps this can be communicated to the end-user by capturing stderr?

Solution

Either make sure you have FFMPEG installed with all libraries, protocols as needed or recompile from source.

I recompiled FFMPEG with SSL support and it works:

ffplay https://streams.rautemusik.fm/techno/mp3-192/?ref=radiobrowser
ffplay version N-111376-g13ef5025e3 Copyright (c) 2003-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
  configuration: --enable-shared --enable-nonfree --enable-cuda-nvcc --enable-libnpp --enable-cuvid --enable-nvdec --enable-nvenc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-libsrt --enable-libx264 --enable-encoder=libx264 --enable-libx265 --enable-encoder=libx265 --enable-gpl --enable-libvpx --enable-libvorbis --enable-libopus --enable-libfdk-aac --enable-openssl --enable-ffplay
  libavutil      58. 14.100 / 58. 14.100
  libavcodec     60. 22.100 / 60. 22.100
  libavformat    60. 10.100 / 60. 10.100
  libavdevice    60.  2.101 / 60.  2.101
  libavfilter     9.  8.102 /  9.  8.102
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
Input #0, mp3, from 'https://streams.rautemusik.fm/techno/mp3-192/?ref=radiobrowser':
  Metadata:
    icy-br          : 192
    icy-genre       : Melodic Techno, Dark Techno, Acid Techno, Hard Techno
    icy-name        : techno
    icy-url         : rm.fm
    icy-audio-info  : channels=2;samplerate=44100;bitrate=192
    icy-pub         : 1
    icy-description : Unspecified description
    StreamTitle     : Cherry Bomb - Eclipse
  Duration: N/A, start: 0.000000, bitrate: 192 kb/s
  Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 192 kb/s
  17.82 M-A:  0.000 fd=   0 aq=   24KB vq=    0KB sq=    0B f=0/0 

Example of a compilation script:

ffmpeg_compile.sh

Remove/add some options as needed.

#!/bin/bash

cuda_ver="12.2"

export PATH=/usr/local/cuda-$cuda_ver/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/cuda-$cuda_ver/targets/x86_64-linux/lib/:$LD_LIBRARY_PATH

make clean

./configure --enable-shared --enable-nonfree --enable-cuda-nvcc  --enable-libnpp --enable-cuvid --enable-nvdec --enable-nvenc --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --enable-libsrt --enable-libx264 --enable-encoder=libx264 --enable-libx265 --enable-encoder=libx265 --enable-gpl --enable-libvpx --enable-libvorbis --enable-libopus --enable-libfdk-aac --enable-openssl --enable-ffplay

make -j `nproc`

Then:

sudo make install

Hope this helps

github-actions[bot] commented 11 months ago

Hi, @izmailoff, Thanks for your contribution :blue_heart: . Contributors :people_holding_hands: like you make the open source community :earth_africa: such an amazing place to learn :book: , inspire :angel:, and create :art: . We will investigate :eyes: and get back to you as soon as possible :+1: . Just make sure you have given us sufficient information :information_source:.

By that time enjoy this meme :point_down: , hope you like it :smile:

meme

Use this action on your projects. Use jokes on issues instead.