[FFmpeg-user] [Ffmpeg-user] Issue converting RTSP stream to HLS with partial audio on source

Rui Gabriel Nunes r-nunes at criticalsoftware.com
Tue Jul 9 13:53:17 EEST 2024


Hello,

I am currently developing a streaming solution for a client which uses FFmpeg to process an RTSP stream and convert it into HLS format. During the testing phase we have run into issues regarding audio processing and require some guidance on how we might possibly resolve it.

Specifically, the client's hardware uses a third party DVR which provides RTSP streams on request which normally do not include any data in audio sub-streams. On specific conditions the DVR will start feeding data into the audio streams (using audio codec PCM S16 BE) which we must be able to process, however FFmpeg stalls whenever no audio data is present and seems to wait until there is audio to consume to start outputting the *.ts segments. We need to be able to start consuming the stream in a timely/immediate fashion even when no audio is present, and must be able to consume the audio without additional input when present, since the third party hardware is entirely responsible for feeding the audio sub-stream and provides no additional tools to determine the presence or lack of audio.

For reference, this is the ffmpeg command we are using at the moment:

ffmpeg -probesize 50000 -analyzeduration 50000 -rtsp_transport tcp  -i "rtsp://<DVR_URL>" -c:v copy -c:a aac -hls_flags append_list+split_by_time+omit_endlist -hls_segment_filename "<SEGMENT_FILENAME>_%03d.ts" -hls_time 1 -hls_list_size 0 "<PLAYLIST_FILENAME>.m3u8"
 We've tried -c:a with the appropriate codec instead of aac, but it produced no result.
Any help would be greatly appreciated!


More information about the ffmpeg-user mailing list