recording stereo audio stream to mp3 getting mono results

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
brianswilson
New Cone
New Cone
Posts: 6
Joined: 19 Jul 2010 15:33

recording stereo audio stream to mp3 getting mono results

Postby brianswilson » 11 Nov 2012 18:34

I'm trying to set up a batch file to use VLC 2.0.3 to record streaming radio programs using the Windows Scheduler (I need my beauty sleep and the 2.0.4 transcoding is broken). The programs are streamed in stereo, but my command turns them into mono mp3 recordings. The volume is also very low in the recordings and the --volume=1023 option has no effect. I'd like to know how to record the stereo broadcast at a decent listening level.

If I open the GUI and click on the record button, I can record in stereo (default) with no volume problems and no special setup. I can't find the VLC log file to see what options are being used by the GUI as arguments (I don't know if logging is a feature that needs to be explicitly started or not). I've searched in the VLC installation area and in my %appdata%/vlc area and don't see anything that looks like a log file.

I'm a novice at VLC command line scripting so please be kind. I'm not even sure I need the #transcode portion of the VLC command (I've tried some things without it and they abort the VLC instance) as it looks like the stream is in an mp3 format already (based on how I misinterpret the verbose comments). I've tried going through the documentation; but the VLC documentation is worse than the Xerox Sigma 9 mainframe manuals and deals mostly with video, not audio issues (not surprised on that point as this is primarily a video product).

The following is the windows batch file I'm using as a test setup. At the moment the URL_IN value is hard coded for testing purposes only. My thanks to george4tape for including his command in a related ticket about the transcoding being broken. I used his work as a starting point for my attempts.

Code: Select all

REM george4tape from ticket 7692 at https://trac.videolan.org/vlc/ticket/7692 REM Use with scheduler to record programs automatically. REM Pass the URL to record into this script as the first argument. REM SET URL_IN="http://war.str3am.com:7180/live" REM SET URL_IN=%1 REM 33 Minutes = 60*33 = 1980 seconds SET REC_SEC="30" SET MONTH=%DATE:~7,2% SET MONTH=%MONTH: =0% SET DAY=%DATE:~4,2% SET DAY=%DAY: =0% SET LOGTIME=%TIME: =0% SET LOGTIME=%LOGTIME:~0,8% SET LOGTIME=%LOGTIME::=_% SET DATE_TIME=%DATE:~-4%_%MONTH%_%DAY%_%LOGTIME% SET DEST="C:\Documents and Settings\Brian S. Wilson\My Documents\%DATE_TIME%.mp3" "C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv -I dummy --volume=1023 --http-caching 5000 --stop-time=%REC_SEC% --sout=#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=raw,dst=%DEST%} %URL_IN% vlc://quit
I have tried several things including changing
:std{access=file,mux=raw,dst=%DEST%}
to
:std{access=file,mux=dummy,dst=%DEST%}
and
:std{access=file,mux=es,dst=%DEST%}
with no success on the mono/stereo or the volume issues.

Here are the verbose messages I get in the output screen. This is from a run with the "raw" mux specified. There are a few more lines output when the session closes, but I can't capture them as the screen closes too quickly. Any help would be appreciated.

Code: Select all

