orcasound / orcanode

Software for live-streaming and recording lossy (AAC) or lossless compressed audio (HLS, DASH, FLAC) via AWS S3 buckets. :star:
GNU Affero General Public License v3.0
34 stars 12 forks source link

Number of channels is hard-coded in stream.sh for node type = research #38

Open scottveirs opened 2 years ago

scottveirs commented 2 years ago

Noticed 2 channels in .mp3 file from Sunset Bay (concatenated .ts segments, transcoded), when there is only one hydrophone deployed and I'd set CHANNELS=1 in the .env file. Looked at current master branch in node/stream.sh and saw that $CHANNELS is used within the ffmpeg call for node type hls-only but for node type research it is still hardcoded as -ac 2 ...

## Streaming HLS with FLAC archive 
    nice -n -10 ffmpeg -f jack -i ffjack \
       -f segment -segment_time "00:00:$FLAC_DURATION.00" -strftime 1 "/tmp/$NODE_NAME/flac/%Y-%m-%d_%H-%M-%S_$NODE_NAME-$SAMPLE_RATE-$CHANNELS.flac" \
       -f segment -segment_list "/tmp/$NODE_NAME/hls/$timestamp/live.m3u8" -segment_list_flags +live -segment_time $SEGMENT_DURATION -segment_format \
       mpegts -ar $STREAM_RATE -ac 2 -acodec aac "/tmp/$NODE_NAME/hls/$timestamp/live%03d.ts

the -ac 2 part should be replaced with -ac $CHANNELS and then some tests should be run to ensure that the streamed audio sounds ok (single channel .ts segments play as stereo) and that we're being efficient with S3 storage (i.e. FLAC file has only one channel).