[SOLVED] How to record a web radio ?

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
lgmm
New Cone
New Cone
Posts: 9
Joined: 27 Aug 2008 14:45

[SOLVED] How to record a web radio ?

Postby lgmm » 17 Apr 2009 18:58

Hi,

I'd like to record a web radio (http://www.tv-radio.com/station/fip_mp3 ... 3-128k.m3u), is there a command line that can record this radio from now and during 1h30 ?

Thanks for any help
Last edited by lgmm on 27 Apr 2009 16:26, edited 1 time in total.

Arite
Big Cone-huna
Big Cone-huna
Posts: 2478
Joined: 26 Jun 2007 20:40
VLC version: 3.0.20
Operating System: Debian Testing|Win10

Re: How to record a web radio ?

Postby Arite » 17 Apr 2009 19:23

The *.m3u playlist file links to an *.mp3 stream. If you just want to stream to a file you can go to:
Media >> Convert / Save...

And select the "Network" tab. Enter (the link that was in the *.m3u file):
http://mp3.live.tv-radio.com/fip/all/fiphautdebit.mp3

And press "Convert / Save". Tick "File" and enter a destination - e.g. "C:\OUT.mp3". Then for the "Encpasulation" select "RAW". Press "Save".

After 1 hour 30 mins stop the stream.

You might be able to setup a VLM schedule to stop after that time automatically - see here for more info:
http://wiki.videolan.org/VLM

Arite.
Don't use PMs for support questions.

lgmm
New Cone
New Cone
Posts: 9
Joined: 27 Aug 2008 14:45

Re: How to record a web radio ?

Postby lgmm » 17 Apr 2009 22:50

Thanks for the information. In fact, I'm looking for a command line that can record the mp3 stream so it can be scheduled to that recording every day. I thought to vlc to do that but maybe another freeware can do that (if someone know one ..)

Arite
Big Cone-huna
Big Cone-huna
Posts: 2478
Joined: 26 Jun 2007 20:40
VLC version: 3.0.20
Operating System: Debian Testing|Win10

Re: How to record a web radio ?

Postby Arite » 18 Apr 2009 23:02

Yes VLC should be able to do that - see the link to the VLM Wiki article I posted.

An example schedule:
viewtopic.php?f=2&t=55681&p=184816#p184816

See the "Schedule properties" part of the VLM article for info on setting up e.g. period, repeats etc.

As for stopping after 90 min. "--stop-time 5400" could work however I haven't tried it. Also the linked example was done on Linux.

Arite.
Don't use PMs for support questions.

legume
New Cone
New Cone
Posts: 2
Joined: 26 Apr 2009 14:01

Re: How to record a web radio ?

Postby legume » 26 Apr 2009 14:08

hi there,

i have been following the instructions by arite:
The *.m3u playlist file links to an *.mp3 stream. If you just want to stream to a file you can go to:
Media >> Convert / Save...

And select the "Network" tab. Enter (the link that was in the *.m3u file):
http://mp3.live.tv-radio.com/fip/all/fi ... bit.[u]mp3[/u]

And press "Convert / Save". Tick "File" and enter a destination - e.g. "C:\OUT.mp3". Then for the "Encpasulation" select "RAW". Press "Save".

After 1 hour 30 mins stop the stream.
i'm using VLC in GUI mode and don't know how to do the last step.
VLC starts playing back the stream. but it doesn't generate any mp3 file in the local HDD.
i guess i need to tell VLC something like "ok, i'm done with the stream. please stop further buffereing. now flush the contents to the HDD".

but i can't figure out how to do that ...

cheers, legume

Arite
Big Cone-huna
Big Cone-huna
Posts: 2478
Joined: 26 Jun 2007 20:40
VLC version: 3.0.20
Operating System: Debian Testing|Win10

Re: How to record a web radio ?

Postby Arite » 26 Apr 2009 14:24