[00e64450] dummy interface: VLC media player - 2.0.3 Twoflower [00e64450] dummy interface: Copyright c 1996-2012 VLC authors and VideoLAN [00e64450] dummy interface: Warning: if you cannot access the GUI anymore, open a command-line window, go to the directory where you installed VLC and run "vlc -I qt" [00e64450] dummy interface: using the dummy interface module... [00e64450] main interface debug: using interface module "dummy" [00e64450] main interface debug: TIMER module_need() : 12.443 ms - Total 12.443 ms / 1 intvls (Avg 12.443 ms) [00e02698] main playlist debug: processing request item: null, node: Playlist, skip: 0 [00e02698] main playlist debug: starting playback of the new playlist item [00e02698] main playlist debug: resyncing on http://war.str3am.com:7180/live [00e02698] main playlist debug: http://war.str3am.com:7180/live is at 0 [00e02698] main playlist debug: creating new input thread [00e58ae0] main input debug: Creating an input for 'http://war.str3am.com:7180/live' [00e541f8] main stream output debug: using sout chain=`transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux= raw,dst=C:\Documents and Settings\Brian S. Wilson\My Documents\2012_11_11_12_16_26.mp3}' [00e541f8] main stream output debug: stream=`std' [00dc0de8] main stream out debug: looking for sout stream module: 1 candidate [00dc0de8] main stream out debug: set config option: sout-standard-access to file [00dc0de8] main stream out debug: set config option: sout-standard-mux to raw [00dc0de8] main stream out debug: set config option: sout-standard-dst to C:\Documents and Settings\Brian S. Wilson\My Documents\2012_11_11_12_16_26.mp3 [00dc0830] main access out debug: looking for sout access module: 1 candidate [00dc0830] access_output_file access out debug: file access output opened (C:\Documents and Settings\Brian S. Wilson\My Documents\2012_11_11_12_16_26.mp3) [00dc0830] main access out debug: using sout access module "access_output_file" [00dc0830] main access out debug: TIMER module_need() : 100.713 ms - Total 100.713 ms / 1 intvls (Avg 100.713 ms) [00dc0ab8] main mux debug: looking for sout mux module: 1 candidate [00dc0ab8] mux_dummy mux debug: Dummy/Raw muxer opened [00dc0ab8] mux_dummy mux: Open [00dc0ab8] main mux debug: using sout mux module "mux_dummy" [00dc0ab8] main mux debug: TIMER module_need() : 1.758 ms - Total 1.758 ms / 1 intvls (Avg 1.758 ms) [00e541f8] main stream output debug: muxer support adding stream at any time [00e541f8] main stream output debug: muxer prefers to wait for all ES before starting to mux [00dc0de8] stream_out_standard stream out debug: using `file/raw://C:\Documents and Settings\Brian S. Wilson\My Documents\2012_11_11_12_16_26.mp3' [00dc0de8] main stream out debug: using sout stream module "stream_out_standard" [00dc0de8] main stream out debug: TIMER module_need() : 105.899 ms - Total 105.899 ms / 1 intvls (Avg 105.899 ms) [00e541f8] main stream output debug: stream=`transcode' [00e68278] main stream out debug: looking for sout stream module: 1 candidate [00e68278] main stream out debug: set config option: sout-transcode-acodec to mp3 [00e68278] main stream out debug: set config option: sout-transcode-ab to 128 [00e68278] main stream out debug: set config option: sout-transcode-channels to 2 [00e68278] main stream out debug: set config option: sout-transcode-samplerate to 44100 [00e68278] stream_out_transcode stream out debug: codec audio=mp3 44100Hz 2 channels 128Kb/s [00e68278] main stream out debug: using sout stream module "stream_out_transcode" [00e68278] main stream out debug: TIMER module_need() : 2.828 ms - Total 2.828 ms / 1 intvls (Avg 2.828 ms) [00e58ae0] main input debug: using timeshift granularity of 50 MiB, in path 'C:\DOCUME~1\BRIANS~1.WIL\LOCALS~1\Temp' [00e58ae0] main input debug: `http://war.str3am.com:7180/live' gives access `http' demux `' path `war.str3am.com:7180/live' [00e58ae0] main input debug: creating demux: access='http' demux='' location='war.str3am.com:7180/live' file='\\war.str3am.com:7180\ live' [00e5c068] main demux debug: looking for access_demux module: 0 candidates [00e5c068] main demux debug: no access_demux module matched "http" [00e5c068] main demux debug: TIMER module_need() : 0.511 ms - Total 0.511 ms / 1 intvls (Avg 0.511 ms) [00e58ae0] main input debug: creating access 'http' location='war.str3am.com:7180/live', path='\\war.str3am.com:7180\live' [00e544a0] main access debug: looking for access module: 2 candidates [00e544a0] access_http access debug: http: server='war.str3am.com' port=7180 file='/live' [00e544a0] main access debug: net: connecting to war.str3am.com port 7180 [00e544a0] main access debug: connection succeeded (socket = 1412) [00e544a0] access_http access debug: protocol 'HTTP' answer code 206 [00e544a0] access_http access debug: Content-Type: audio/mpeg [00e544a0] access_http access debug: Meta-Info: icy-br: 32 [00e544a0] access_http access debug: Meta-Info: icy-description: 3ABN Radio's unique lifestyle format includes talk, information, mu sic and inspiration. [00e544a0] access_http access debug: Icy-Genre: Other/Mixed [00e544a0] access_http access debug: Icy-Name: 3ABN Radio-English [00e544a0] access_http access debug: Meta-Info: icy-pub: 1 [00e544a0] access_http access debug: Meta-Info: icy-url: www.3abnradio.org [00e544a0] access_http access debug: Server: Icecast 2.3.2 [00e544a0] access_http access debug: Icy-MetaInt: 16000 [00e544a0] access_http access warning: ICY metaint=16000 [00e544a0] access_http access: Raw-audio server found, mp3 demuxer selected [00e544a0] access_http access debug: auto re-connect enabled [00e544a0] main access debug: using access module "access_http" [00e544a0] main access debug: TIMER module_need() : 1036.753 ms - Total 1036.753 ms / 1 intvls (Avg 1036.753 ms) [00dc3dc0] main stream debug: Using stream method for AStream* [00dc3dc0] main stream debug: starting pre-buffering [00dc3dc0] main stream debug: received first data after 428 ms [00dc3dc0] main stream debug: pre-buffering done 1024 bytes in 0s - 2 KiB/s [00e63590] main stream debug: looking for stream_filter module: 4 candidates [00e63590] main stream debug: no stream_filter module matching "any" could be loaded [00e63590] main stream debug: TIMER module_need() : 0.660 ms - Total 0.660 ms / 1 intvls (Avg 0.660 ms) [00e63590] main stream debug: looking for stream_filter module: 1 candidate [00e63590] main stream debug: using stream_filter module "stream_filter_record" [00e63590] main stream debug: TIMER module_need() : 0.708 ms - Total 0.708 ms / 1 intvls (Avg 0.708 ms) [00e58ae0] main input debug: creating demux: access='http' demux='mp3' location='war.str3am.com:7180/live' file='\\war.str3am.com:71 80\live' [00e5c068] main demux debug: looking for demux module: 1 candidate [00e5c068] es demux debug: detected format mpga [00e62be0] main demux packetizer debug: looking for packetizer module: 21 candidates [00e62be0] main demux packetizer debug: using packetizer module "mpeg_audio" [00e62be0] main demux packetizer debug: TIMER module_need() : 727.995 ms - Total 727.995 ms / 1 intvls (Avg 727.995 ms) [00e62be0] mpeg_audio demux packetizer debug: MPGA channels:1 samplerate:22050 bitrate:32 [00e58ae0] main input debug: selecting program id=0 [00e5c068] main demux debug: using demux module "es" [00e5c068] main demux debug: TIMER module_need() : 837.241 ms - Total 837.241 ms / 1 intvls (Avg 837.241 ms) [00dc3198] main decoder debug: looking for packetizer module: 21 candidates [00dc3198] main decoder debug: using packetizer module "mpeg_audio" [00dc3198] main decoder debug: TIMER module_need() : 0.728 ms - Total 0.728 ms / 1 intvls (Avg 0.728 ms) [00e58ae0] main input debug: starting in sync mode [00dc2778] main demux meta debug: looking for meta reader module: 2 candidates [00dc2778] lua demux meta debug: Trying Lua scripts in C:\Documents and Settings\Brian S. Wilson\Application Data\vlc\lua\meta\reade r [00dc2778] lua demux meta debug: Trying Lua scripts in C:\Program Files\VideoLAN\VLC\lua\meta\reader [00dc2778] lua demux meta debug: Trying Lua playlist script C:\Program Files\VideoLAN\VLC\lua\meta\reader\filename.luac [00dc2778] main demux meta debug: no meta reader module matching "any" could be loaded [00dc2778] main demux meta debug: TIMER module_need() : 11.551 ms - Total 11.551 ms / 1 intvls (Avg 11.551 ms) [00e58ae0] main input debug: `http://war.str3am.com:7180/live' successfully opened [00e58ae0] main input debug: Buffering 0% [00e58ae0] main input debug: switching to async mode [00e58ae0] main input debug: Buffering 2% [00dc3198] mpeg_audio decoder debug: MPGA channels:1 samplerate:22050 bitrate:32 [00e541f8] main stream output debug: adding a new sout input (sout_input:00e686d8) [00e68278] stream_out_transcode stream out debug: creating audio transcoding from fcc=`mpga' to fcc=`mp3 ' [00e6efe0] main generic debug: looking for decoder module: 31 candidates [00e6efe0] main generic debug: using decoder module "mpeg_audio" [00e6efe0] main generic debug: TIMER module_need() : 303.827 ms - Total 303.827 ms / 1 intvls (Avg 303.827 ms) [00e65750] main encoder debug: looking for encoder module: 13 candidates [00e65750] avcodec encoder debug: libavcodec initialized (interface 0x361100) [libmp3lame @ 00dd3c80] channel_layout not specified [00e65750] avcodec encoder debug: found encoder MPEG I/II Layer 3 [00e65750] main encoder debug: using encoder module "avcodec" [00e65750] main encoder debug: TIMER module_need() : 410.154 ms - Total 410.154 ms / 1 intvls (Avg 410.154 ms) [00e68278] stream_out_transcode stream out debug: Looking for filter (mpga->s32l, channels 1->1, rate 22050->44100) [00e6dcd8] main filter debug: looking for audio filter module: 14 candidates [00e6dcd8] mpgatofixed32 filter debug: mpga->f32l, bits per sample: 32 [00e6dcd8] main filter debug: using audio filter module "mpgatofixed32" [00e6dcd8] main filter debug: TIMER module_need() : 198.840 ms - Total 198.840 ms / 1 intvls (Avg 198.840 ms) [00e68278] main stream out debug: Filter 'mpgatofixed32' (00e6dcd8) appended to chain [00e75b10] main filter debug: looking for audio filter module: 14 candidates [00e75b10] main filter debug: using audio filter module "samplerate" [00e75b10] main filter debug: TIMER module_need() : 2.229 ms - Total 2.229 ms / 1 intvls (Avg 2.229 ms) [00e68278] main stream out debug: Filter 'SRC resampler' (00e75b10) appended to chain [039928b0] main filter debug: looking for audio filter module: 14 candidates [039928b0] audio_format filter debug: f32l->s32l, bits per sample: 32->32 [039928b0] main filter debug: using audio filter module "audio_format" [039928b0] main filter debug: TIMER module_need() : 506.400 ms - Total 506.400 ms / 1 intvls (Avg 506.400 ms) [00e68278] main stream out debug: Filter 'audio_format' (039928b0) appended to chain [00e68278] stream_out_transcode stream out debug: Got complete audio filter chain [00dc0ab8] main mux debug: adding a new input [00dc0ab8] mux_dummy mux debug: adding input [00e58ae0] main input debug: Buffering 5% [00e58ae0] main input debug: Buffering 7% [00e58ae0] main input debug: Buffering 10% [00e58ae0] main input debug: Buffering 13% [00e58ae0] main input debug: Buffering 15% [00e58ae0] main input debug: Buffering 18% [00e58ae0] main input debug: Buffering 20% [00e58ae0] main input debug: Buffering 23% [00e58ae0] main input debug: Buffering 26% [00e58ae0] main input debug: Buffering 28% [00e58ae0] main input debug: Buffering 31% [00e58ae0] main input debug: Buffering 33% [00e58ae0] main input debug: Buffering 36% [00e58ae0] main input debug: Buffering 39% [00e58ae0] main input debug: Buffering 41% [00e58ae0] main input debug: Buffering 44% [00e58ae0] main input debug: Buffering 47% [00e58ae0] main input debug: Buffering 49% [00e58ae0] main input debug: Buffering 52% [00e58ae0] main input debug: Buffering 54% [00e58ae0] main input debug: Buffering 57% [00e58ae0] main input debug: Buffering 60% [00e58ae0] main input debug: Buffering 62% [00e58ae0] main input debug: Buffering 65% [00e58ae0] main input debug: Buffering 67% [00e58ae0] main input debug: Buffering 70% [00e58ae0] main input debug: Buffering 73% [00e58ae0] main input debug: Buffering 75% [00e58ae0] main input debug: Buffering 78% [00e58ae0] main input debug: Buffering 80% [00e58ae0] main input debug: Buffering 83% [00e58ae0] main input debug: Buffering 86% [00e58ae0] main input debug: Buffering 88% [00e58ae0] main input debug: Buffering 91% [00e58ae0] main input debug: Buffering 94% [00e58ae0] main input debug: Buffering 96% [00e58ae0] main input debug: Buffering 99% [00e58ae0] main input debug: Stream buffering done (1018 ms in 1461 ms) [00e58ae0] main input debug: Decoder buffering done in 0 ms [00e6efe0] mpeg_audio generic debug: MPGA channels:1 samplerate:22050 bitrate:32 [00e6dcd8] mpgatofixed32 filter debug: libmad error: bad main_data_begin pointer [00e544a0] access_http access debug: New Title=

