javalibvlcvlcj

RTSP audio stream playback speed with vlcj


Is there any way, or possible workaround to set the playback speed of an RTSP audio stream in vlcj? I faced the problem that libvlc only handles 2x, 3x, 4x rates on streams, and I cannot find a solution it.

My stream provider is live555 media server that supporting multiple clients through tcp from a k8s pod. Other media players, like smplayer can play back my stream with different speed properly, in both faster and slower ranges.


Solution

  • I've found out that the culprit is in fact the media server. It seems like it's only supports the whole value rate settings (2x, 3x ...32x).

    The "working" players were missleading because they handle the speed in the client side, that is why they can work. But as you can probably tell, this approach has a big impact on performance.

    By using wireshark, it can be clearly seen that vlc tries to send the rate value in the Scale header to ask the server for faster/slower playback, but it responds with a rounded setting (if 1,5 gets sent, than it answers with 2). So my assumption that libvlc not supporting it was wrong.

    The other players do not communicate the rate setting to the server.

    RTSP standard - Scale overview