I'm trying to get audio recording to work.
I have a camera that streams video and audio on separate streams.
The video is an mjpeg rtp stream.
The audio is an mp3 rtsp stream.
I'm using the h264_vaapi hardware encoder with VideoWriter set to 1 (encode).
I use qp=23 as additional encoder parameters, as the crf equivalent for the 264 software encoder library.
Video recording works fine but as soon as I set the SecondPath to my audio rtsp stream, the performance drops from 20 FPS to 1 FPS, even in monitor mode only.
Enabling the record mode also outputs no audio and I get the following errors from the zm_send_packet_receive_frame function on audio packets:
The performance drop is caused by av_read_frame on the audio format context. But I still do not understand why there is no audio in the output file.09/06/23 12:46:19.996854 zmc_m1[1738].ERR-zm_ffmpeg.cpp/518 [Unable to send packet Resource temporarily unavailable, continuing]
The interesting thing is that there are two streams encoded in the output file but I cannot hear any audio:
I can record the audio stream with ffmpeg directly:Stream 0
Codec: H264 - MPEG-4 AVC (part 10) (avc1)
Typ: Video
Videoauflösung: 1280x960
Pufferabmessungen: 1280x960
Decodiertes Format:
Ausrichtung: Oben links
Farbsättigungslage: Links
Stream 1
Codec: MPEG AAC Audio (mp4a)
Typ: Audio
Abtastrate: 32000 Hz
Bits pro Sample: 16
Bitrate: 32 kB/s
Code: Select all
ffmpeg -i rtsp://192.168.1.32:5500/stream /tmp/test.mp3
I'm using ffmpeg version 6.0.
Is there anything I am missing? Any help is really appreciated.