Page 1 of 1

Stop working record audio stream

Posted: 26 Aug 2022 08:54
by Tormund1985
I am working with the following command from an ubuntu server to record an audio stream that I am broadcasting from a Pi zero with microphone through ffmpeg.

Code: Select all

cvlc --repeat -vvv tcp/wav://7xxxxx --sout="#std{access=file,mux=ogg,dst=/home/VLC_audios/$(date +%Y%m%d_%H%M%S_audio).wav}"
After executing the command in VLC it starts working but after a few minutes it stops working, without showing any log or warning. I know it has stopped working because the .wav file stops increasing its size.

I don't have great knowledge in cvlc so I would appreciate your help.

Re: Stop working record audio stream

Posted: 29 Aug 2022 13:47
by unidan
Can you share the broadcast ffmpeg command too ?

Re: Stop working record audio stream

Posted: 29 Aug 2022 14:52
by InTheWings
wav into ogg won't achieve anything

Re: Stop working record audio stream

Posted: 30 Aug 2022 09:17
by Tormund1985
Can you share the broadcast ffmpeg command too ?
Of course:

Code: Select all

while true; do ffmpeg -ar 44100 -ac 1 -f alsa -i plughw:2,0 -f wav -listen 1 tcp://xxxxx:xxxxx@0.0.0.0:8554; done

Re: Stop working record audio stream

Posted: 30 Aug 2022 09:19
by Tormund1985
wav into ogg won't achieve anything
So which output should I use for the mux? wav directly?

Thanks.

Re: Stop working record audio stream

Posted: 30 Aug 2022 09:59
by unidan
For wav, you can use the wav muxer, and let the correct demuxer open (avformat will get chosed).

Code: Select all

while true; 130 ↵ do ffmpeg -ar 44100 -ac 1 -f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo.3 -f wav -listen 1 tcp://0.0.0.0:8554; done # ... cvlc -vvv tcp://127.0.0.1:8554 --sout="#std{access=file,mux=wav,dst=audiotest$(date +%Y%m%d_%H%M%S_audio).wav}"

Re: Stop working record audio stream

Posted: 30 Aug 2022 10:19
by Tormund1985
For wav, you can use the wav muxer, and let the correct demuxer open (avformat will get chosed).

Code: Select all

while true; 130 ↵ do ffmpeg -ar 44100 -ac 1 -f pulse -i alsa_input.pci-0000_00_1f.3.analog-stereo.3 -f wav -listen 1 tcp://0.0.0.0:8554; done # ... cvlc -vvv tcp://127.0.0.1:8554 --sout="#std{access=file,mux=wav,dst=audiotest$(date +%Y%m%d_%H%M%S_audio).wav}"
When I execute sh file it shows, but I tested and its recording.

Code: Select all

libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 alsa_input.pci-0000_00_1f.3.analog-stereo.3: No such process

Re: Stop working record audio stream

Posted: 30 Aug 2022 10:25
by unidan
Hi, you should replace the -f pulse -i .... by -f alsa -i plughw:2,0 on your end if you use alsa for that.

Re: Stop working record audio stream

Posted: 30 Aug 2022 19:40
by Tormund1985
It keeps stopping without repeating a pattern or any alarm, this time it only recorded 8 minutes.

Could I modify the buffer?

Re: Stop working record audio stream

Posted: 08 Sep 2022 11:11
by Tormund1985
From pi Zero I get thorough journalctl next messages:

Code: Select all

sep 08 09:30:39 PIZERO2A rc.local[515]: Error writing trailer of tcp://0.0.0.0:8554: Broken pipe sep 08 09:30:39 PIZERO2A rc.local[515]: size= 290923kB time=00:59:59.78 bitrate= 662.1kbits/s speed=1.07x sep 08 09:30:39 PIZERO2A rc.local[515]: video:0kB audio:290924kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: u sep 08 09:30:39 PIZERO2A rc.local[515]: Conversion failed! sep 08 09:30:40 PIZERO2A rc.local[515]: ffmpeg version 4.1.9-0+deb10u1+rpt1 Copyright (c) 2000-2022 the FFmpeg developers sep 08 09:30:40 PIZERO2A rc.local[515]: built with gcc 8 (Raspbian 8.3.0-6+rpi1) sep 08 09:30:40 PIZERO2A rc.local[515]: configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardened --incdir=/ sep 08 09:30:40 PIZERO2A rc.local[515]: WARNING: library configuration mismatch sep 08 09:30:40 PIZERO2A rc.local[515]: avutil configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardene sep 08 09:30:40 PIZERO2A rc.local[515]: avcodec configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardene sep 08 09:30:40 PIZERO2A rc.local[515]: avformat configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardene sep 08 09:30:40 PIZERO2A rc.local[515]: avdevice configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardene sep 08 09:30:40 PIZERO2A rc.local[515]: avfilter configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardene sep 08 09:30:40 PIZERO2A rc.local[515]: avresample configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardene sep 08 09:30:40 PIZERO2A rc.local[515]: swscale configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardene sep 08 09:30:40 PIZERO2A rc.local[515]: swresample configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardene sep 08 09:30:40 PIZERO2A rc.local[515]: postproc configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardene sep 08 09:30:40 PIZERO2A rc.local[515]: libavutil 56. 22.100 / 56. 22.100 sep 08 09:30:40 PIZERO2A rc.local[515]: libavcodec 58. 35.100 / 58. 35.100 sep 08 09:30:40 PIZERO2A rc.local[515]: libavformat 58. 20.100 / 58. 20.100 sep 08 09:30:40 PIZERO2A rc.local[515]: libavdevice 58. 5.100 / 58. 5.100 sep 08 09:30:40 PIZERO2A rc.local[515]: libavfilter 7. 40.101 / 7. 40.101 sep 08 09:30:40 PIZERO2A rc.local[515]: libavresample 4. 0. 0 / 4. 0. 0 sep 08 09:30:40 PIZERO2A rc.local[515]: libswscale 5. 3.100 / 5. 3.100 sep 08 09:30:40 PIZERO2A rc.local[515]: libswresample 3. 3.100 / 3. 3.100 sep 08 09:30:40 PIZERO2A rc.local[515]: libpostproc 55. 3.100 / 55. 3.100
I don't understand what is happening, could you help me?