bat999
Cone that earned his stripes
Cone that earned his stripes
Posts: 200
Joined: 19 Dec 2007 02:35

Re: recording stereo audio stream to mp3 getting mono result

Postby bat999 » 11 Nov 2012 19:34

Hi
... The programs are streamed in stereo...
Your "war.str3am.com:7180/live" stream is 32Kbps mono mp3.
...and the --volume=1023 option has no effect...
I don't think that the "--volume" option is intended to work with sout.
... I'm not even sure I need the #transcode portion of the VLC command...
Probably george4tape chose to transcode because that "Radio Caroline" feed is aac, not mp3.
No need for you to transcode, try a command like this:-

Code: Select all

"C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv -I dummy --stop-time=%REC_SEC% --sout="#std{access=file,mux=raw,dst=dst=%DEST%} %URL_IN% vlc://quit

Code: Select all

Overall bit rate mode : Constant Overall bit rate : 32.0 Kbps Audio Format : MPEG Audio Format version : Version 2 Format profile : Layer 3 Duration : 46s 759ms Bit rate mode : Constant Bit rate : 32.0 Kbps Channel(s) : 1 channel Sampling rate : 22.05 KHz Compression mode : Lossy Stream size : 182 KiB (100%)

brianswilson
New Cone
New Cone
Posts: 6
Joined: 19 Jul 2010 15:33

