After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 320233 - Allow saving of iradio streams
Allow saving of iradio streams
Status: RESOLVED OBSOLETE
Product: rhythmbox
Classification: Other
Component: Internet Radio
0.9.x
Other All
: Normal enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 370543 439940 505212 565461 (view as bug list)
Depends on: 595163
Blocks: 517485
 
 
Reported: 2005-10-30 12:59 UTC by pavel
Modified: 2018-05-24 10:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A very quick implemention of a python based recorder plugin (2.82 KB, application/x-compressed-tar)
2007-12-09 19:30 UTC, Martin Szulecki
Details
A very quick implemention of a python based recorder plugin (3.89 KB, application/x-compressed-tar)
2007-12-10 22:50 UTC, Martin Szulecki
Details

Description pavel 2005-10-30 12:59:32 UTC
it would be nice if there was a "save stream" option in the context menu, if
streamripper is detected, which ask for a folder and the automatize the
following steps:

1. call "streamripper <url> -r -d <location>
2. connect to "http://localhost:8000"
Comment 1 James "Doc" Livingston 2006-02-07 02:45:42 UTC
We don't need streamripper for this. All we would need to do is insert a tee element into the pipeline and connect a file sink to it. We should be ble to do this at runtime, without disruption (yay for gstreamer!).

Retitling bug to reflect that we don't need streamripper.
Comment 2 Jonathan Matthew 2006-11-04 21:49:37 UTC
*** Bug 370543 has been marked as a duplicate of this bug. ***
Comment 3 Martin Szulecki 2007-12-09 19:30:09 UTC
Created attachment 100657 [details]
A very quick implemention of a python based recorder plugin

A simple and ugly plugin which uses the tee functionality to save anything rhythmbox plays back and thus the iradio stream to a mp3 on the user's desktop.

It can be extracted in ~/.gnome2/rhythmbox/plugins/ for testing.

Some notes:
- It uses lame, id3v2mux and gnomevfssink here (make sure they are installed) but preferably it should use the currently selected encoding profile preference

- Splitting the continuous recording to individual tracks would be nice but not sure how to do it properly upon a "entry-extra-metadata-notify::rb:stream-song-title" since setting properties (such as location) on the filesinks requires less than PAUSED pipeline state; perhaps this requires writing a custom sink...

- add_tee/remove_tee causes a short "zap" (it skips) due to pipeline state change and general async issues during playback "Failed to pause pipeline before eee insertion". I guess it should use the tee signals to fix this?

- The "id3v2mux" element should preferably pick up tags and magically copy them to the output file, however this fails right now with "(rhythmbox:14181): GStreamer-CRITICAL **: gst_tag_list_foreach: assertion `GST_IS_TAG_LIST (list)' failed"; setting tags manually from the rhythmdb entry seems a bit wrong here (?)

- currently allows to save anything RB plays back, should we limit it to the streaming sources (it can record stuff from MagnaTune...)?

- it might be interesting to grab the data directly before decoding it in order to save processing, but that requires some kind of data tee API in RB

Perhaps using the RB encoder code could be of use here, too.

