RadioReference on Facebook   RadioReference on Twitter   RadioReference Blog
 

Go Back   The RadioReference.com Forums > Computer Aided Monitoring and Programming > Streaming / Broadcasting / Audio Recording

Streaming / Broadcasting / Audio Recording - Interested in putting your scanner online for others to hear? Want to listen to other radios on the internet. This forum is here for you to discuss these topics related to streaming scanners online.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-28-2017, 12:06 AM
Newbie
   
Join Date: Aug 2015
Location: Salinas, CA
Posts: 1
Default [BATCH] Record Scanner Audio

Hi all!

The problem I was having
I've been having trouble recording dispatch audio at regular intervals for archiving purposes. I wasn't too keen on VOX type recording as Audacity has a really good feature to do that. My issue was I wanted 24/7 recording of audio and to create directories and timestamp the files to easily read. I took information from multiple sources, and decided I would compile it all together for someone else who may want something similar.

Shout outs and thanks
I would like to say thanks to RadioReference and it's helpful members who's posts were invaluable in my research. I would like to point out this thread:
https://forums.radioreference.com/st...tch-audio.html

Without it, and AggieCon's posts, I wouldn't even know where to begin.

Required Download
First things first, you need to download ffmpeg, it's available here:
https://ffmpeg.zeranoe.com/builds/

Be sure to download either the Windows x86 version or the Windows x64 version depending on your operating system.

Setting up ffmpeg
Extract the downloaded zip to you root drive (most commonly C:\)

Rename the ffmpeg folder to ffmpeg. The file structure to the ffmpeg binary should be:
Code:
C:\ffmpeg\bin
Customizing Folder Structure, Timing, and Dated folders
With Windows 7, I had permissions issues so be sure to run as administrator. I keep the batch file (named whatever you want) in the C:\ directory. Furthermore, the permissions issue also caused my recordings to not start due to a missing file, so I added a few lines to the batch file. One last note is that the directories (other than the date) is hardcoded. I provide and record the feed for Salinas Police Dispatch and my stored archives are C:\SPDDispatchArchive Now, this can be named and placed wherever you want, just be sure to change the directory accordingly in the pushd command on line 4 as well as the ffmpeg line on line 10. The file name will look like the following (For 04/27/2017 at 2100): spd_04-27-2017_21h00m00s.mp3 You can also change the "spd" prefix to the abbreviation for the department you would like. This script also organizes the files in dated folders. The file structure ultimately looks like:
Code:
C:\SPDDispatchArchive\2017-04\2017-04-27
So that's about it for customization of the file names and folder structure.

As for the duration of the files, you want to pay attention to the "-t 86400" which is saying 24 hours. That is saying it will record for 24 hours. The next is the -segment_times 3600,7200,10800,etc" parameter which is telling it every 3600 seconds to split the file (1 hour) If you want to change this to say, 30 minutes, you would adjust it to start at 1800 and keep adding that to itself until you reach 84600 (1800,3600,5400,7200,etc)

Discovering your device name for ffmpeg command
Ok so now that I've explained a few things and the important parts, there is one more thing we need to get before we make the batch file. For the ffmpeg, it needs to know what device you're using to capture the audio for the recording. To figure this out, you do:
Open CMD prompt in the ffmpeg bin directory (remember that from ealier? C:\ffmpeg\bin)
Code:
ffmpeg -list_devices true -f dshow -i dummy
This command will list out the devices that ffmpeg recognizes. In my case, it stated my device name as:
Code:
Microphone (Realtek High Defini"
this is used for the audio="" parameter for ffmpeg.

Ok, now we can put everything together, and just simply change anything you want in this batch file to suite your specific needs.

The actual batch script
Code:
@echo off
title Stevens Dispatch Scanner Recorder for Vince - Thanks AggieCon (RadioReference)
:newday
pushd "C:\SPDDispatchArchive"
echo Creating a Directoy for the Day
mkdir %date:~-4,4%-%date:~-10,2%\%date:~-4,4%-%date:~-10,2%-%date:~7,2%
popd
echo New recording session started...
pushd "C:/ffmpeg/bin"
ffmpeg -f dshow -i audio="Microphone (Realtek High Defini" -t 86400 -acodec libmp3lame -ac 1 -ar 11025 -aq 7 -f segment -segment_times 3600,7200,10800,14400,18000,21600,25200,28800,32400,36000,39600,43200,46800,50400,54000,57600,61200,64800,68400,72000,75600,79200,82800 -strftime 1 "C:\SPDDispatchArchive\%%Y-%%m\2017-%%m-%%d\spd_%%m-%%d-%%Y_%%Hh%%Mm%%Ss.mp3"
popd
goto newday
Open up notepad, copy the above into notepad, go to Save As and choose "All Files" instead of saving it as a text document and name it whateveryouwant.bat and save it.

Notes and Conclusion
*RUN ON STARTUP NOTE*
You can set this up to run on startup or as a scheduled task. There are several ways to do it, the simplest being to move the batch file to startup folder. For example Windows 7 is here:
Code:
C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
*Nix/Pie Users note*
I'm assuming you guys know what you're doing and the ffmpeg command should help. Shouldn't be to hard to port this over as a BASH script.

Well I hope this helps some people in the future. Also if you have improvements or suggestions please let me know!
Reply With Quote
Sponsored links
Reply

Tags
audio, batch, record, scanner, windows

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:24 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
All information here is Copyright 2012 by RadioReference.com LLC and Lindsay C. Blanton III.Ad Management by RedTyger
Copyright 2015 by RadioReference.com LLC Privacy Policy  |  Terms and Conditions