Re: recording stereo audio stream to mp3 getting mono result

Postby brianswilson » 12 Nov 2012 03:10

Thank you for the help bat999. I had assumed that this was stereo because that is what the GUI records (at 44Kbps for some reason, probably the default recording values). I did try the command

Code: Select all

"C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv -I dummy --stop-time=%REC_SEC% --sout="#std{access=file,mux=raw,dst=%DEST%} %URL_IN% vlc://quit
and it does work, but records a mono signal at 22050 Hz for some reason. I will keep plugging away until I can figure out how the GUI does the recording. If someone could point me to the log file, or tell me how to get logging of the GUI session parameters going, I would be very grateful.

bat999
Cone that earned his stripes
Cone that earned his stripes
Posts: 200
Joined: 19 Dec 2007 02:35

Re: recording stereo audio stream to mp3 getting mono result

Postby bat999 » 12 Nov 2012 03:39

... or tell me how to get logging of the GUI session parameters going...
Tools > Messages > Verbosity 2
Then start the GUI recording.

brianswilson
New Cone
New Cone
Posts: 6
Joined: 19 Jul 2010 15:33

Re: recording stereo audio stream to mp3 getting mono result

Postby brianswilson » 12 Nov 2012 03:45

Again many thanks. This will be a big help in future.

