ac2cz / FoxTelem

AMSAT Fox-1 Telemetry Decoder
GNU General Public License v3.0
52 stars 17 forks source link

command-line switch to process wav file in batch mode #702

Closed nTrfAce closed 2 years ago

nTrfAce commented 3 years ago

An enhancement to FoxTelem is requested, that the program would be able to be called from the command line in batch mode to process an audio file. The GUI might or might not display, but no further interaction would be needed and FoxTelem would process the provided .wav file, and if telemetry was decoded, it would upload to the server, if so configured. At the conclusion of processing audio and uploading data, FoxTelem would exit. It is assumed that prior to calling FoxTelem in batch mode it has been configured with settings such as a callsign, location, and the flag to upload data to the server.

A hypothetical example invocation would be: ~/FoxTelem_1.11g_linux/FoxTelem ~/FoxTelem_LogFiles --process-audio merged.wav

The use case is that .ogg audio files are being downloaded from SatNOGS, sox is being used to convert from Ogg to wav, sox is being called to merge many observations into one long audio file, then FoxTelem is processing the audio file to decode and upload telemetry.

It is acknowledged that a better workflow might be to modify the SatNOGS Fox decoder to upload to AMSAT's database if the checksum passes. That would eliminate an external bolt-on system duplicating effort. It would also presumably give better results - if the decoding could happen on the client which has the raw IQ file, rather than a compressed Ogg audio file from the server. Nonetheless, the experiment at hand is producing and contributing decodes.

ac2cz commented 3 years ago

Hi JR. Thanks for putting the details here. I will see what I can do.

ac2cz commented 3 years ago

FoxTelem command line options are updated to the following:

Usage: FoxTelem [-h][-v][-s][--process-audio filename --telem-format format] [--12khz-if] [logFileDir] -h Show this help. -v Display version information. -s Automatically start the decoder if in gui mode. --process-audio - Decode a wav file with no gui. Must also supply a telem-format. --telem-format <duv | high-speed | FOX_BPSK | GOLF_BPSK> - telemetry decoder to use. --12khz-if - Use a 12kHz IF for audio file decoding. logFileDir - Start the decoder in this directory and use the settings stored there.

With this approach we can processes a file from Fox-1C: java -jar FoxTelem.jar --process-audio fox1crecording.wav --telem-format duv

To process a BPSK file for Fox-1E that was created by satnogs we need to use a 12kHz IF. So we use: java -jar FoxTelem.jar --process-audio fox1erecording.wav --telem-format FOX_BPSK --12khz-if

I'm testing this and hope to have a trial version tomorrow.

ac2cz commented 3 years ago

Furthermore, FoxTelem exits with a 0 return code if it successfully processes the file. 1 or another error code is returned if something goes wrong. Error and process messages are only printed if debugging is enabled in the properties file, either by editing it by hand or though the GUI File > Settings. The most useful option is debug Frames.

ac2cz commented 2 years ago

I have merged this into the main 1.12 branch at it will be included in future releases.