i'm using VLC in GUI mode and don't know how to do the last step.
Which step would that be... the "And press "Convert / Save"." etc. bit or the "After 1 hour 30 mins stop the stream." bit?

If the former:

Image

Then should create "C:\OUT.mp3" etc.
i guess i need to tell VLC something like "ok, i'm done with the stream. please stop further buffereing. now flush the contents to the HDD".

but i can't figure out how to do that ...
As in you want to get VLC to automatically stop after a certain period of time?

Arite.
Don't use PMs for support questions.

legume
New Cone
New Cone
Posts: 2
Joined: 26 Apr 2009 14:01

Re: How to record a web radio ?

Postby legume » 26 Apr 2009 15:41

thanks for the quick reply.

i'm using the windows version 0.9.9

1)
i used the checkbox "dump raw input" in the "outputs" section.
this will disable / grey out the "profile" section.
this will generate the stream output string ":demux=dump :demuxdump-file=D:\_streamrip\test_020.mp3"
strangely, nothing is written to the file system when running in this mode.

2)
i now tried your settings:
in "profile" section use "custom" and then "encapsulation = raw".
this will generate the stream output string ":sout=#duplicate{dst=std{access=file,mux=raw,dst=D:\_streamrip\test_020.mp3}}"
the file is now written to the HDD, fine.

however, i'm still a little confused why the first mode doesn't work.

Arite
Big Cone-huna
Big Cone-huna
Posts: 2478
Joined: 26 Jun 2007 20:40
VLC version: 3.0.20
Operating System: Debian Testing|Win10

Re: How to record a web radio ?

Postby Arite » 26 Apr 2009 16:12

however, i'm still a little confused why the first mode doesn't work.
Yes it is a bug in VLC. If you, for example, enter the commandline string:

Code: Select all

vlc http://mp3.live.tv-radio.com/fip/all/fiphautdebit.mp3 :demux=dump :demuxdump-file=C:\OUT.mp3
It should work fine.

AFAIK this bug is now fixed in VLC 1.0.0:
https://trac.videolan.org/vlc/ticket/1853

Cheers, Arite.
Don't use PMs for support questions.

lgmm
New Cone
New Cone
Posts: 9
Joined: 27 Aug 2008 14:45

Re: How to record a web radio ?

Postby lgmm » 26 Apr 2009 17:25

This command works fine:

"C:\Program Files\VideoLAN\VLC\vlc.exe" http://mp3.live.tv-radio.com/fip/all/fiphautdebit.mp3 :demux=dump :demuxdump-file=C:\OUT.mp3

In fact, I was looking for another solution (the previous link you gave was too complicated for me). But this command works good. Thank you.

One last usefull thing would be the possibility to stop the recording after a given amount of time. I tried to add --stop-time 10 but it did not work.

Arite
Big Cone-huna
Big Cone-huna
Posts: 2478
Joined: 26 Jun 2007 20:40
VLC version: 3.0.20
Operating System: Debian Testing|Win10

Re: How to record a web radio ?

Postby Arite » 26 Apr 2009 19:43

I tried --stop-time before but it didn't work. Now it seems to :) - so no need to do some VLM schedule hopefully :).

The trouble with demux=dump is that it just dumps straight to a file - doesn't read/output the position. Instead try something like this:

Code: Select all

vlc http://mp3.live.tv-radio.com/fip/all/fiphautdebit.mp3 --sout "#duplicate{dst=std{access=file,mux=raw,dst=C:\OUT.mp3}" --stop-time 10
Where "10" is the time in seconds you wish to record for (so 5400 for 1 hour 30 mins).

I successfully recorded (using --stop-time 30) 30 seconds of the radio station like that.

If you want to close VLC after it's finished add vlc://quit to the end of the commandline.

Cheers, Arite.
Don't use PMs for support questions.

lgmm
New Cone
New Cone
Posts: 9
Joined: 27 Aug 2008 14:45

