启动live555HLSProxy实现RTSP转HLS遇‘无可用子会话’错误
Let's break down why you're hitting this error and walk through fixes step by step:
First off, that error means live555HLSProxy can't detect valid audio/video subsessions (tracks) in your RTSP stream—even though ffplay can play it, the HLS proxy has stricter compatibility rules for HLS standards. Here's how to diagnose and fix this:
Double-check your RTSP URL for typos
Wait a minute—you said ffplay works withrtsp://192.168.1.2:8554/test.mpeg, but you’re passingrtsp://192.168.1.136:8554/test.mpgto the proxy. The IP addresses don’t match, and the file extensions differ (.mpeg vs .mpg). Make sure you’re using the exact same URL that ffplay successfully plays—this is a super common easy fix.Verify your stream’s codec compatibility
live555HLSProxy requires HLS-friendly codecs:- Video: H.264 (MPEG-4 AVC)
- Audio: AAC (MP3 works in some cases, but AAC is preferred)
Useffprobeto check your stream’s codecs:
ffprobe rtsp://192.168.1.2:8554/test.mpegLook for
codec_nameunder the video and audio streams. If you see something like MPEG-2 video or PCM audio, live555 won’t recognize these as usable subsessions for HLS.Inspect the stream’s SDP metadata
Sometimes the RTSP server’s SDP (Session Description Protocol) might be malformed or missing track info that live555 expects. Usertspdumpto grab the SDP:rtspdump -d rtsp://192.168.1.2:8554/test.mpegLook for lines starting with
m=videoandm=audio—these should list the codec types and ports. If either track is missing, or the codec isn’t in live555’s supported list, that’s the root issue.Force subsession selection (if supported)
Try running the proxy with verbose output to see more details about detected subsessions:/path/to/live555HLSProxy -v "rtsp://192.168.1.2:8554/test.mpeg" test_streamSome versions of live555HLSProxy let you manually specify video/audio tracks with
-v <track number>or-a <track number>—check the help docs with/path/to/live555HLSProxy -hfor available flags.Transcode the stream if codecs are incompatible
If your original stream uses non-HLS codecs, use FFmpeg to transcode it to H.264+AAC first, then push it to your live555MediaServer:ffmpeg -i rtsp://192.168.1.2:8554/test.mpeg -c:v libx264 -preset fast -c:a aac -f rtsp rtsp://192.168.1.2:8554/hls_compatible_streamThen point the live555HLSProxy to this new transcoded stream:
/path/to/live555HLSProxy "rtsp://192.168.1.2:8554/hls_compatible_stream" test_stream
内容的提问来源于stack exchange,提问作者marmeladze