Help and comments appreciated.
Comment 4 Jonathan Matthew 2007-12-09 22:11:35 UTC
(In reply to comment #3)
> - Splitting the continuous recording to individual tracks would be nice but not
> sure how to do it properly upon a
> "entry-extra-metadata-notify::rb:stream-song-title" since setting properties
> (such as location) on the filesinks requires less than PAUSED pipeline state;
> perhaps this requires writing a custom sink...

I haven't looked at the code at all, but assuming you have a pipeline something like this:

tee ! queue ! audioconvert ! audioresample ! lame ! id3v2mux ! sink

if you place the lame ! id3v2mux ! sink bits in a bin, you should be able to block the audioresample src pad, unlink the bin, send an EOS event into it, set it to NULL state, change the location on the sink, set it to READY, send the new tag information into it, set it to PLAYING state, relink it to the audioresample, then unblock the audioresample src pad.  Or something like that, anyway.

> - add_tee/remove_tee causes a short "zap" (it skips) due to pipeline state
> change and general async issues during playback "Failed to pause pipeline
> before eee insertion". I guess it should use the tee signals to fix this?

No, rb-player-gst should use pad blocking to insert tees, rather than changing the pipeline state.

> - The "id3v2mux" element should preferably pick up tags and magically copy them
> to the output file, however this fails right now with "(rhythmbox:14181):
> GStreamer-CRITICAL **: gst_tag_list_foreach: assertion `GST_IS_TAG_LIST (list)'
> failed"; setting tags manually from the rhythmdb entry seems a bit wrong here
> (?)

I'm not exactly sure about this, but I think it needs to receive the tag information before it pushes its first buffer (as id3v2 tags are placed at the start of the file).  You'll probably need to set at least some tag information yourself (album = stream name, perhaps).
Comment 5 Martin Szulecki 2007-12-10 22:48:35 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > - Splitting the continuous recording to individual tracks would be nice but not
> > sure how to do it properly upon a
> > "entry-extra-metadata-notify::rb:stream-song-title" since setting properties
> > (such as location) on the filesinks requires less than PAUSED pipeline state;
> > perhaps this requires writing a custom sink...
> 
> I haven't looked at the code at all, but assuming you have a pipeline something
> like this:
> 
> tee ! queue ! audioconvert ! audioresample ! lame ! id3v2mux ! sink
> 
> if you place the lame ! id3v2mux ! sink bits in a bin, you should be able to
> block the audioresample src pad, unlink the bin, send an EOS event into it, set
> it to NULL state, change the location on the sink, set it to READY, send the
> new tag information into it, set it to PLAYING state, relink it to the
> audioresample, then unblock the audioresample src pad.  Or something like that,
> anyway.
> 

Thanks, doing that blocking and state change on the encoding bin worked even without unlinking.

Now new tracks for streaming sources (iradio) are correctly written into a new files.

> > - The "id3v2mux" element should preferably pick up tags and magically copy them
> > to the output file, however this fails right now with "(rhythmbox:14181):
> > GStreamer-CRITICAL **: gst_tag_list_foreach: assertion `GST_IS_TAG_LIST (list)'
> > failed"; setting tags manually from the rhythmdb entry seems a bit wrong here
> > (?)
> 
> I'm not exactly sure about this, but I think it needs to receive the tag
> information before it pushes its first buffer (as id3v2 tags are placed at the
> start of the file).  You'll probably need to set at least some tag information
> yourself (album = stream name, perhaps).
> 

If I debug the id3v2mux element using "GST_DEBUG=taglibmux:5" I can see that only the following tags are "received" from Rhythmbox:

0:01:15.454808000 11088 0xaffd20d0 LOG              taglibmux gsttaglibmux.c:156:gst_tag_lib_mux_render_tag:<tagger> final tags: taglist, audio-codec=(string)"MPEG\ 1\ Audio\,\ Layer\ 3\ \(MP3\)", bitrate=(guint)128000;

What I did next was to manually set the tags on the "id3v2mux" element and everything started to work. Tags are set correctly even with the "split iradio track" feature. So that kind of tells me this information is not send from rhythmbox in the first place (?).

I can cleanup the code and pack the whole stuff into a patch against rhythmbox svn if maintainers would agree to include it.
Comment 6 Martin Szulecki 2007-12-10 22:50:05 UTC
Created attachment 100723 [details]
A very quick implemention of a python based recorder plugin

- Automatic track splitting for streaming sources (iradio) on new tracks
- Use preferred gnome audio profile for recording
- Merge tags of source into encoded file
Comment 7 Jonathan Matthew 2007-12-26 09:19:34 UTC
*** Bug 505212 has been marked as a duplicate of this bug. ***
Comment 8 Jonathan Matthew 2008-08-13 02:02:50 UTC
*** Bug 439940 has been marked as a duplicate of this bug. ***
Comment 9 Jonathan Matthew 2008-12-26 22:03:26 UTC
*** Bug 565461 has been marked as a duplicate of this bug. ***
Comment 10 Justin Clift 2009-11-14 03:31:30 UTC
Martin Szulecki, the author of the plugin above seems to have moved to a different audio player (Banshee?), so isn't maintaining this plug-in any longer.

However, there is another rhythmbox recording plugin available here:

  http://www.programmierecke.net/programmed/rhythmbox-radio-browser.html#Downloads

Looks like it's fairly well developed and actively maintained by its author.
Comment 11 Sven Herzberg 2009-11-20 16:47:17 UTC
Adding bug dependency. Maybe we want to leave this but open until the plugin supports recording via GStreamer.
Comment 12 GNOME Infrastructure Team 2018-05-24 10:51:03 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/80.