thothix / guayadeque

Guayadeque is a music management program designed for all music enthusiasts. It is Full Featured Linux media player that can easily manage large collections and uses the Gstreamer media framework.
GNU General Public License v3.0
6 stars 1 forks source link

Internet radio recording #7

Open artenax opened 1 month ago

artenax commented 1 month ago

Hi. I use this player to listen and record online radio. In the settings I enabled radio recording, split into tracks (by the way, this checkbox doesn't work, the split is always performed, but I'm fine with it because it's convenient). Problems:

  1. Using Ogg Vorbis and FLAC formats leads to unreadable files after splitting (i.e. when switching tracks in the stream). Since these formats are not functional if you cut off their heads. And the player does exactly that, first encodes, then cuts by tags. I'm experimenting on this stream http://nashe1.hostingradio.ru/rock-128.mp3

  2. Using MP3 is devoid of this problem. However, I've noticed that the quality setting has no effect on the bitrate. It is always default for Lame encoder, I think V2 VBR (~120...150 kbps). I have done some debugging.

git clone --depth=1 https://github.com/thothix/guayadeque
cd guayadeque
mkdir build-dir && cd build-dir
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/guayadeque -DENABLE_IPOD=OFF -DwxWidgets_USE_DEBUG=ON
ninja
sudo ninja install
GST_DEBUG=*:4 gdb /opt/guayadeque/bin/guayadeque
run
search: quality

0:00:10.546186048 520939 0x555556f7ca40 INFO lamemp3enc gstlamemp3enc.c:921:gst_lamemp3enc_setup: lame encoder setup (target quality, quality 4,000000, bitrate 320, 44100 Hz, 2 channels)

gstreamer lame encoder always uses target quality, quality 4.0, then the bitrate is specified, but it is ignored because quality mode is used. Default lame quality is 4, which is pretty bad. I rebuilt gstreamer1.0-plugins-good (libgstlame.so) and set the default quality to 0 (ext/lame/gstlamemp3enc.c #define DEFAULT_QUALITY 0). But it's not easy and it's a hack. It's not mp3 320k, but it's close - VBR 0 (~220 kbps).

  1. Cut mp3 files have inaccurate navigation in players.

It's the most useful internet radio app under Linux though, thanks. Upd: I am using Xubuntu 22.04.

artenax commented 1 month ago

Is it possible to record radio stations without transcoding or is it not possible in gstreamer?

thothix commented 1 month ago

I need to take a look to this recording feature.