Re: How to record a web radio ?

Postby lgmm » 27 Apr 2009 15:13

It works fine, also on windows with these 2 options (--stop-time and vlc://quit).

So, in case someone else needs to record a mp3 stream during 10 s for instance, the complete command line for windows is:

"C:\Program Files\VideoLAN\VLC\vlc.exe" http://mp3.live.tv-radio.com/fip/all/fiphautdebit.mp3 --sout "#duplicate{dst=std{access=file,mux=raw,dst=C:\OUT.mp3}" --stop-time 60 vlc://quit

Another great thing of doing that with vlc is that It will work also when I will switch to linux.

Thanks again for your help

lgmm
New Cone
New Cone
Posts: 9
Joined: 27 Aug 2008 14:45

Re: [SOLVED] How to record a web radio ?

Postby lgmm » 11 May 2009 18:17

If someone is interrested, here is a perl script that execute the previous vlc command, can be usuefull to create an automated task that does the recording every day:

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
my $dateUs = ($mon+1)."-".$mday."-".(1900+$year);

# print $dateUs;

my $cmd="\"";
my $cmd=$cmd."C:";
my $cmd=$cmd."\\";
my $cmd=$cmd."Program Files";
my $cmd=$cmd."\\";
my $cmd=$cmd."VideoLAN";
my $cmd=$cmd."\\";
my $cmd=$cmd."VLC";
my $cmd=$cmd."\\";
my $cmd=$cmd."vlc.exe";
my $cmd=$cmd."\"";
my $cmd=$cmd." http://mp3.live.tv-radio.com/fip/all/fiphautdebit.mp3 --sout ";
my $cmd=$cmd."\"";
my $cmd=$cmd."#";
my $cmd=$cmd."duplicate{dst=std{access=file,mux=raw,dst=";
my $cmd=$cmd."C\:\\";
my $cmd=$cmd.$dateUs.".mp3";
my $cmd=$cmd."\}\"";
my $cmd=$cmd." --stop-time 5400 vlc://quit";

print $cmd;

system ( $cmd );





This script works with active perl on xp

Jeff Parker
New Cone
New Cone
Posts: 1
Joined: 12 May 2009 09:11

Re: [SOLVED] How to record a web radio ?

Postby Jeff Parker » 12 May 2009 10:02

Hi, I tried this (i.e. windows command line) with http://abc.net.au/brisbane/onair/612stream.asx but it doesn't save to a file that is playable.
I then tried the "record" option in RealPlayer and then to convert the resultant .rm file using this method, and it sort of works. The resultant .mp3 file plays in VLC and RealPlayer, but strangely not in WMP. Any ideas?

burstingfist
New Cone
New Cone
Posts: 1
Joined: 01 Jun 2009 12:14

Re: [SOLVED] How to record a web radio ?

Postby burstingfist » 01 Jun 2009 12:19

Hi, I tried this (i.e. windows command line) with http://abc.net.au/brisbane/onair/612stream.asx but it doesn't save to a file that is playable.
I then tried the "record" option in RealPlayer and then to convert the resultant .rm file using this method, and it sort of works. The resultant .mp3 file plays in VLC and RealPlayer, but strangely not in WMP. Any ideas?
For windows media streams, you likely have to transcode them. here is something that worked for me:

vlc.exe "mms://2.uni1.salem.streamaudio.com/KPDQ_AM?SAT=2f306a8bec7e7d899fb7d275657f8d1a&ts=1243822918209&s=1537&y=2009&m=6&d=1&hh=1&mm=45&ss=46&hip=www_streamaudio_com" --sout "#transcode{acodec=s16l,ab=128,channels=2}:duplicate{dst=std{access=file,mux=wav,dst=OUT.wav}}"

Both the transcode format and encapsulation format are WAV. The may be other combos of encapsulation formats and transcode formats that work as well.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 68 guests