brianswilson
New Cone
New Cone
Posts: 6
Joined: 19 Jul 2010 15:33

Re: recording stereo audio stream to mp3 getting mono result

Postby brianswilson » 12 Nov 2012 17:10

Thank you for all the help. I've kept the transcoding so I can specify the sample rate, and because I would like to make this a more general recording batch file for any type of streaming URL.

In the interest of helping the community, I've attached the final working copy (at least for http streams) of the batch file to this message. There is a default http stream used if you don't specify one on the command line. I've also left some debugging REM statements in the batch file and set the REC_SEC to 30 seconds just for testing (You can reset this to a different value as shown in the following lines). The batch file does work from the Windows Scheduler and you can set the URL on the command line (don't use "s around the URL argument (%1) as this gives the scheduler problems). In the scheduler, use quotes (") around the full path to the batch file if you have any spaces in the path (i.e. C:\Program Files\...).

One problem I haven't fixed yet is how to handle mms streams. The batch file works for http, but not for mms streams. With mms streams, VLC will record an mp3 file that contains only about a second's worth of sound then it aborts. If some kind sole would like to point me to some relevant documentation (yes, I'm an idiot nubee), or suggest a solution, I would be eternally grateful. I think this has something to do with the "std{access=file,mux=raw,..." portion of the command. I believe the "mux=" value needs to be changed for the mms streams, but don't know what to change it into.

Code: Select all

@echo off REM george4tape from ticket 7692 at https://trac.videolan.org/vlc/ticket/7692 REM Use with scheduler to record programs automatically. REM Pass the URL to record into this script as the first argument. REM SET DEF_URL_IN="mms://livestream.andrews.edu/waus-28" SET DEF_URL_IN="http://war.str3am.com:7180/live" echo. SET URL_IN="%1" IF "%~1"=="" echo Command line parameter is not set. IF "%~1"=="" SET URL_IN=%DEF_URL_IN% SET REC_SEC="30" REM 33 Minutes = 60*33 = 1980 seconds REM SET REC_SEC="1980" SET MONTH=%DATE:~4,2% SET MONTH=%MONTH: =0% SET DAY=%DATE:~7,2% SET DAY=%DAY: =0% SET LOGTIME=%TIME: =0% SET LOGTIME=%LOGTIME:~0,8% SET LOGTIME=%LOGTIME::=_% SET DATE_TIME=%DATE:~-4%_%MONTH%_%DAY%_%LOGTIME% SET DEST="C:\Documents and Settings\Brian S. Wilson\My Documents\Your Story Hour\YSH-3ABN-%DATE_TIME%.mp3" echo. echo Recording: %URL_IN% to %DEST% for %REC_SEC% seconds. echo. "C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv -I dummy --http-caching 5000 --stop-time=%REC_SEC% --sout=#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=raw,dst=%DEST%} %URL_IN% vlc://quit REM "C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv -I dummy --mms-caching 5000 --stop-time=%REC_SEC% --sout=#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=raw,dst=%DEST%} %URL_IN% vlc://quit REM "C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv -I dummy --http-caching 5000 --stop-time=%REC_SEC% --sout=#std{access=file,mux=raw,dst=%DEST%} %URL_IN% vlc://quit REM pause

brianswilson
New Cone
New Cone
Posts: 6
Joined: 19 Jul 2010 15:33

Re: recording stereo audio stream to mp3 getting mono result

Postby brianswilson » 12 Nov 2012 18:06

I've done some further playing around and found that the following command

Code: Select all

"C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv -I dummy --mms-caching 5000 mms://livestream.andrews.edu/waus-28 vlc://quit --sout "#transcode{acodec=mp3,ab=192}:std{access=file,mux=raw,dst=C:\Documents and Settings\Brian S. Wilson\My Documents\prova.mp3}
will create a test mp3 file of any length with no abort issues; but the following command

Code: Select all

"C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv -I dummy --mms-caching 5000 --stop-time=30 mms://livestream.andrews.edu/waus-28 vlc://quit --sout "#transcode{acodec=mp3,ab=192}:std{access=file,mux=raw,dst=C:\Documents and Settings\Brian S. Wilson\My Documents\prova.mp3}
aborts after just a few seconds. The only difference is the use of the "--stop-time=30" command line option. I have no idea why this should be the case. I've opened ticket #7756 to see if this can be fixed.

VelC
New Cone
New Cone
Posts: 3
Joined: 27 Jul 2015 13:53

Re: recording stereo audio stream to mp3 getting mono results

Postby VelC » 04 Aug 2015 16:46

As you are interested in a VLC video or audio recorder via batch file I post my solution here. The comments are in German, however presuming some knowledge in batch programming the code should be applicable after some initial settings. It works with Windows 7 and VLC 2.2.1.

Code: Select all

echo off :: VIDEO/AUDIO-RECORDER MIT TIMER FÜR AUFNAHMEN MIT DEM VLC-PLAYER. SIGNALQUELLE: DVB-T-Fernsehen und Internet-Radio :: ================================================================================================================== :: Bitte EINSTELLUNGEN und HINWEISE weiter unten beachten! :: Version 2015.08.02 :: ### DATEN DER AUFNAHME ############# Folgende 6 set-Kommandos zwischen = und " editieren. Leerzeichen unzulässig! ############### :: Eine Senderkennung laut Programmlisten (s. u.) eintragen. set "Sender=RadioSwissClassic" :: Dateinamen (ohne Endung) eintragen, unter dem die Aufnahme gespeichert werden soll. Erlaubt ist 1aA.-_!()$§%&@ Verboten ist ,\/?:*"><|Leerzeichen set "Dateiname=Test-1minute-mp3" :: Datum des Aufnahmebeginns eintragen (TT.MM.JJJJ). set "DatumAufnahmebeginn=04.08.2015" :: Uhrzeit des Aufnahmebeginns eintragen (hh:mm). set "UhrzeitAufnahmebeginn=00:01" :: Aufnahmedauer (in ganzen Minuten) eintragen. set "AufnahmedauerMinuten=1" :: Verhalten des Rechners nach Aufnahme eintragen. 0: Rechner bleibt an, 1: Rechner fährt herunter. set "Herunterfahren=0" :: Speichern nicht vergessen! :: ### DATEN DER AUFNAHME, ENDE ####################################################################################################### :: ### EINSTELLUNGEN ################################################################################################################## :: Zielverzeichnis eintragen, am Ende ohne Backslash. Beispiel: E:\Music\VLC-Stream-Aufnahmen set "Zielverzeichnis=E:\Music\VLC-Stream-Aufnahmen" :: Programmliste (Fernsehen) für DVB-T-Sender (hier: Teutoburger Wald,Bielstein) :: Die typische Reichweite eines DVB-T-Senders beträgt 40 km. Liste nach Empfängerstandort ergänzen. :: Senderfrequenzen in Deutschland siehe :: 1, Service-IDs eines Bouquets siehe :: 2 und :: 3 :: 1 http://www.dvb-t-portal.de/Regionen/index.php :: 2 https://www.vlc-forum.de/index.php/Thread/908-tv-tv-empfang-f%C3%BCr-dvb-t/ :: 3 http://www.vdr-wiki.de/wiki/index.php/Kategorie:Channels.conf_DVBT Frequenz: 1. Zahl, Service-ID: vor dem drittletzten Doppelpunkt stehende Zahl IF %Sender%==ARD set Frequenz=514 & set ServiceID=256 IF %Sender%==ZDF set Frequenz=570 & set ServiceID=514 IF %Sender%==3sat set Frequenz=570 & set ServiceID=515 IF %Sender%==arte set Frequenz=514 & set ServiceID=2 IF %Sender%==Phoenix set Frequenz=514 & set ServiceID=3 IF %Sender%==EinsFestival set Frequenz=514 & set ServiceID=5 IF %Sender%==ZDFinfo set Frequenz=570 & set ServiceID=516 IF %Sender%==neoKiKa set Frequenz=570 & set ServiceID=517 IF %Sender%==MDR set Frequenz=554 & set ServiceID=100 IF %Sender%==NDR set Frequenz=554 & set ServiceID=129 IF %Sender%==SWR set Frequenz=554 & set ServiceID=226 IF %Sender%==WDR-BI set Frequenz=554 & set ServiceID=258 IF %Sender%==WDR-SG set Frequenz=554 & set ServiceID=264 IF %Sender%==Pro7Hannover set Frequenz=658 & set ServiceID=16403 :: Programmliste für Internet-Radio :: URL unter Stationsnamen recherchieren IF %Sender%==BRKlassik set Frequenz=0 & set SenderURL=http://br-mp3-br-klassik-m.akacast.akamaistream.net/7/120/142693/v1/gnl.akacast.akamaistream.net/br_mp3_br-klassik_m IF %Sender%==WDR3 set Frequenz=0 & set SenderURL=http://wdr-3.akacast.akamaistream.net/7/47/119437/v1/gnl.akacast.akamaistream.net/wdr-3 IF %Sender%==WDR4 set Frequenz=0 & set SenderURL=http://wdr-4.akacast.akamaistream.net/7/42/119438/v1/gnl.akacast.akamaistream.net/wdr-4 IF %Sender%==RadioSwissClassic set Frequenz=0 & set SenderURL=http://stream.srg-ssr.ch/m/rsc_de/mp3_128 IF %Frequenz% GTR 0 (set "endg=ts") ELSE (set "endg=mp3") :: ### EINSTELLUNGEN-ENDE ######################################################################################################################### :: ### HINWEISE ################################################################################################################################### :: Dateiendung "txt" in "bat" ändern. :: Diese bat-Datei wendet sich an Nutzer mit Grundkenntnissen in Batch-Programmierung. Alle anderen beachten bitte: :: Sie bearbeiten bei Ihren Eintragungen in einen Programmcode. Änderungen außerhalb der Batch-Syntax führen zum Misserfolg. :: Videodateien werden als *.ts gespeichert, Audiodateien als *.mp3. :: Wenn Sie nicht in der Nähe des DVB-T-Senders Teutoburger-Wald-Bielstein (nahe Detmold) empfangen, ergänzen Sie die Fernseh-Programmliste um die :: interessierenden Stationen. Die vorhandene Liste kann bestehen bleiben. :: Sich überlappende mp3-Aufnahmen sind mit mehreren, verschieden benannten bat-Dateien möglich. :: Für Sofortaufnahme das Datum des Vortags eintragen, Uhrzeit beliebig. :: Tipp: Eintragungen einer zeitgesteuerten Aufnahme mittels kurzer Sofortaufnahme kontrollieren! :: Tipp: Bei DVB-T-Aufnahmen Anschließen des Empfängers (z. B. USB-Stick mit Antenne) nicht vergessen! :: Tipp: Speichern der Einträge vor dem Starten nicht vergessen! :: Tipp: Die vom Internet-Provider ausgelöste Zwangsunterbrechung (üblicherweise zwischen 3 und 5 Uhr nachts) bricht Aufnahmen ab. Das Intervall :: kann mit der Router-Softwäre geändert werden. :: ### HINWEISE-ENDE ############################################################################################################################### :: Hiernach editieren nur noch Entwickler ;) :: set Dateiname=%Dateiname%.%endg% +++ set "Dateiname=%Dateiname%.%endg%" set "batPfad=%~f0" title %batPfad% echo Sender: %Sender% echo Dateiname: %Dateiname% echo Datum Aufnahmebeginn: %DatumAufnahmebeginn% echo Uhrzeit Aufnahmebeginn: %UhrzeitAufnahmebeginn% echo Aufnahmedauer in Minuten: %AufnahmedauerMinuten% echo Herunterfahren: %Herunterfahren% echo Zielverzeichnis: %Zielverzeichnis% echo cmd-Fenstertitel: %batPfad% :: Format von %DatumAufnahmebeginn% auf JJJJ.MM.TT umstellen set "DatumAufnahmebeginn=%DatumAufnahmebeginn:~6,4%.%DatumAufnahmebeginn:~3,2%.%DatumAufnahmebeginn:~0,2%" :: set ZeitAufnahmebeginn="%DatumAufnahmebeginn%_%UhrzeitAufnahmebeginn%" +++ set "ZeitAufnahmebeginn=%DatumAufnahmebeginn%_%UhrzeitAufnahmebeginn%" set /a "Frequenz = 1000000*%Frequenz%" if "%Frequenz%" GTR "0" set SenderURL=dvb-t://frequency=%Frequenz%:bandwidth=0 :dvb-adapter=0 :live-caching=1000 :program=%ServiceID% set /a "AufnahmedauerSekunden=60*%AufnahmedauerMinuten%" set /a "AufnahmedauerSekundenPlus=%AufnahmedauerSekunden%+5" echo Datum und Uhrzeit bei Warte- oder Aufnahmebeginn: %date% %time% :WARTESCHLEIFE set "Uhrzeit=%time%" :: Format von %Uhrzeit% auch im Bereich einstelliger Stunden auf hh:mm setzen (microsoft-Syntax liefert dafür 0:00... 9:59 Uhr mit führendem Leerzeichen!): if "%Uhrzeit:~0,1%"==" " set "Uhrzeit=0%time:~1,7%" :: set Zeit="%date:~6,4%.%date:~3,2%.%date:~0,2%_%Uhrzeit%" +++ set "Zeit=%date:~6,4%.%date:~3,2%.%date:~0,2%_%Uhrzeit%" :: Minütliche Anzeige des Aufnahmebeginns set "Sekunden=%Zeit:~18,2%" if "%Sekunden%" GEQ "55" echo Aufnahmebeginn am %DatumAufnahmebeginn% um %UhrzeitAufnahmebeginn% Uhr if "%Zeit%" GEQ "%ZeitAufnahmebeginn%" ( START "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -vvv --run-time=%AufnahmedauerSekunden% %SenderURL% --sout=#file{dst="%Zielverzeichnis%\%Dateiname%"} vlc://quit ping -n %AufnahmedauerSekundenPlus% 127.0.0.1 > NUL if %Herunterfahren%==1 shutdown.exe /s /t 00 ) else ( :: Abfrageintervall timeout /T 5 /nobreak goto WARTESCHLEIFE ) :: Warteschleifenende


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 49 guests