<html><head></head><body><span class="viv-signature"></span>On Monday 19
December 2022 03:38:38 (+01:00), Joel Lord via gstreamer-devel
wrote:<br><br>> I'm trying to take an audio feed from a microphone
connected via a USB interface and (ideally) stream it directly out via
HTTP. I want multiple end users to be able to get to the stream and listen
to it, real time, from their phones. I haven't had any luck finding
components that add up to that, but I did find how to produce a mpeg4ts
stream, so I added a static image and have that streaming successfully, I
added in a clock to have something changing to prove that it was working.
But the audio never comes through.<br>> <br>> If I take the mpegtsmux
and hlssink off the end of my pipeline and replace it with a filesink I can
prove that my audio is working fine, but when I feed it to mpegtsmux and
hlssink it seems to get ignored. If I have no image it never creates a
second segment or the playlist for the stream, so I can't see anything at
all. If I include the image the stream works but it seems to have no
audio. I've tried 3 or 4 different audio formats, it doesn't complain that
I have a format mismatch and it seems to be working, but nothing comes
through.<br>> <br>> Using gstreamer1.0 version 1.18.4 on a Raspberry
Pi 4.<br>> <br>> gst-launch-1.0 -v \<br>> mpegtsmux name=mux !
hlssink playlist-root=http://stream.ek:80/stream_files
location=/var/www/stream/stream_files/segment%05d.ts target-duration=3
playlist-location=/var/www/stream/playlist.m3u8 \<br>> filesrc
location=/home/pi/EKPB.png ! decodebin ! \<br>> videoconvert !
video/x-raw,format=I420 ! imagefreeze ! \<br>> clockoverlay
halignment=right ! x264enc ! mux. \<br>> alsasrc ! audioconvert !
audio/x-raw,channels=1 ! \<br>> level ! avenc_mp2fixed ! queue
max-size-buffers=0 max-size-bytes=0 max-size-time=1000000000 !
mux.<br>> <br>> If I take the queue out of the audio path it tosses a
few warnings about dropping samples (a lot of samples) and gives me no
faith that it will work. Changing the buffer settings on the queue made no
difference.<br>> <br>> So for anyone who has made it this far, I'm
quite open to better solutions than I've found OR fixing the one that I
have that isn't working. I don't actually want anything but the audio
feed, and I want it as close to 0 latency as I can get.<br>> <br>>
Thanks for your help!<br>> <br><span
class="viv-signature-below"><br>Interesting! hlssink expects video key
frames to know when it can start a new segment (which has to start with a
key frame) so I don't know what happens with an audio only stream. At least
for getting things working, it's probably going to be easiest to indeed
have a "dummy" video track in there. </span><div><br><div><span
class="viv-signature-below">I use the following for HLS
audio:</span></div><div><span class="viv-signature-below"><font
face="monospace"><br></font></span></div><div><span
class="viv-signature-below"><font face="monospace">... ! avenc_aac !
aacparse ! mpegtsmux</font></span></div><div><span
class="viv-signature-below"><br></span></div><div><span
class="viv-signature-below">Maybe give that a go? The aacparse might be
adding information needed by the muxer or the sink.</span></div><div><span
class="viv-signature-below"><br></span></div><div><span
class="viv-signature-below">For x264enc you may need to specify a keyframe
interval (key-int-max=<number of frames>) but hlssink will actively
ask its upstream for key frames so that might not be required. Maybe also
specify a framerate in your video caps, I don't know what the default is.
After x264enc I also have a parser:</span></div><div><br></div><div><font
face="monospace">... ! x264enc ! h264parse config-interval=-1 !
...</font><br><div><br></div></div><div><span
class="viv-signature-below">HTH,</span></div><div><span
class="viv-signature-below">Michiel</span></div></div></body></html>