mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-24 11:46:30 +00:00
streameye: RPi All: do not assume audio bitrate and num channels
Read audio_bitrate and audio_channels from raspimjpeg.conf file.
This commit is contained in:
parent
c879dc1d09
commit
c39ba16283
@ -158,7 +158,16 @@ function start() {
|
||||
|
||||
audio_opts=""
|
||||
if [ -n "${AUDIO_DEV}" ]; then
|
||||
audio_opts="alsasrc device=${AUDIO_DEV} ! audioresample ! audio/x-raw,rate=16000,channels=2 ! queue ! voaacenc ! rtpmp4gpay pt=97 name=pay1"
|
||||
audio_bitrate=$(grep -e ^audio_bitrate ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
audio_channels=$(grep -e ^audio_channels ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
audio_extras=""
|
||||
if [ -n "${audio_bitrate}" ]; then
|
||||
audio_extras="${audio_extras},rate=${audio_bitrate}"
|
||||
fi
|
||||
if [ -n "${audio_channels}" ]; then
|
||||
audio_extras="${audio_extras},channels=${audio_channels}"
|
||||
fi
|
||||
audio_opts="alsasrc device=${AUDIO_DEV} ! audioresample ! audio/x-raw${audio_extras} ! queue ! voaacenc ! rtpmp4gpay pt=97 name=pay1"
|
||||
fi
|
||||
video_path="/dev/video0"
|
||||
if [ -n "${VIDEO_DEV}" ]; then
|
||||
|
@ -158,7 +158,16 @@ function start() {
|
||||
|
||||
audio_opts=""
|
||||
if [ -n "${AUDIO_DEV}" ]; then
|
||||
audio_opts="alsasrc device=${AUDIO_DEV} ! audioresample ! audio/x-raw,rate=16000,channels=2 ! queue ! voaacenc ! rtpmp4gpay pt=97 name=pay1"
|
||||
audio_bitrate=$(grep -e ^audio_bitrate ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
audio_channels=$(grep -e ^audio_channels ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
audio_extras=""
|
||||
if [ -n "${audio_bitrate}" ]; then
|
||||
audio_extras="${audio_extras},rate=${audio_bitrate}"
|
||||
fi
|
||||
if [ -n "${audio_channels}" ]; then
|
||||
audio_extras="${audio_extras},channels=${audio_channels}"
|
||||
fi
|
||||
audio_opts="alsasrc device=${AUDIO_DEV} ! audioresample ! audio/x-raw${audio_extras} ! queue ! voaacenc ! rtpmp4gpay pt=97 name=pay1"
|
||||
fi
|
||||
video_path="/dev/video0"
|
||||
if [ -n "${VIDEO_DEV}" ]; then
|
||||
|
@ -158,7 +158,16 @@ function start() {
|
||||
|
||||
audio_opts=""
|
||||
if [ -n "${AUDIO_DEV}" ]; then
|
||||
audio_opts="alsasrc device=${AUDIO_DEV} ! audioresample ! audio/x-raw,rate=16000,channels=2 ! queue ! voaacenc ! rtpmp4gpay pt=97 name=pay1"
|
||||
audio_bitrate=$(grep -e ^audio_bitrate ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
audio_channels=$(grep -e ^audio_channels ${RASPIMJPEG_CONF} | cut -d ' ' -f 2)
|
||||
audio_extras=""
|
||||
if [ -n "${audio_bitrate}" ]; then
|
||||
audio_extras="${audio_extras},rate=${audio_bitrate}"
|
||||
fi
|
||||
if [ -n "${audio_channels}" ]; then
|
||||
audio_extras="${audio_extras},channels=${audio_channels}"
|
||||
fi
|
||||
audio_opts="alsasrc device=${AUDIO_DEV} ! audioresample ! audio/x-raw${audio_extras} ! queue ! voaacenc ! rtpmp4gpay pt=97 name=pay1"
|
||||
fi
|
||||
video_path="/dev/video0"
|
||||
if [ -n "${VIDEO_DEV}" ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user